computer graphics

460
DTEIT 19/8/99 CG-6284 1

Upload: vipanarora

Post on 15-Sep-2015

5 views

Category:

Documents


1 download

DESCRIPTION

Computer Graphics

TRANSCRIPT

  • CG-6284

  • GEOMETRICAL TRANSFORMATIONS This section introduces the basic 2-D and 3-D geometrical transformations used in computer graphics. In general, many applications use the geometric transformations to change the position, orientation & size of objects in a drawing.

    CG-6284

  • GEOMETRICAL TRANSFORMATIONSExample A city planning application program would use translation to place symbols for buildings & trees at appropriate positions, rotation to orient the symbols & scaling to size the symbols.

    CG-6284

  • GEOMETRIC TRANSFORMATIONSCHANGES IN ORIENTATION, SIZE AND SHAPE ARE ACCOMPLISHED WITH GEOMATRIC TRANSFORMATIONS THAT ALTER THE COORDINATE DESCRIPTIONS OF OBJECTS.

    CG-6284

  • GRAPHICS TRANSFORMATIONS Computer graphics system is the ability to simulate both the movement and the manipulation of the objects in the plane. These process are described in terms of translations, rotations, scaling and reflections.

    CG-6284

  • The mathematical statement of the viewpoint is described by geometric transformations applied to each point of the object. This effect is attained through the application of coordinate transformations.GEOMETRIC TRANSFORMATIONS

    CG-6284

  • Let us impose a coordinate system on a plane. An object obj in the plane can be considered as a set of points. Every set point p has coordinates ( x, y ) and so the object is the sum total of all its coordinate points.GEOMETRIC TRANSFORMATIONS

    CG-6284

  • Every set point p has coordinates ( x, y ) and so the object is the sum total of all its coordinate points.

    CG-6284

  • If the object is moved to a new position, it can be regarded as a new object obj , all of whose coordinate points p can be obtained from the original points p by the application of a geometric transformation.GEOMETRIC TRANSFORMATIONS

    CG-6284

  • GEOMETRIC TRANSFORMATIONS

    CG-6284

  • BASIC TRANSFORMATIONSBASIC GEOMETRIC TRANSFORMATION ARE1. TRANSLATION, 2. ROTATION, 3. SCALING.

    CG-6284

  • BASIC TRANSFORMATIONSTRANSLATION A translation is applied to an object by a repositioning it along a straight line path from one co-ordinate location to another. In translation , an object is displaced a given distance and direction from its original position.

    CG-6284

  • TRANSLATE A 2-D POINT We translate a 2 dimensional point by adding translation distance, tx and ty to the original co-ordinate position (x,y) to move the point to a new position (x`,y`) x`=x+ tx , y`=y+ty translation distance pair (tx , ty ) is called the translation vector or shift vector.

    CG-6284

  • TRANSLATION If the displacement is given by the vector v=txi + tyj , The new object point p(x,y) can be found by applying the transformation tv to p(x,y) p=tv(p) where x=x+tx and y=y+ty

    CG-6284

  • TRANSLATION

    CG-6284

  • TRANSLATING A POINTTRANSLATING A POINT FROM POSTION P TO P` WITH TRANSLATION VECTOR T.p = (x1, x2)p = (x1, x2) t = (tx, ty)

    CG-6284

  • TRANSLATING A POINT This allow us to write the 2-D. Translation location in matrix form P`=P + T Translation is a rigid body transformation that moves objects without deformations.# Every point on the object is translated by the same amount.

    CG-6284

  • MOVING A POLYGON MOVING A POLYGON FROM POSITION P1 TO POSITION P2 WITH THE TRANSLATION VECTOR (4.90, 5.10). 5 10 15 20 5 10 15 2020

    15

    10

    5

    20

    15

    10

    5

    CG-6284

  • TRANSLATING CURVED SURFACE Similar methods are used to translate curved objects. To change the position of a circle or ellipse we translate the center coordinate and redraw the figure in the new location

    CG-6284

  • ROTATIONA two dimensional rotation is applied to an object by repositioning it along circular path in the x, y plane. To generate a rotation we specific rotation angle and the position(xr, yr) of the rotation point or (pivot point) about which the object is to be rotated .

    CG-6284

  • ROTATIONRotation of an object throughangle about the pivot point (xr,yr)

    CG-6284

  • ROTATION Positive values for the rotation angle define counterclockwise rotations about the pivot point . Negative values rotate objects in the clockwise direction. This kind of transformation can also be described as a rotation about a rotation axis. This axis is perpendicular to the xy plane and passes through the pivot point.

    CG-6284

  • ROTATION We first determine the transformation equation for rotation of a point position P when the pivot point is at the coordinate origin. The angular and coordinate relationships of the original and transformed point position are show in the next slide.

    CG-6284

  • ROTATIONRotation of a point from position (x,y) to position (x,y) through an angle q relative to the coordinate origin. The original angular displacement of the point from the x axis is f .

    CG-6284

  • ROTATIONIn the previous slide , r is the constant distance of the point from the origin , angle is the original angular position of the point from the horizontal , and q is the rotation angle.

    CG-6284

  • ROTATION Using standard trigonometric identities we can express the transformed coordinates in terms of angles andx = rcos(+) = rcos cos - rsin sin y = rsin(+) = rcos sin - rsin cos -----(1)

    CG-6284

  • ROTATIONThe original co- ordinates of the point in polar coordinate are x = rcos ,y = rsin ------(2) Substituting (2) in (1)we obtain the trans formation equation for rotating a point at position (x,y) through an angle q about the originso, x=xcos - ysin y=xsin + ycos

    CG-6284

  • ROTATIONWE CAN WRITE THE ROTATION EQUATION IN THE MATRIX FORM P = R.P WHERE THE ROTATION MATRIX IS

    CG-6284

  • ROTATION ABOUT THE ORIGIN In rotation, the object is rotated q degree about the origin. The convention is that the direction of rotations counterclockwise if q is a positive angle and clockwise if q is a negative angle.

    CG-6284

  • ROTATION ABOUT THE ORIGIN The transformation of rotation Rq is P=R q(P) WHERE X=X COS (q )- Y SIN (q ) AND Y=X SIN (q ) + Y COS (q ).

    CG-6284

  • ROTATION ABOUT THE ORIGINPPYXOBJOBJq

    CG-6284

  • SCALINGA scaling transformation alters the size of an object. This operation can be carried out for polygons by multiplying the coordinate value (x,y) of each vertex by scaling factors sx and sy to produce the transformed coordinates (x,y) x=x. sx , y= y. sy

    CG-6284

  • SCALINGScaling factor sx scales object in the x direction ,while sy scales in the y direction. The transformation equation can also be written in the matrix form. (x,y) = {(sx, 0), (0, sy)}. {x,y} or P=S.P WHERE S IS THE 2 BY 2 SCALING MATRIX .

    CG-6284

  • SCALING POINTS CAN BE SCALED BY SX SLONG THE X AXIS AND SY ALONG THE Y AXIS INTO NEW POINTS BY MULTIPLICATIONSx = sx.x,y = sy.yIN THE MATRIX FORM, THIS ISOR P = S . P

    CG-6284

  • SCALINGAny positive numeric values can be assigned to the scaling factors sx and sy . Values less than 1 reduce the size of objects. Values greater than 1 produce an enlargement. Specifying a value of 1 for both sx and sy leaves the size of objects unchanged.

    CG-6284

  • SCALINGWhen sx and sy are assingned the same value , a uniform scaling is produced that maintain relative object proportions. Unequal values for sx and sy result in a differential scaling that is often used in design Application.

    CG-6284

  • SCALING Scaling factors with values less than 1 move object closer to the coordinate origin, while values greater than 1 move coordinate positions farther from the origin.

    CG-6284

  • SCALINGTurning a square (a) into a rectangle (b) with scaling factors sx=2 and sy=1

    CG-6284

  • SCALING WITH RESPECT OF THE ORIGIN Scaling is the process of expanding or compressing the dimensions of an object. Positive scaling constants sx and sy are used to describe changes in the length with respect to the x direction and y direction, respectively.

    CG-6284

  • SCALING WITH RESPECT OF THE ORIGINAfter a scaling transformation is performed, the new object is located at a different position relative to the origin. In a scaling transformation the only point that remain fixed is the origin.

    CG-6284

  • Scaling transformation with scaling factors sx=2 and sy=0.5

    CG-6284

  • SCALING If both scaling constants have the same value s , the scaling transformation is said to be homogeneous. If s< 1, then it is a reduction. If s >1, it is a magnification

    CG-6284

  • HOMOGENOUS COORDINATES To express any 2-D transformation as a matrix multiplication, we represent each Cartesian coordinate position (x, y) with the Homogeneous coordinate triple (xh, yh, h), where x=xh/h, y=yh/h

    CG-6284

  • HOMOGENOUS COORDINATES A general homogeneous coordinate representation can also be written as (h.x, h.y, h). For 2D geometric transformations, we can choose the homogeneous parameter h to be any non zero value. A convenient choice is simply to set h=1. Each 2D position is then represented with homogeneous coordinates (x, y, 1).

    CG-6284

  • HOMOGENOUS COORDINATES The term homogeneous coordinates is used in mathematics to refer to the fact of this representation on Cartesian equation. When a Cartesian point (x, y) is converted to a homogeneous representation (xh, yh, h),

    CG-6284

  • HOMOGENOUS COORDINATES Equations containing x & y, such as f(x, y)=0 become homogeneous equation in the 3 parameters xh, yh & h. Expressing positions in homogeneous coordinates allow us to represent all geometric transformation equations as matrix multiplication's.

    CG-6284

  • HOMOGENOUS COORDINATESFor translation, we have :

    CG-6284

  • HOMOGENOUS COORDINATES which we can write in the abbreviated form : P=T(tx, ty).P with T(tx, ty) as the 3 by 3 translation matrix. The inverse of the translation matrix is obtained by replacing the translation parameters tx & ty with their negative : -tx & -ty.

    CG-6284

  • HOMOGENOUS COORDINATES Similarly, rotation transformation equation about the coordinate origin are now written as :

    or as :P=R(q).P

    CG-6284

  • HOMOGENOUS COORDINATES The rotation transformation operator R(t) is the 3 x 3 matrix, with rotation parameter q We get the inverse rotation matrix when theta is replaced with -q Finally, a scaling transformation relative to the coordinate origin is now expressed as the matrix multiplication.

    CG-6284

  • HOMOGENOUS COORDINATESExpressed as the matrix multiplication.

    CG-6284

  • HOMOGENOUS COORDINATESOr :p=s(sx, sy).P

    Where s(sx, sy) is the 3 x 3 matrix with parameters sx & sy replacing these parameters with their multiplicative inverse (1/sx & 1/sy) yields the inverse scaling matrix.

    CG-6284

  • OTHER TRANSFORMATIONSSome packages provide a few additional transformation that are useful in certain application. Two such transformations are reflection and shear.

    CG-6284

  • REFLECTIONREFLECTION : A reflection is a transformation that produces a mirror image of an object. The mirror image for a two-dimensional reflection is generated relative to an axis of reflection by rotating the object 180 degree about the reflection axis.

    CG-6284

  • REFLECTION123231yxORIGINALPOSITIONREFLECTEDPOSITIONREFLECTION OF AN OBJECT ABOUT THE X AXIS.

    CG-6284

  • REFLECTIONREFLECTION ABOUT THE LINE y=0, THE x AXIS, IS ACCOMPLISHED WITH THE TRANSFORMATION MATRIX.

    CG-6284

  • REFLECTIONA REFLECTION ABOUT THE y AXIS FLIPS x COORDINATES WHILE KEEPING y COORDINATES THE SAME. THE MATRIX FOR THIS TRANSFOR-MATION IS :

    CG-6284

  • REFLECTIONTHE CHANGE IN POSITION OF AN OBJECT THAT HAS BEEN REFLECTED ABOUT THE LINE x=0. THE EQUIVALENT ROTATION IN THIS CASE IS 180 DEGREE.Reflection of an object about the y axis.

    CG-6284

  • REFLECTIONWe flip both the x & y coordinates of a point by reflecting relative to an axis that is perpendicular to the xy plane and that passes through the coordinates origin.

    THE REQUIRED MATRIX IS:

    CG-6284

  • REFLECTIONREFLECTION OF AN OBJECT RELATIVE TO AN AXIS PERPENDICULAR TO THE xy PLANE & PASSING THROUGH THE COORDINATE ORIGIN.ORIGINAL POSITIONREFLECTED POSITIONyx131322

    CG-6284

  • REFLECTION TO ENVISION THE ROTATION TRANSFORMATION PATH FOR ITS REFLECTION1. THE FLAT OBJECT MOVING OUT OF THE xy PLANE .2. ROTATING 180 DEGREE THROUGH 3-D SPACE ABOUT x- AXIS.3. BACK INTO THE xy PLANE ON THE OTHER SIDE OF x AXIS.

    CG-6284

  • MIRROR REFLECTION ABOUT AN AXIS If either the x or y axis is treated as a mirror, the object has a mirror image or reflection. Since the reflection P of an object point P is located the same distance from the mirror as P, the mirror reflection transformation m, about the x axis is given by P=mx(P)

    CG-6284

  • Where x=x and y= -ySimilarly, the mirror reflection about the y axis is P=my(P)Where x= -x and y= y.

    CG-6284

  • SHEARA transformation that distorts the shape of an object such that the transformed shape appears as if the object were composed of internal layers that had been caused to slide over each other is called a shear. Two common shearing transformations are those that shift coordinate x values and those that shift y values.

    CG-6284

  • SHEAR An x-direction shear relative to the x axis produced with the transformation matrix . Which transforms coordinatepositions asx=x+shx.yy=y

    CG-6284

  • SHEARA SQUARE IS CONVERTED TO A PARALLELOGRAM USINGTHE X_DIRECTION SHEAR MATRIX WITH Shx=2

    CG-6284

  • INVERSE GEOMATRIC TRANSFORMATION Each geometric transformation has an inverse which is described by the opposite operation performed by the transformation. Translation : tv-1 = t-v , or translation in the opposite direction.

    CG-6284

  • Rotation : rq-1 =r-q, or rotation in the opposite direction. Scaling : s-1sx,xy = s1/sx, 1/sy Mirror reflection : m-1x= mx and m-1y =myINVERSE GEOMATRIC TRANSFORMATION

    CG-6284

  • COORDINATE TRANSFORMATION Suppose that we have two coordinate systems in the plane. The first system is located at origin o and has coordinate axes xy. The second coordinate system is located at origin o and has coordinate axes xy.

    CG-6284

  • Now each point in the plane has two coordinate descriptions : (x,y) and (x,y), depending on which coordinate system is used. We can describe this transformation by determining how the (x,y) coordinates of a point p are related to the (x,y) coordinates of the same point.COORDINATE TRANSFORMATION

    CG-6284

  • COORDINATE TRANSFORMATION

    CG-6284

  • COORDINATE TRANSFORMATION

    CG-6284

  • TRANSLATION If the xy coordinate system is displayed to a new position, where the direction of the displacement is given by the vector v=txi+ty, the coordinates of a point in both systems are related by the translation transformation tv . (x, y ) = tv (x, y)where x=x-tx and y=y-ty

    CG-6284

  • ROTATION ABOUT THE ORIGIN The xy system is rotated q degree about the origin. Then the coordinates of a point in both systems are related by the rotation transformation rq : (x, y )= rq (x,y) Where x =x cos (q) + y sin (q) and y = -x sin (q) + y cos (q).

    CG-6284

  • SCALING WITH RESPECT TO THE ORIGIN Suppose that a new coordinate system is formed by leaving the origin and coordinate axes unchanged, but introducing different units of measurement along the x and y axes.

    CG-6284

  • If the new units are obtained from the old unit by a scaling of sx units along the x axis and sy unit along the y axis, The coordinates in the new system are related to coordinate in the old system through the scaling transformation ssx,sy .SCALING WITH RESPECT TO THE ORIGIN

    CG-6284

  • (x,y) = ssx,sy (x,y).where x=1/sx.x and y=1/sy.y.SCALING WITH RESPECT TO THE ORIGINOLD UNIT

    CG-6284

  • The figure shows coordinate scaling transformation using scaling factors sx = 2 and sy = 1/2SCALING WITH RESPECT TO THE ORIGIN

    CG-6284

  • MIRROR REFLECTION ABOUT AN AXIS If the new coordinate system is obtained by the reflecting the old system about either x or y axis, the relationship between the coordinates is given by the coordinate transformation mx and my.

    CG-6284

  • For reflection about the x axis (x,y) = mx(x,y) where x= x and y= -y.For reflection about the y axis (x,y) = my (x,y)where x= -x and y =y.

    MIRROR REFLECTION ABOUT AN AXIS

    CG-6284

  • INVERSE COORDINATE TRANSFORMATION Each coordinate transformation has an inverse which can be found by applying the opposite transformation. Translations: t-1v =t-v , translation in the opposite direction .

    CG-6284

  • ROTATION : R -1q = R-q ,ROTATION IN THE OPPOSITE DIRECTION. SCALING :S-1SX,SY = S1/SX,1/SY MIRROR REFLECTION : MX= MX AND MY =MY

    INVERSE COORDINATE TRANSFORMATION

    CG-6284

  • COMPOSITE TRANSFORMATIONS We can set up a matrix for any sequence of transformations as a composite transformation matrix by calculating the matrix product of individualtransformations.

    CG-6284

  • COMPOSITE TRANSFORMATIONSFORMING PRODUCTS OF TRANSFORMATION MATRICES IS OFTEN REFFFERED TO AS A CONCATENATION OR COMPOSITION OF MATRICES.

    CG-6284

  • TRANSLATIONIf two successive translation vectors (tx1, ty1) and (tx2, ty2) are applied to the coordinate position p, The final transformed location p is calculated as : P= T(tx2, ty2) .{T(tx1, ty1). P}= {T(tx2, ty2) .T(tx1, ty1)}. P

    CG-6284

  • TRANSLATIONWhere p & p are represented as homogenous co-ordinate column vectors.The composite transformation matrix for this sequence of translation is

    CG-6284

  • TRANSLATIONT(tx2, ty2) .T(tx1, ty1)= T(tx2+ tx1, ty1+ ty2)OR It demonstrates that two successive transformations are additive.

    CG-6284

  • ROTATIONS Two successive rotations applied to point p produce the transformed position :P = r(2) . {r(1) . p} = {R(2) . r(1)} . p

    CG-6284

  • ROTATIONSBy multiplying the two rotation matrices, we can verify that two successive rotations are additive. R(2) . r(1) = r(1 +2)P = r(1 +2) . p

    CG-6284

  • SCALINGConcatenat transformation matrices for two successive scaling operations produces the following composite scaling matrice :

    CG-6284

  • SCALINGORS(sx2, sy2) . S(sx1, sy1) = S(sx1. sx2, sy1. sy2)

    The resulting matrix in this case indicates that successive scaling operations are multiplicative .

    CG-6284

  • GENERAL PIVOT POINT ROTATION With a graphics package that only provides a rotate function for revoluting objects about the coordinate origin, we can generate rotations about any selected pivot point (xr1, yr1) by performing

    CG-6284

  • GENERAL PIVOT POINT ROTATIONThe following sequence of translate-rotate-translate operations :1. Translate the object so that the pivot point position is moved to the coordinate origin.

    CG-6284

  • GENERAL PIVOT POINT ROTATION2. Rotate the object about the coordinate origin.3. Translate the object so that the pivot point is returned to its original position.

    CG-6284

  • GENERAL PIVOT POINT ROTATIONORIGINAL POSITION OF OBJECT & PIVOT POINTTRANSLATION OF OBJECT SO THAT PIVOT POINT(xr1, yr1) IS AT ORIGIN ROTATION ABOUT ORIGINTRANSLATION OF OBJECT SO THAT PIVOT POINTIS RETURNED TO POSITION (xr1, yr1).

    CG-6284

  • GENERAL PIVOT POINT ROTATIONThe composite transformation matrix for this sequence is obtained with the concatenation :=

    CG-6284

  • GENERAL FIXED POINT SCALINGPrevious figure illustrates a transformation sequence to produce scaling with respect to a selected fixed position (xf, yf) using a scaling function that can only scale relative to the coordinate origin.

    CG-6284

  • GENERAL FIXED POINT SCALING1. Translate object so that the coincide with the coordinate origin.2. Scale the object with respect to the coordinates origin.

    CG-6284

  • GENERAL FIXED POINT SCALING3. Use the inverse translation of step 1 to return the object to its original position.Concatenating the matrix for these three operations produce the required scaling matrix.

    CG-6284

  • GENERAL FIXED POINT SCALINGORIGINAL POSITION OF OBJECT & FIXED POINTTRANSLATION OF OBJECT SO THAT FIXED POINT(xr1, yr1) IS AT ORIGIN SCALE OBJECT WITH RESPECT TO ORIGINTRANSLATION OF OBJECT SO THAT FIXED POINTIS RETURNED TO POSITION (xr1, yr1).

    CG-6284

  • GENERAL FIXED POINT SCALINGT(xf, yf).S(sx, sy).T(-xf, -yf) = S((xf, yf, sx, sy)OR

    CG-6284

  • GENERAL SCALING DIRECTIONSIf we want to apply scaling factors with values specified by parameters s1 & s2 in the directions.To accomplish the scaling without changing the orientation of object, we first

    CG-6284

  • GENERAL SCALING DIRECTIONSPerform a rotation so that the directions for s1 & s2 coincide with the x & y axis, respectively.Then the scaling transformation is applied, followed by an opposite rotation to return points to their original orientation.

    CG-6284

  • GENERAL SCALING DIRECTIONSThe composite matrix resulting from the product of these 3 transformations is :R-1.S(s1,s2) . R() =

    CG-6284

  • GENERAL SCALING DIRECTIONSUSING SCALING TRANSFORMATION, WE TURN A SQUARE INTO A PARALLELOGRAM BY STRECHING IT ALONG THE DIAGONAL FROM (0, 0) TO (1, 1).

    CG-6284

  • GENERAL COMPOSITE TRANSFORMATIONSA general 2-d transformation , representing a combination of TRANSLATIONS, ROTATIONS & SCALINGS can be expressed as :

    CG-6284

  • GENERAL COMPOSITE TRANSFORMATIONS

    CG-6284

  • GENERAL COMPOSITE TRANSFORMATIONSThe four elements rsij are the multiplicative rotation scaling terms in the transformations that involve only ROTATION ANGLES & SCALING FACTORS.

    CG-6284

  • GENERAL COMPOSITE TRANSFORMATIONSElements trsx & trsy are the transnational terms containing combinations of translation distances, pivot point & fixed point coordinates & rotation angles & scaling parameters.

    CG-6284

  • GENERAL COMPOSITE TRANSFORMATIONSe.g. If an object is to be scaled & rotated about its centroid coordinate (xc, yc) & then translated. The values for the elements of the composite transformation matrix are .

    CG-6284

  • GENERAL COMPOSITE TRANSFORMATIONST(tx, ty).R(xc, yc,).S(xc, yc, sx, sy) =REVERSING THE ORDER IN WHICH A SEQUENCE OF TRANSFORMATIONS IS PERFORMED POSITION OF AN OBJECT.

    CG-6284

  • ALGORITHM IDENTITY-MATRIX(H):- Routine to create the identity transformation ARGUMENT H is the transformation array of 3*2 elements. LOCALI , J variables for stepping through the H array BEGIN

    CG-6284

  • ALGORITHM FOR I = 1 TO 3 DO FOR J = 1 TO 2 DOIF I = J THEN H [I , J]
  • ALGORITHM It has the effect of multiplying the matrix H on the right by a scaling transformation matrix of SX 0 0

    0 SY 0

    O O 1

    CG-6284

  • MULTIPLY-IN-SCALE (SX,SY,H):- Routine to post-multiply the transformation matrix by a scale transformation ARGUMENTS SX is the x scale factor SY is the y scale factor H is a 3*2 transformation matrix

    ALGORITHM

    CG-6284

  • ALGORITHM LOCAL I for stepping through the array BEGIN FOR I = 1 TO 3 DO BEGINH [I, 1]
  • ALGORITHM For translation TX, TY ,we post-multiply H by the translation matrix

    CG-6284

  • ALGORITHM Again we simplify the multiplication by neglecting zero terms. Since the third column of the transformation matrix is always 0,0,1,the algorithm for translation is as follows.

    CG-6284

  • ALGORITHM MULTIPLY-IN-TRANSLATION(TX,TY,H):- Routine to post-multiply the transformation matrix by a translation

    ARGUMENTS TX translation in the x direction TY translation in the y direction H a 3*2 transformation matrix BEGIN

    CG-6284

  • ALGORITHM H[3,1]
  • ALGORITHM For a rotation of A radians counter clockwise, we post-multiply by

    COS A SIN A 0-SIN A COS A 0 0 0 1

    CG-6284

  • ALGORITHM The algorithm takes the angle as an argument , calculates the sine and cosine , and then performs the matrix multiplication for nonzero terms.

    CG-6284

  • ALGORITHM MULTIPLY-IN-ROTATION(A, H):- Routine to post-multiply the transformation matrix by a rotation ARGUMENTS A angle of counterclockwise rotation H a 3*2 transformation matrix LOCAL S,C the sine and cosine values I for stepping through the array TEMP temporary storage of the first column

    CG-6284

  • ALGORITHM BEGIN C
  • ALGORITHMTEMP
  • ALGORITHM DO-TRANSFORMATION(X,Y,H):- Routine to transform a pointARGUMENTS X,Y the coordinates of the point to be transformed H a 3*2 transformation matrixLOCAL TEMP temporary storage for the new X value.

    CG-6284

  • ALGORITHM BEGINTEMP
  • ALGORITHM TRANSLATE (TX,TY):-User routine to set the translation parameters ARGUMENTS TX,TY the translation amount GLOBAL TRNX, TRNY storage for the translation parameters

    CG-6284

  • ALGORITHM BEGIN TRNX
  • ALGORITHM SCALE(SX,SY):-User routine to set the scaling parameters ARGUMENTS SX,SY the scaling factors GLOBALSCLX,SCLY storage for the scale parameters

    CG-6284

  • ALGORITHM BEGINSCLX
  • ALGORITHM ROTATE (A):- User routine to set the rotation angle ARGUMENTS A the rotation angleGLOBAL ANGL a place to save the rotation angleBEGINANGL
  • ALGORITHMBUILD-TRANSFORMATION:-Routine to build the image transformation matrixGLOBAL ANGL,SCLX,SCLY, TRNX, TRNY the transformation parametersIMAGE- XFORM a 3*2 array containing the image transformation

    CG-6284

  • ALGORITHM BEGIN IDENTITY- MATRIX (IMAGE-XFORM) MULTIPLY-IN-SCALE(SCLX,SCLY, IMAGE-XFORM); MULTIPLY-IN-SCALE (SCLX,SCLY,IMAGE- XFORM);

    CG-6284

  • ALGORITHM MULTIPLY-IN-ROTATION (ANGL,IMAGE-XFORM); MULTIPLY-IN-TRANSLATION (TRNX,TRNY,IMAGE-XFORM); RETURN;END;

    CG-6284

  • ALGORITHM MAKE-PICTURE-CURRENT:-User routine to show the current display fileGLOBAL FREE the index of the next free display- file cell ERASE-FLAG indicates if frames should be clearBEGIN IF ERASE-FLAG THEN

    CG-6284

  • ALGORITHM BEGIN ERASE;ERASE-FLAG 1 THEN INTERPRET (1,FREE-1);DISPLAY;FREE
  • RASTER METHODS FOR TRANSFORMATION Raster functions that manipulate rectangular pixel arrays are generally referred to as raster ops. Moving a block of pixel from one location to another also called a block transfer of pixel values. On a bilevel system

    CG-6284

  • RASTER METHODS FOR TRANSFORMATION This operation is called a bitbelt (bitblock transfer) particularly when the function is hardware implemented. The term pixbelt is some time used for block transfer on multilevel system ( multiple bits per pixel ).

    CG-6284

  • Typical raster function often provided in graphics packages are : 1. Copy - move a pixel block from one raster area to another. 2. Read - save a pixel block in a designed arrays. 3. Write - transfer a pixel array to a position in the frame buffer.RASTER METHODS FOR TRANSFORMATION

    CG-6284

  • Translating an object from screen position (a) to position (b) by moving a rectangular block of pixel value coordinate positions Pmin & Pmax specifies the limits of the rectangular block to be moved, & P0 is the destination reference position. PminPmaxP0

    CG-6284

  • EXERCISE 3 Prove that a uniform scaling (Sx = Sy) and a rotation from a commutative pair of operations but that, in general, scaling and rotation are not commutative operations.

    CG-6284

  • EXERCISE 3 Show that transformation matrix (5-33), for a reflection about the line y =x, is equivalent to a reflection relative to the x axis followed by a counterclockwise rotation of 90.

    CG-6284

  • EXERCISE 3 Show that transformation matrix (5-34) for a reflection about the line y=-x, is equivalent to a reflection relative to the y axis followed by a counterclockwise rotation of 90.

    CG-6284

  • EXERCISE 3 Determine the form of the transformation matrix for a reflection about an arbitrary line with equation y= mx+b

    CG-6284

  • EXERCISE 3 Determine the sequence of basic transformations that are equivalent to the x-direction shearing matrix(5-35).

    CG-6284

  • EXERCISE 3 Determine the sequence of basic transformations that are equivalent to the y-direction shearing matrix (5-36).

    CG-6284

  • Magnification of an object while keeping its center fixed. Let the geometric center be located at c(h,k) in figure (a). Choosing a magnification factor s>1. We construct the transformation by performing the following sequence of the transformation :

    CG-6284

  • (1) Translate the object so that its center coincides with the origin in figure (b), (2) scale the object with respect to the origin in figure (c), and (3) translate the scaled object back to the original position in figure (d).

    CG-6284

  • The required transformation ss,c can be formed by composition ss,c=t-1v.Ss,s.Tv where v= -hi - hj. By using composition, we can build more general scaling, rotation and reflection transformation.For these transformations,

    CG-6284

  • We shall use the following notations : (1) ssx,sy,p -scaling with respect to a fixed point p ;(2) rq,p -rotation about a point p ; (3) ml-reflection about a line l.

    CG-6284

  • (A)

    CG-6284

  • (B)

    CG-6284

  • (C)

    CG-6284

  • (D)

    CG-6284

  • CG-6284

  • TWO-DIMENSIONAL VIEWINGviewportwindowWORLD COORDINATEDEVICE COORDINATEA VIEWING TRANSFORMATION USING STANDARD RECTANGLES FOR WINDOW & VIEWPORT

    CG-6284

  • A world coordinate area selected for display is called a window. An area on a display device to which a window is mapped is called a viewport. 2-D VIEWING

    CG-6284

  • 2-D VIEWING#. The mapping of a part of a world-coordinate scene to device coordinate is referred to as a viewing transformation.#. The 2-d viewing transfor-mation is simply reffered as the window to veiwing transformation.

    CG-6284

  • 2-D VIEWINGMonitor1Monitor2ws1 Viewportws2 Viewportws2 Window ws1 WindowViewingcoordinatewindowTWO-DIMENSIONAL VIEWING

    CG-6284

  • Any number of output devices can be open in aparticular application, & another window-to-viewport transformation can be performed for each open output devices.This mapping is called workstation transformation.

    2-D VIEWING

    CG-6284

  • ASPECT RATIO#. Since the viewing transformation involves scaling, undesirable distortions may be introduced whenever sx sy. For example, circles within which the window may be displayed as ellipses and squares as rectangles. In consdering how

    CG-6284

  • ASPECT RATIO These distortions may be avoided, the concept of aspect ratio is needed. The aspect ratio of a rectangulatr window or viewport is defined by A=xmax-xmin/ymax-ymin

    CG-6284

  • ASPECT RATIO If the aspect ratio aw of the window equals the aspect ratio av of the vieport then sx=sy, and no distortion occurs.If aw != av, then distortion occurs. If desired ,

    CG-6284

  • ASPECT RATIO In this case we can describe a region within the viewport, a subviewport, whose aspect ratio is that of the window.

    CG-6284

  • ASPECT RATIO The method for selecting a and enlarging portions of the drawing is called windowing. The technique for not showing that part of the drawing which one is not interested in is called clipping.

    CG-6284

  • ASPECT RATIO There is the object model and there is the image of the object which appears on the display. When we speak of the object, we are actually referring to a model of the object stored in the computer .

    CG-6284

  • ASPECT RATIO The object model is said to reside in object space. This model represent the object using yhe physical units of length.

    CG-6284

  • IN THE OBJECT SPACE,POSITION IS MEASURED IN PHYSICAL UNITS SUCH AS METERS. IN THE IMAGE SPACE , POSITION IS GIVEN IN NORMALIZED SCREEN COORDINATES.

    CG-6284

  • ASPECT RATIO We must have some way of covertingfrom the object space units of measure to those of the image space ( screen space ) . this can be done by the scaling transformation.

    CG-6284

  • 1/48 0 00 1/48 00 0 1X=A SCALING TRANSFORMATION WILL CONVERT OBJECT COORDINATE UNITS TO NORMALIZED SCREEN COORDINATES.

    CG-6284

  • ASPECT RATIO The object is too complex to show in its entirety or that we are particularly interested in just a portion of it.We would like to imagine a box about a portion of the object . we would only display what is enclosed in the box. Such a box is called a window.

    CG-6284

  • WINDOWOBJECT SPACEIMAGE SPACEA WINDOW TO VIEW ONLY PART OF AN OBJECT.

    CG-6284

  • ASPECT RATIO We would like to imagine a box on the screen and have the image confined to that box.Such a box in the screen space is called a viewport.

    CG-6284

  • VIEWPORTA VIEW PORT TO DEFINE THE PART OF THE SCREEN TO BE USED.

    CG-6284

  • ASPECT RATIO When the window is changed, we see a different part of the object shown at the same position on the display.

    CG-6284

  • DIFFERENT WINDOWS, SAME VEIWPORTS

    CG-6284

  • ASPECT RATIO If we change the viewport , we see the same part of the object drawn at a different place on the display.

    CG-6284

  • TRANSLATESCALE TRANSLATEVIEWING TRANSFORMATIONThe overall transformation which performs these three steps we shall call the viewing transformation.

    CG-6284

  • In general,the viewing transformation is 1 0 0

    0 1 0

    -WXL -WYL 1 (VXH-VXL) / 0 0 (WXH-WXL)

    0 (VYH-VYL) / 0 (WYH-WHL) 0 0 11 0 0

    0 1 0

    VXL VYL 1

    CG-6284

  • CG-6284

  • CLIPPING Clipping tells us how to cut off the lines which are outside the window so that only the lines within the window are displayed.If it is inside, the line is displayed; if it is outside, nothing is drawn.

    CG-6284

  • CLIPPINGBEFOREAFTER If it crosses the boundry we must determine the point of intersection and draw only the portion which lies inside.

    CG-6284

  • CLIP LEFTCLIP RIGHTCLIP TOPCLIP BOTTOMCLIPPING

    CG-6284

  • ALGORITHM SET-VIEW PORT(XL,XH,YL,YH)#. User routine for specifying the viewport Arguments XL,XH the left and right viewport boundaries YL,YH the bottom and up viewport boundaries Global VXL-HOLD,VXH-HOLD,VYL-HOLD,VYH-HOLDstorage for the viewport boundaries

    CG-6284

  • ALGORITHM SET-VIEW PORT(XL,XH,YL,YH) BEGINIF XL>=XH OR YL>=YH THEN RETURN ERROR `BAD VIEW PORT`;VXL-HOLD
  • ALGORITHM SET WINDOW PORT(XL,XH,YL,YH) User routine for specifying the window ArgumentsXL,XH the left and right window boundariesYL,YH the bottom and up window boundariesGlobal WXL-HOLD,WXH-HOLD, WYL-HOLD,WYH-HOLD

    storage for the window boundaries

    CG-6284

  • BEGIN IF XL>= XH OR YL>= YH THEN RETURN ERROR`BAD WINDOW`; WXL-HOLD
  • Clip leftClip bottomClip topClip rightViewing transformCLIPPING THE CLIPPING PROCESS

    CG-6284

  • ALOGRITHM CLIP-LEFT (OP, X,Y) Routine for clipping against the left boundary Arguments OP,X ,Y a display file in instruction Global WXL window left boundary XS,YS arrays containing the last point drawn NEEDFIRST array of indicators for saving the first command

    CG-6284

  • ALOGRITHM CLIP-LEFT (OP, X,Y) FIRSTOP, FIRSTX FIRSTY arrays for saving the first command CLOSING indicates the stage in polygon BEGIN IF PFLAG ANG NEEDFIRST(1) THEN BEGIN FIRSTOP (1)
  • ALOGRITHM CLIP-LEFT (OP, X,Y) NEEDFIRST(1)= WXL AND XS (1) < WXL THEN CLIP-RIGHT (1,WXL,(Y-YS(1))*(WXL-X)/(X-XS(1)+Y) Case of drawing from inside out ELSE IF X WXL THEN IF OP>0 THEN

    CG-6284

  • ALOGRITHM CLIP-LEFT (OP, X,Y) CLIP-RIGHT (OP,WXL,(Y-YS(1))*(WXL-X)/(X-XS(1))+Y) ELSE CLIP-RIGHT (1,WXL,(Y-YS(1))*(WXL-X)/(X-XS(1)+Y); Remember point to serve as one of the end points of next line segments XS(1)
  • ALOGRITHM CLIP-LEFT (OP, X,Y) Case of point inside IF X>=WXL AND CLOSING 1 THEN CLIP-RIGHT(OP, X,Y); RETURN; END;

    CG-6284

  • #. Routine for clipping against the right boundary Arguments OP,X ,Y a display file in instruction Global WXL window right boundary XS,YS arrays containing the last point drawn NEEDFIRST array of indicators for saving the first command

    ALOGRITHM CLIP-RIGHT (OP, X,Y)

    CG-6284

  • FIRSTOP,FIRSTX,FIRSTY arrays for saving the first command CLOSING indicates the stage in polygon BEGIN IF PFLAG AND NEEDFIRST(2) THEN BEGIN FIRSTOP(2)
  • NEEDFIRST(2)= WXH AND XS (2) < WXH THEN IF OP>0 THEN CLIP-BOTTOM (OP, WXH, (Y-YS(2))*(WXH-X)/(X-XS(2))+Y) ALOGRITHM CLIP-RIGHT (OP, X,Y)

    CG-6284

  • ELSE CLIP-BOTTOM(1,WXH,(Y-YS(2))*(WXH-X)/(X-XS(2)) +Y); XS(2)
  • #. Routine for clipping against the lower boundary Arguments OP,X ,Y a display file in instruction Global WXL window lower boundary XS,YS arrays containing the last point drawn NEEDFIRST array of indicators for saving the first command

    ALOGRITHM CLIP-BOTTOM (OP, X,Y)

    CG-6284

  • ALOGRITHM CLIP-BOTTOM (OP, X,Y)FIRSTOP, FIRSTX FIRSTY arrays for saving the first commandCLOSING indicates the stage in polygon BEGIN IF PFLAG ANG NEEDFIRST(3) THEN BEGIN FIRSTOP (3)
  • NEEDFIRST(3)= WXL AND YS (3) < WYL THEN CLIP-TOP (1,( X-XS(3))*(WYL-Y)/(Y-YS(3))+X,WYL) ELSE IF Y WYL THEN IF OP>0 THEN

    ALOGRITHM CLIP-BOTTOM (OP, X,Y)

    CG-6284

  • ALOGRITHM CLIP-BOTTOM (OP, X,Y) CLIP-TOP (OP,X-XS(3))*(WYL-Y)/(Y-YS(3)+X,WYL) ELSE CLIP-TOP(1,(X-XS(3))*(WYL-Y)/(Y-YS(3))+X,WYL); XS(3)
  • IF Y>=WYL AND CLOSING 3 THEN CLIP-TOP (OP, X,Y); RETURN; END; ALOGRITHM CLIP-BOTTOM (OP, X,Y)

    CG-6284

  • #. Routine for clipping against the upper boundary Arguments OP,X,Y a display file instruction GlobalWYH window upper boundaryXS,Ys array containing the last point drawnNEEDFIRST array of indicators for saving the first command ALOGRITHM CLIP-TOP (OP, X,Y)

    CG-6284

  • ALOGRITHM CLIP-TOP (OP, X,Y) FIRSTOP,FIRSTX,FIRSTY arrays for saving the first command CLOSING indicates the stage in polygon BEGIN IF PFLAG AND NEEDFIRST(4) THEN BEGIN FIRSTOP(4)
  • ALOGRITHM CLIP-TOP (OP, X,Y) ELSE IF Y WYH THEN SAVE-CLLIPED- POINT (1,(X-XS(4))*(WYH-Y)/(Y-YS(4)) +X,WYH) ELSE IF Y>=WYH AND YS (4)0 THEN SAVE-CLLIPED-POINT( OP,(X-XS(4))*(WYH-Y)/ (Y-YS (4))+X,WYH)ELSE

    CG-6284

  • ALOGRITHM CLIP-TOP (OP, X,Y) XS(4)
  • MULTIPLE WINDOWING Some systems allow the use of multiple windowing: A first image is created by one or more window transformations on the object. Windows are applied to this first image to create a second image. Further windowing transformations may be done until the desired picture is created.

    CG-6284

  • MULTIPLE WINDOWING ADVANTAGES:- Every application of a window transformation allows the user to slice up a portion of the picture and reposition it on the screen. Thus multiple windowing gives the user freedom to rearrange components of the picture.

    CG-6284

  • VIEW PORTWINDOWWORLD COORDINATESDEVICE COORDINATESXWMINXWMAXXVMINXVMINYWMAXYWMINYVMINYVMAXA VIEWING TRANSFORMATION USING STANDARD RECTANGLES FOR THE WINDOW & VIEWPORT

    CG-6284

  • CONSTRUCT WORLD-COORDINATE SCENE USING MODELING-COORDINATE TRANSFORMATIONSCONVERT WORLD-COORDINATES TO VIEWING COORDINATESMAP VIEWING COORDINATES TO NORMALIZED VIEWING COORDINATES USING WINDOW-VIEWPORT SPECIFICATIONSMAP NORMALIZED VIEWPORT TO DEVICE COORDINATESNVCVCWCMCDC TWO DIMENSIONAL VIEWING TRANSFORMATION

    CG-6284

  • SETTING UP A ROTATED WORLD WINDOW IN VIEWING COORDINATES & THE CORRESPONDING NORMALIZED - COORDINATE VIEWPORT.

    CG-6284

  • x WORLDx WORLDy WORLDy WORLDy VIEWy VIEWx VIEWx0y0x VIEWTRANSLATE THE VIEWING ORIGIN TO THE WORLD ORIGIN.ROTATE TO ALIGN THE AXES OF THE TWO SYSTEMS

    CG-6284

  • A POINT AT POSITION (xw, yw) IN A DESIGNATED WINDOW IS MAPPED TO VIEWPORT COORDINATES (xv, yv) SO THAT RELATIVE POSITIONS IN THE TWO AREAS ARE THE SAME.

    CG-6284

  • WINDOW TO VIEWPORT COORDINATE TRANSFORMATIONA point at position (xw,yw) in the window is mapped into position (xv,yv)in the associated viewport. To maintain the same relative placement in the viewport as in the window,we require that:

    CG-6284

  • WINDOW TO VIEWPORT COORDINATE TRANSFORMATION

    CG-6284

  • WINDOW TO VIEWPORT COORDINATE TRANSFORMATIONTHE CONVERSION IS PERFORMED WITH THE FOLLOWING SEQUENCE OF TRANSFORMATIONS:

    CG-6284

  • WINDOW TO VIEWPORT COORDINATE TRANSFORMATION Perform a scaling trans-formation using a fixed point position of (xwmin, ywmin) that scales the window area to the size of the viewport.Translate the scale window area to the position of the viewport.

    CG-6284

  • CLIPPING An algorithm for three dimensional clipping identifies and saves all surface segments within the view volume for display on the output device. All parts of the objects that are outside the view volume are discarded.Clipping in three dimensions can be accomplished using extensions of two-dimensional clipping methods.

    CG-6284

  • CLIPPING OPERATIONSIn the following sections, we consider algorithms for clipping the following primitive types :point clipping.Line clipping (straight - line segments). Area clipping (polygons) Curve clipping. Text clipping.

    CG-6284

  • POINT CLIPPINGAssuming that the clip window is a rectangle in standard position, we save a point p = (x,y) for display if the following inequalities are satisfied:xwmin
  • LINE CLLIPING A line clipping procedure involves sevaral parts. First, we can test a given line segment to determine whether it lies completely inside the clipping window. If it does not,

    CG-6284

  • LINE CLLIPING Secondly, we try to Determine whether it is completely outside the window . finally, if we cannot identify a line as completely inside or completely outside, we must perform intersection calculation with one or more clipping boundries.

    CG-6284

  • LINE CLLIPING We process line through the `inside-outside `test by cheching the line endpoints. A line with with both endpoints inside all clipping boundaries is saved. A line with both endpoints outside any one of the clip boundaries is clipped.

    CG-6284

  • WINDOWWINDOWBEFORE CLIPPINGAFTER CLIPPINGLINE CLIPPING AGAINST A RECTANGULAR CLIP WINDOW

    CG-6284

  • This is the one of the oldest & popular line-clipping procedure. It is the method that can be used to test lines for total clipping is to perform the logical and operation with both region codes. If the result is not 0000, the line is completely outside the clipping region.COHEN-SUTHERLAND CLIPPING

    CG-6284

  • LINE CLLIPING

    Those lines that cannot be identified as completely inside or outside a clipping window by these tests are checked for intersection with the windows boundries.

    CG-6284

  • LINE CLLIPING The clipping process for a line is started by comparing an outside endpoint to a clipping boundary to determine how much of the line can be discarded. Then the remaining part of the line is checked against the other boundaries and continue untill either the line is totally discarded or a section is found inside the window.

    CG-6284

  • WINDOW100100000001100001010010101001000110BINARY REGION CODES ASSINGNED TO LINE ENDPOINTS ACCORDING TO RELATIVE POSITION WITH RESPECT TO THE CLIPPING RECTANGLE.

    CG-6284

  • WINDOWLINE EXTENDED FROM ONE COORDINATE REGION TO ANOTHER MAY PASS TROUGHTHE CLIP WINDOW, OR THEY MAY INTERSECT CLIPPING BOUNDARIES WITHOUT ENTERING THE WINDOW.

    P2``P2P1P2`P1`P3`P3P4

    CG-6284

  • Procedure clipcohsuth(winMin, winMax : dcPt2; n : integer; pts : wcPts2); type Boundary = (left, right, bottom, top); Code=array[Boundary] of boolean;var I : integer; function encodes {pt : wcPt2} : Code; var c : Code;COHEN-SUTHERLAND LINE CLIPPING ALGORITHM

    CG-6284

  • begin if pt.x < winMin.x then c[Left] := true else c[Left] := false ; if pt.x > winMax.x then c[Right] := true else c[Right] := false ; if pt.y < winMin.y then c[Bottom] := true else c[Bottom] := false; if pt.y > winMax.y then c[Top] := true else c[Top] :=false ;end ; { encode } COHEN-SUTHERLAND LINE CLIPPING ALGORITHM

    CG-6284

  • function accept { c1, c2 : code } : boolean ;var k : Boundary;begin accept := true ; for k := Left to Top do if { c1[k] } and c2[k] } then accept :=trueend;function reject { c1,c2 :code } :boolean;var k : Boundary; COHEN-SUTHERLAND LINE CLIPPING ALGORITHM

    CG-6284

  • begin reject := false ; for k := Left to Top do if { c1[k] and c2[k] } then reject := trueend;function ptInside { c: Code } : boolean ;begin if { c[Left] } or { c[Right] } or {c[Top]} or { c[Bottom]} then COHEN-SUTHERLAND LINE CLIPPING ALGORITHM

    CG-6284

  • ptInside := false else ptInside := true;end; procedure swapPts (var p1, p2 : wcPt2);var tmp : wcPt2;begin tmp := p1 ; p1 :=p2 ; p2 := tmp;end;procedure swapCodes (var c1, c2 : Code );var tmp : Code ; COHEN-SUTHERLAND LINE CLIPPING ALGORITHM

    CG-6284

  • begin tmp := c1; c1 :=c2; c2 :=tmp;end;procedure clipLine (p1,p2 : wcPt2);var code1, code2 : code ; done, draw : boolean; m: real;begin {clipLine } done := false; COHEN-SUTHERLAND LINE CLIPPING ALGORITHM

    CG-6284

  • draw := false ; while not done do begin code1 := encode (p1); code2 := encode (p1); if accept (code1, code2 ) then begin done := true ; draw := true end COHEN-SUTHERLAND LINE CLIPPING ALGORITHM

    CG-6284

  • else if reject (code1, code2)then done:=true else begin (insure that p1 is outside window) if ptInside (code1) then begin swapPts (p1,p2);

    COHEN-SUTHERLAND LINE CLIPPING ALGORITHM

    CG-6284

  • COHEN-SUTHERLAND LINE CLIPPING ALGORITHM swapCodes ( code1 , code2 ); end ; m : = ( p2.y - p1.y) / (p2.x -p1.x ); if codel [ Left ] then begin p1.y : = p1.y + ( winMin .x - p1.x ) * m ; p1.x : = winMin.x end { crosses Left } else

    CG-6284

  • COHEN-SUTHERLAND LINE CLIPPING ALGORITHM if codel [ Right ] then begin p1.y := p1.y + (winMax .x - p1.x ) * m; p1.x := winMax.x end { crosses Right } else if codel [ Bottom ] then begin

    CG-6284

  • COHEN-SUTHERLAND LINE CLIPPING ALGORITHM p1.x := p1.x + ( winMin.y - p1.y ) / m ; p1.y := winMin.y end { crosses Bottom } else if codel [ Top ] then begin p1.x := p1.x + ( winMax.y - p1.y ) / m ; p1.y := winMax.y end { crosses Top }

    CG-6284

  • COHEN-SUTHERLAND LINE CLIPPING ALGORITHM end end; if draw then { draw line from p1 to p2 } lineDDA (round( p1.x), round(p1.y), round (p2.x) , round (p2.y)) end; { clipLine }

    CG-6284

  • COHEN-SUTHERLAND LINE CLIPPING ALGORITHM begin for i:=1to n-1 do clipLine (pts[i] ,pts[I+1]); clipLine ( pts [n] , pts [1] ); end; { clipCohSuth }

    CG-6284

  • POLYGON CLIPPING To clip a polygon we need to modify the line-clipping procedure A polygon boundary processed with a line clipper may be displayed as series of unconected line segments, depending on the orientation of the polygon to the clip window.

    CG-6284

  • POLYGON CLIPPING For polygon clipping , we require an algorithm that will generate one or more closed areas that are then scan converted for the appropriate atrea fill. The output of a polygon clipper should be a sequence of vertices that defines the clipped polygon boundries.

    CG-6284

  • POLYGON CLIPPINGBEFORE CLIPPINGAFTER CLIPPINGDISPLAY OF A POLYGON PROCESSED BY A LINE CLIPPING ALGORITHM.

    CG-6284

  • POLYGON CLIPPINGBEFORECLIPPINGDISPLAY OF CORRECTLY CLIPPIED POLYGON

    CG-6284

  • VECTOR METHOD FOR SPLITTING CONCAVE POLYGONSSPLITTING A CONCAVE POLYGON USING THE VECTOR METHOD

    CG-6284

  • VECTOR METHOD FOR SPLITTING CONCAVE POLYGONS PREVIOUS FIGURE SHOWS A CONCAVE POLYGON WITH SIX EDGES. EDGE VECTOR FOR THIS POLYGON CAN BE EXPRESSED AS : E1 = (1,0,0), E2 = (1,1,0) E3 = ( 1,-1,0), E4 = (0,2,0) E5 = (-3,0,0), E6 = (0,-2,0)

    CG-6284

  • VECTOR METHOD FOR SPLITTING CONCAVE POLYGONS WHERE THE COMPONENT IS 0, SINCE ALL EDGES ARE IN THE X Y PLANE .THE CROSS PRODUCT Ei x Ej FOR TWO SUCCESSIVE EDGE VECTORS IS A VECTOR PERPENDICULAR TO THE XY PLANE E4 WITH Z COMPONENT EQUAL TO Eix Ejy - Ejx Ejy

    CG-6284

  • VECTOR METHOD FOR SPLITTING CONCAVE POLYGONSE1 x E2 = (0,0,1), E2 x E3 = (0,0,-2) E3 x E4 = (0,0,2), E4 x E5 = (0,0,6) E5 x E6 = (0,0,6), E6 x E1 = (0,0,2) SINCE THE CROSS PRODUCT E2 x E3 HAS A NEGATIVE Z COMPONENT, WE SPLIT THE POLYGON ALONGE THE LINE OF VECTOR E2 .

    CG-6284

  • VECTOR METHOD FOR SPLITTING CONCAVE POLYGONS The line equation for this edge has a slope of 1 and a y intercept of -1. We then determine the intesection of this line and the other polygon edges to split the polygon into two pieces. No other edge cross products are negative, so the two new polygons are both convex.

    CG-6284

  • xV1V2V3V4ySPLITTING A CONCAVE POLYGON USING THE ROTATIONAL METHOD. AFTER ROTATING V3 ONTO THE X AXIS, WE FIND THAT V4 IS BELOW THE X AXIS. SO WE SPLIT THE POLYGON ALONG THE LINE OF V2V3.

    CG-6284

  • CURVE CLIPPING Areas with curve boundries can be clipped with methods similar to line & polygon clipping. Curve clipping procedures will involves nonlinear equations, and this reqiures more processing than for objects with linear boundries.

    CG-6284

  • CURVE CLIPPING The bounding rectangle for a circle can be used first to test for overlap with a rectangular clip window. If the bounding rectangle for the object is compeletly inside the window, we save the object.

    CG-6284

  • CURVE CLIPPING If the rectangle is determined to be compeletely outside the window, we discard the object. If the bounding rectangle test fails , we look for other computation-saving approaches.

    CG-6284

  • CURVE CLIPPING For a circle, we can use the coordinate extents of individual quadrantes and then octants for preliminary testing before calculating curve-window intersection. For an ellipse, we can test the coordinate extent of the individual quadrants.

    CG-6284

  • CURVE CLIPPINGCLIPPING OF A FILLED CIRCLEBEFORE CLIPPINGAFTER CLIPPING

    CG-6284

  • TEXT CLIPPING There are several techniques that can be used to provide text clipping in a graphics package. The technique used will depend on the method used to generate character and requirement of a particular application.

    CG-6284

  • TEXT CLIPPING The simplest method for processing character strings relative to a windows boundary is to use the all-or-none string-clipping strategy. If all of the string is inside the a clip window we keep it. Otherise the string is discarded.

    CG-6284

  • TEXT CLIPPING This procedure is implemented by considering a bounding rectangle around the text pettern. The boundary position of the rectangle are then comparedto the windows boundries, and the string is regected if there is any overlap. This method produces the fastest text clipping.

    CG-6284

  • TEXT CLIPPING An alternative to rejecting an entire character string that overlaps a window boundary is to use the all-or-none character-string strategy. Here we only discard those charecters that are not compeletly inside the window.

    CG-6284

  • TEXT CLIPPING

    In this case the boundary limits of individual character are compared to the window. Any charectwer that either overlaps or is outside a window boundary is clipped.

    CG-6284

  • TEXT CLIPPING A final method for handling text clipping is to clip the components of individual charecters. We now treat characters in much the same way that we treated lines.

    CG-6284

  • TEXT CLIPPING If an individual character overlaps a clip window boundary, we clip off the parts of the character that are outside the window.

    CG-6284

  • TEXT CLIPPINGSTRING2AFTER CLIPPINGTEXT CLIPPING USING A BOUNDING RECTANGLEABOUT THE ENTIRE SCREEN.

    CG-6284

  • TEXT CLIPPINGSTRING1STRING2BEFORE CLIPPINGAFTER CLIPPINGTEXT CLIPPING USING A BOUNDING RECTANGLEABOUT INDIVIDUAL CHARECTER.STRING3STRING4STRING4STR TRING3 NG1

    CG-6284

  • TEXT CLIPPINGSTRING1STRING2BEFORE CLIPPINGSTAFTER CLIPPINGTEXT CLIPPING PERFORMED ON THE COMPONENTSOF INDIVIDUIAL CHARACTERS.STRING1

    CG-6284

  • EXTERIOR CLIPPING We have considered only procedures for clipping a picture to the interior of a region. By eliminating everything outside the clipping region. What is saved by these procedure is inside the region.

    CG-6284

  • EXTERIOR CLIPPING In some cases , we want to do the reverse , that is we want to clip a picture to the exterior of the specified region. The picture parts to be saved are those that are outside the region. This is reffered as exterior clliping.

    CG-6284

  • EXTERIOR CLIPPING A typical example of the application of exterior clipping is in multiple window system. Exterior clipping is used also in other application that requires overlaping pictures.

    CG-6284

  • Procedures for clipping objects to the interior of concave polygon windows can also make use of external clipping.

    EXTERIOR CLIPPING

    CG-6284

  • EXTERIOR CLIPPING A line p1 p2 that is to be clipped to the interior of a concave window with vertices v1 v2 v3 v4 v5. Line p1 p2 can be clipped in two passes first, p1 p2 is clipped to the interior of a convex polygon v1 v2 v3 v4 to yield the clipped segment p1` p2` .

    CG-6284

  • EXTERIOR CLIPPING Second, then an external clip of p1` p2` is performed aginst the convex polygon v1 v5 v4 to yield the final clipped line segment p1`` p2``.

    CG-6284

  • NORMALIZED VIEW VOLUMES At the step, a scene is constructed by transforming object description from modeling coordinates. Next, a view mapping converts the world descriptions to viewing coordinates. At the projection stage, the viewing coordinates are transformed to projection coordinates,which effectively converts the view volume into a rectangular parallelepiped.

    CG-6284

  • NORMALIZED VIEW VOLUMES Expanded PHIGS Transformation Pipeline

    CG-6284

  • NORMALIZED VIEW VOLUMES Then, the parallelepiped is mapped into the unit cube, a normalized view volume called the normalized projection coordinate system.The mapping to normalized projection coordinates is accomplished by transforming points within the rectangular parallelepiped into a position within a specified three-dimensional viewport,which occupies part or all of the unit cube.

    CG-6284

  • NORMALIZED VIEW VOLUMES Finally, at the workstation stage, normalized projection coordinates are converted to device coordinates for display. The normalized view volume is a region defined by the planes x=0, x=1, y=0, y=1, z=0, z=1

    CG-6284

  • NORMALIZED VIEW VOLUMES A similar transformation sequence is used in other graphics packages,with individual variation depending on the system.The GL package, for example, maps the rectangular parallelepiped into the interior of a cube with boundary planes at position +-1in each coordinate direction.

    CG-6284

  • NORMALIZED VIEW VOLUMES ADVANTAGES:- The normalized view volume provides a standard shape for representing any sized view volume. The clipping procedures are simplify and standardized with unit clipping plans or the view port plans,and additional clipping plans can be specified within the the normalized space before transforming to device coordinates.

    CG-6284

  • NORMALIZED VIEW VOLUMES The depth cueing and visible-surface determination are simplified, since the z axis always points toward the viewer .

    CG-6284

  • NORMALIZED VIEW VOLUMES Mapping positions within a rectangular view volume to a three-dimensional rectangular viewport is accomplished with a combination of scaling and translation, similar to the operations needed for a two-dimensional window-to-viewport mapping .

    CG-6284

  • NORMALIZED VIEW VOLUMES We can express the three-dimensional transformation matrix for these operation in the form Dx 0 0 Kx0 Dy 0 Ky0 0 Dz Kz0 0 0 1 (12.33)

    CG-6284

  • NORMALIZED VIEW VOLUMES Factors Dx, Dy and Dz are the ratios of the dimensions of viewport and regular parallelepiped view volume in the x, y and z directions. Dx = (XVmax-XVmin) / (YVmax-YVmin) Dy = (YVmax-YVmin) / (YWmax-YWmin) Dz = (ZVmax-ZVmin) / (Zback-Zfront) (12.34)

    CG-6284

  • PARALLELPIPED VIEW VOLUMEUnit cube Dimensions of the view volume and three dimensional viewport.

    CG-6284

  • VIEWPORT CLIPPING Lines and polygon surfaces in a scene can be clipped against the viewport boundaries with procedures similar to those used for two dimensions, except that objects are now processed against clipping planes instead of clipping edges.

    CG-6284

  • VIEWPORT CLIPPING Curved surfaces are processed using the defining equations for the surface boundary and locating the intersections lines with the parallelepiped planes.

    CG-6284

  • VIEWPORT CLIPPING The two dimensional concept of region codes can be extended to three dimensions by considering positions in front and in back of three dimensional viewport , as well as positions that are left ,right ,below ,or above the volume.

    CG-6284

  • VIEWPORT CLIPPING For two dimensional clipping,we used a four digit binary region code to identify the position of a line endpoint relative to the viewport boundaries.For three dimensional points we need to expand the region code to six bits.

    CG-6284

  • Each point in the description of the scene is then assigned a six bit region code that identifies the relative position of the point with respect to the viewport.

    VIEWPORT CLIPPING

    CG-6284

  • For a line endpoint position (x,y,z), we assign the bit positions in the region code from right to left as : Bit 1=1, if xxvmax(right) Bit 3=1, if y
  • Bit 4=1, if y>yvmax(above) Bit 5=1, if zzvmax (back)

    VIEWPORT CLIPPING

    CG-6284

  • As in two dimensional line clipping, we use the calculated intersection of a line with a viewport plane to determine how much of the line can be thrown away.VIEWPORT CLIPPING

    CG-6284

  • The remaining part of the line is checked against the other planes, and we continue until either the line is totally discarded or a section is found inside the volume.

    VIEWPORT CLIPPING

    CG-6284

  • Equations for three dimensional line segments are conveniently expressed in parametric form. The two dimensional parametric clipping methods of cyrus-beck or liang-barsky can be extended to three dimensional scenes. For a line segment with endpoints p1=(x1,y1,z1) and p2=(x2,y2,z2), VIEWPORT CLIPPING

    CG-6284

  • We can write the parametric line equations as X= x1 + (x2-x1)u, 0
  • To find the intersection of a line with a plane of the viewport, we substitute the coordinate value for that plane into the appropriate parametric expression.for instance,suppose we are testing a line against the zvmin plane of the viewport.then u=zvmin -z1/z2-z1 VIEWPORT CLIPPING

    CG-6284

  • when the calculated value for u is not in the range from 0 to 1, the line segment does not intersect the plane under consideration at any point between endpoints p1 and p2.if the calculated value for u is in the interval from 0 to 1,we calculate the intersections x and y coordinates as x1= x1+ (x2-x1) (zvmin-z1)/z2-z1 y1= y1+ (y2-y1)(zvmin-z1)/z2-z1

    VIEWPORT CLIPPING

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES Although we have discussed the clipping procedures in terms of three dimensions coordinates, PHIGS and other packages actually represent coordinate positions in homogeneous coordinates. This allows the various transformations to be represented as 4 by 4matrices, which can be concatenated for efficiency.

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES As each coordinate position enters the transformation pipeline, it is converted to a homogeneous coordinate representation :(x,y,z) (x,y,z,1)

    CG-6284

  • Side view of two line segments that are to be clipped against the Zvmin plane of the viewport . For line A, eq-12-37 produces a value of u that is outside the range from 0 to 1. For line B, eqs-12-38 produce intersectioncoordinates that are outside the range from YVmin to Yvmax.

    CG-6284

  • The various transformation are applied and we obtain the final homogeneous point:

    xhzhyhha11 a12 a13 a14a21 a22 a23 a24 a31 a32 a33 a34 a41 a42 a43 a44xyz1(12-39) where the homogeneous parameter h may not be 1. In fact, h can have any real value.

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES Clipping then performed in homogeneous coordinates, and clipping homogeneous positions are converted to nonhomogeneous coordinates in three dimensional normalized-projection coordinates.

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES

    x` = xh/h , y` = yh/h , z` = zh/h(12-40) We will, of course, have a problem if the magnitude of parameter h is very small or has the value 0; what normally this will not

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES Occur, if the transformations are carried out properly. At the final stage in the transformation pipeline the normalized point is transformed to a three-dimensional device coordinate point.The XY position is plotted on the device, and the Z component is used for depth-information processing.

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES Setting up clipping procedures in homogeneous coordinates allows hardware viewing implementations to use a single procedure for both parallel and perspective projection transformation.

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES Objects viewed with a parallel projection could be correctly clipped in three-dimensional normalized coordinates, provided the value h=1 has not been altered by other operations. But perspective projections, in general, produce a homogeneous parameter that no longer has the value 1.

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES Converting the sheared frustum to a rectangular parallelepiped can change the value of the homogeneous parameter. So we must clip in homogeneous coordinates to be sure that the clipping is carried out correctly. Also, rational spline

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES representation are set up in homogeneous coordinates with arbitrary values for the homogeneous parameters including h
  • CLIPPING IN HOMOGENEOUS COORDINATES when coordinate positions are behind the projection reference point. This can occur in applications where we might want to move inside of a building or other object to view its interior.

    CG-6284

  • CLIPPING IN HOMOGENEOUS COORDINATES To determine homogeneous viewport clipping boundaries, we note that homogeneous- coordinates positions (xh , yh , zh , h) is inside the viewport if it satisfies the inequalities.

    xv min

  • CLIPPING IN HOMOGENEOUS COORDINATESThus the homogeneous clipping limits are hxv min
  • CLIPPING IN HOMOGENEOUS COORDINATES And clipping is carried out with procedures similar to those discussed in the previous sections. To avoid applying both sets of inequalities in 12-42, we can simply negate the coordinates for any point with h0.

    CG-6284

  • CG-6284

  • COMPUTER ANIMATION Some typical applications of computer generated animation are entertainment , advertising, scientific and engg. Studies and training and education. We tend to think of animation as implying object motions , the term computer animation generally refers to any time sequence of visual changes in a scene.

    CG-6284

  • COMPUTER ANIMATION In addition to changing object postion with translation or rotations , a computer generated animation could display time variations in object size, colour , transparency or surface texture.

    CG-6284

  • COMPUTER ANIMATION Advertising animations often transmission one object shape into another e.g. Transforming a can of motor oil into an automobile engine. Computer animation can also be generated by changing camera parameters, such as postion, orientation and focal length.

    CG-6284

  • COMPUTER ANIMATION And we can produce computer animations by changing lighting effects or other parameters associated with illumination and rendering.

    CG-6284

  • COMPUTER ANIMATION Many applications of computer animation require realistic displays.An accurate representation of at the shape of a thunderstorm or other natural phenomenona described with a numerical model is important for evaluating the reliability of the model.

    CG-6284

  • COMPUTER ANIMATION Also, simulators for training aircraft pilots and heavy-equipment's operators must produce reasonably accurate representations of the environment.

    CG-6284

  • DESIGN OF ANIMATION SEQUENCES An animation sequence is designed with the following steps: Storyboard layout. Object definitions. Key-frame specifications. Generation of in-between frames.

    CG-6284

  • DESIGN OF ANIMATION SEQUENCES Storyboard layout:- The storyboard is an outline of the action. It defines the sequence as a set of basic events that are to take place. Depending on the type of the animation to be produced, the storyboard could consists of a set of rough sketches or it could be the list of the basic ideas for the motion.

    CG-6284

  • DESIGN OF ANIMATION SEQUENCESObject definitions: - An object definition is given for each participant in the action. Objects can be defined in terms of basic shapes, Such as polygons.The associated movements for each object are specified along with the shape.

    CG-6284

  • DESIGN OF ANIMATION SEQUENCESKey frame specifications:- A key frame is a detailed drawing of the scene at a certain time in the animations sequence. Within each key frame, each object is positioned according to the time for that frame.

    CG-6284

  • DESIGN OF ANIMATION SEQUENCESKey frame specifications:- Some key frames are chosen at extreme in the action; others are spaced so that the time interval between key frames is not too great.More key frames are specified for intricate motions than for simple, slowly varing motions.

    CG-6284

  • DESIGN OF ANIMATION SEQUENCESGeneration of in-between frames:- In-between are the intermediate frames between the key frames. The number of in-betweens needed is determined by the media to be used to display the animation.

    CG-6284

  • DESIGN OF ANIMATION SEQUENCES Generation of in-between frames:- Film requires 24 frames per second, and graphics terminals are refreshed at the rate of 30to 60 frames per second. Depending on the speed specified for the motion, some key frames can be duplicated.

    CG-6284

  • DESIGN OF ANIMATION SEQUENCES Generation of in-between frames:- For a 1- minute film sequence with no duplication, we would need 1440 frames. If the motion is not too complicated, we could space the key frame a little farther apart.

    CG-6284

  • GENERAL COMPUTER - ANIMATION FUNCTIONS Some steps in the development of an animation sequence are well suited to computer solution. This include object manipulation and rendering, camera motions, and the generations of in-between. Animation packages, such as Wavefront, for example, provide special functions for designing the animation and processing individual objects

    CG-6284

  • GENERAL COMPUTER - ANIMATION FUNCTIONS One function available in animation packages is provided to store an manage the object database.Another typical function simulates camera movements.Standard motions are zooming, panning, and tilting. Finally, given the specifications for the key frames, the in-betweens can be automatically generated.

    CG-6284

  • RASTER ANIMATIONS On raster systems, we can generate real-time animation in limited applications using raster operations.To rotate a block of pixels, we need to determine the percent of area coverage for those pixels that overlap the rotated block.

    CG-6284

  • RASTER ANIMATIONS We can also animate objects along two-dimensional motion paths using the color-table transformations. Here we predefine the object at successive positions along the motion path, and set the successive blocks of pixel values to color-table entries.

    CG-6284

  • COMPUTER-ANIMATION LANGUAGES Design and control of animation sequences are handled with a set of animation routines. A general purpose language, such as C, LISP, PASCAL, or FORTRAN is often used to program the animation functions, but several specialized animation languages have been developed.

    CG-6284

  • COMPUTER-ANIMATION LANGUAGES Animation functions include a graphics editor, a key frame generator, an in- between generator and standard graphics routines. The graphics editor allows us to design and modify objects shapes, using spline surfaces, constructive solid-geometry methods.

    CG-6284

  • COMPUTER-ANIMATION LANGUAGES A typical task in an animation specification is scene description. This includes the positioning of objects and light sources, defining the photometric parameters camera parameters

    CG-6284

  • ANIMATOR Definition: Animator defines the motion of the models,cameras, and lighting according to storyboards and experience.

    CG-6284

  • ANIMATOR The animator must: Understand the structure and intricacies of the model. Be familiar with the principles and practice of photography, lighting, and film direction.

    CG-6284

  • ANIMATOR The animator must:

    Have the ability to breathe life into the scene through realistic, fluid motion.

    CG-6284

  • ANIMATOR 3D Software Recommendations Suggestions for the best software packages:More interested in simpler, designer images, a package with more shader options and nicer rendering may be in order.

    CG-6284

  • ANIMATOR 3D Software Recommendations Artists needing a moderately priced tool for Mac or PC 3D illustration work should weigh truespace2 alongside others at or below its price point.

    CG-6284

  • ANIMATOR `3D Software Recommendations In the mid-range, LightWave is available for several different platforms.The moderately priced Mac package Strata StudioPro is a good choice.

    CG-6284

  • ANIMATOR Choosing a Hardware platform: There are three major platforms for 3D graphics, namely PC,Mac and Unix-type workstations.

    CG-6284

  • ANIMATOR Choosing a Hardware platform: Besides shopping for a particular manufacturer and model of system you also should investigate the peripherals and cards provided.

    CG-6284

  • ANIMATOR Choosing a Hardware platform: The heart of any computer is printed circuit card called the motherboard, which contains numerous electronic components, such as CPU which is brain of the system.

    CG-6284

  • ANIMATOR Choosing a Hardware platform Two main considerations of processors are architecture and speed.Chip architecture refers to the internal design of the processor.

    CG-6284

  • ANIMATOR Choosing a Hardware platform The second consideration is clock speed, which is basically how fast a processor executes instructions, it is measured in millions of cycles per second.

    CG-6284

  • ANIMATOR Choosing a Hardware platform In addition to processor, there are other chipsets on PC motherboards that can affect performance.Final consideration is tech support.

    CG-6284

  • ANIMATOR SGI/Unix Silicon Graphics Workstations have long been considered the ultimate platform for creating computer graphics.

    CG-6284

  • ANIMATOR SGI/Unix SGI Workstations hold the top position in computer graphics due to their speed and advanced scaleable 3D acceleration hardware.

    CG-6284

  • ANIMATOR SGI/Unix There are also high-powered Unix workstations as well, including the Sun SparcStation, DEC alpha, IBM RS6000, and others.

    CG-6284

  • ANIMATOR PC: The PC is the overwhelming winner in the desktop computer wars. They are relatively inexpensive, going for less than $1,000 for a decent P5/133 to about $6,000.

    CG-6284

  • ANIMATOR Macintosh: The Macintosh has been a substantial rise in computing power,e specially since Apple finally started licensing its architecture and OS to third parities.

    CG-6284

  • ANIMATOR Platform Recommendations:

    The right platform to buy is one that runs the software you want.

    CG-6284

  • ANIMATOR Platform Recommendations: The PC is most popular platform, and the intense competition among manufacturers keeps driving the price/performance ratios at a breakneck pace.

    CG-6284

  • ANIMATOR Choosing Peripherals: Every computer system needs some peripheral devices to be truly usable, be it a monitor, hard drive or other mass storage device, printer or modem.

    CG-6284

  • ANIMATOR Choosing Peripherals: Peripherals, such as cartridge hard drives and modems are available in either internal or external configurations, means that you either install them inside your CPU or in their own enclosure.

    CG-6284

  • ANIMATOR Choosing Peripherals: Storage: The first law of computing states that files expand to overflow your storage capacity. An example is desktop video.

    CG-6284

  • ANIMATOR Choosing Peripherals: Hard Drive Basics: Hard drives were a bulky, expensive rarity, and practically unheard of for desktop systems.

    CG-6284

  • ANIMATOR Choosing Peripherals: Hard Drive Basics: Are sealed units containing a motor that spins a set of metal disks called magnetic platters.A read/write head, moves back and forth reading and writing data with a set of electromagnetic pulses.

    CG-6284

  • ANIMATOR Choosing Peripherals: Hard Drive Basics: There are five terms that will gauge drive performance: Seek Time:The maximum time it takes to move the read/write head to a specific location on the disk.

    CG-6284

  • ANIMATOR Choosing Peripherals Track-to-track seek time: The time it takes to move the read/write head from one track to another. Data transfer rate: The maximum rate at which information is delivered from the drive to computer.

    CG-6284

  • ANIMATOR Choosing Peripherals Revolution Per Minute:This is related to the data transfer rate,because the faster the drive spins the faster the data transferred. Interface: The interface on the drive must match the one in the system.

    CG-6284

  • ANIMATOR Choosing Peripherals Cartridge: Is a storage system that uses removable media to store data.The cartridge have magnetic platters in them just like regular hard drive.

    CG-6284

  • ANIMATOR Choosing Peripherals Optical Media: Magneto-Optical drives are another form of cartridge-based storage that offered comparatively high storage capabilities.

    CG-6284

  • ANIMATOR Choosing Peripherals Tape Media: There are several different types of backup formats and systems available, including Colorado, Travan,QIC, DLT, and DAT.The main considerations for selecting one system over another are capacity and cost.

    CG-6284

  • ANIMATOR Choosing Peripherals Video display Cards: The video display card is responsible for converting the text and graphics data in the computer into a form that the computer monitor can display.

    CG-6284

  • ANIMATOR Choosing Peripherals Video display Cards: Video card Recommendation: Choice of graphics card depend on motherboard, because you will want to use the fastest bus available

    CG-6284

  • ANIMATOR Choosing Peripherals Display: Computer display is the most overlooked component in the system.For 3D and graphic arts, a 15 monitor should be considered minimum size, with 17 or larger desirable.

    CG-6284

  • ANIMATOR Choosing Peripherals Input Devices: Input devices are: Trackball. Flying Mice. Spaceballs. Dial boxes. Graphics tablets: One of them are Pressure-sensitive tablets.

    CG-6284

  • ANIMATOR Input Devices: Scanners: 1.Document Scanner 2.Slide Scanner. Cameras. Digitizers.

    CG-6284

  • ANIMATOR Animation basics: Animation is modifying any kind of object, light, material or camera by moving or changing it overtime.

    CG-6284

  • ANIMATOR Animation basics Frame Rates:The speed at which the images are displayed is called the frame rate and is measured in frames per second.

    CG-6284

  • ANIMATOR Animation basics Keyframing: To control animation most programs use a method called keyframing, in which you pose your objects in key positions at specific frames.

    CG-6284

  • ANIMATOR Animation basics Motion Paths: A useful capability in 3D programs is the ability to work directly with the motion path of an object, which is a graphical representation of its movement.

    CG-6284

  • ANIMATOR Animation basics Pivot Points and axes: In animation an object may be transformed around one of several axes or points of rotation or pivot points.

    CG-6284

  • ANIMATOR Animation basics Preview: In the animation process,you will want to see a representation of how things are moving,there will be some preview mode that will display a simplified version of the scene in real time.

    CG-6284

  • ANIMATOR Animation basics Links : A link is a connection between two objects so that animation affecting one also influences the other.

    CG-6284

  • ANIMATOR Animation basics One object is called the parent and movement applied to it is transferred to the second is called child.

    CG-6284

  • ANIMATOR Animation basics Chains: A chain is a series of linked objects,using the same parent and child relationship,but extending it by additional generations to grandchild and so.

    CG-6284

  • ANIMATOR Animation basics nulls:Nulls or dummy objects are used as invisible components chain or as reference points for establish remote axes for rotation.

    CG-6284

  • ANIMATOR Animation basics Forward Kinematics: Forward kinematics is the default method of animating linked objects, in which the movement of the parent object affects all the offspring on down the chain.

    CG-6284

  • ANIMATOR Animation basics Inverse Kinematics: Is a method of controlling linked objects by moving the end of the chain and having the rest of it conform.

    CG-6284

  • ANIMATOR Animation basics Bones Deformation: Is the technique of animating an object by defining and animating an internal skeleton that automatically deforms the surrounding mesh.

    CG-6284

  • ANIMATOR Animation basics Morphing: Animation is a technique that allows smooth changes to occur to an objects shape by defining beginning, end and possibly intermediate forms as target.

    CG-6284

  • ANIMATOR Animation basics Deformation Grids:Space Wraps are a means of defining an area in 3D space that has an automatic effect on objects passing through its influence.

    CG-6284

  • ANIMATOR Animation basics Particle Systems: These are 3D animation modules that enable you to generate and control the behavior of vast number of tiny objects.

    CG-6284

  • ANIMATOR Animation basics

    Procedural motion: The movement of particle systems is sometimes referred to as procedural motion.

    CG-6284

  • ANIMATOR Character Animation:

    Character animation is the process of imbuing objects not just with simple movement, but with personality.The key to compelling characters is making them act naturally.

    CG-6284

  • Our graphics system might be useful in producing animated films. Animation is done by photographing a sequence of drawings. Each is slightly different from the previous .ANIMATOR

    CG-6284

  • ANIMATOR To show a person moving his arm , a series of drawings is photographed , each drawing showing the arm at a different position. When the images are displayed on the after another by a movie projector, we perceive the arm as moving through the sequence.

    CG-6284

  • ANIMATORANIMATION OF ARM BY A SERIES OF PICTURE

    CG-6284

  • Our graphics system could be used to generate the background drawing. The scene is a city street . to show a character moving down the street , we really want to keep the character centered and move the secenery past him. ANIMATOR

    CG-6284

  • ANIMATOR Each frame will show the background shifted a little more to the right. This will give the impression that our character has moved to left.

    CG-6284

  • APPARENT MOVEMENT BY TRANSLATION OF THE BACKGROUND

    CG-6284

  • VECTOR METHOD FOR SPLITTING CONCAVE POLYGONSSPLITTING A CONCAVE POLYGON USING THE VECTOR METHOD

    CG-6284

  • Previous figure shows a concave Polygon with six edges. Edge vector for this polygon can be expressed as : VECTOR METHOD FOR SPLITTING CONCAVE POLYGONS

    CG-6284

  • CG-6284

  • PARALLEL PROJECTION In a parallel projection, parallel lines in the world-coordinate scene project into parallel lines on the two-dimensional display playing. This technique is used in engineering and architectural drawings tools to represent and object with set of views that maintain relative properties of the object .

    CG-6284

  • PARALLEL PROJECTIONTOPSIDEFRONTFig:- Parallel-projection views of an object,showing relative proportion from different viewing positions

    CG-6284

  • PARALLEL PROJECTION The appearance of the solid object can then be reconstructed from the major views. In the perspective projection, parallel lines in a scene that are not parallel to display plane are projected into converging lines. Scenes displayed using perspective projections appear more realistic.

    CG-6284

  • DEPTH CUEING With few exceptions, depth information is important so that we can easily identify, for a particular viewing direction, which is the front and which is the back of displayed objects. A simple method indicating depth with wire frame displays is to vary the intensity of objects according to their distance from the viewing position.

    CG-6284

  • DEPTH CUEING The lines closest to the viewing position are displayed with the highest intensities and lines further away are displayed with decreasing intensities. Depth cueing is applied by choosing maximum and minimum intensity values and range of distances over which the intensities are to the vary.

    CG-6284

  • DEPTH CUEING Depth cueing is used in modeling the effect of atmosphere on the perceived intensity of objects . Some atmospheric effects can change the perceived color of an object, and we can model these effects with depth cueing.

    CG-6284

  • VISIBLE LINE AND SURFACE IDENTIFICATION We can clarify depth relationships in a wire frame display by identifying visible lines in some way . The simplest method is to highlight the visible lines or to display them in different color. Another technique commonly used for engineering drawings is to display the non visible lines as dashed lines.

    CG-6284

  • SURFACE RENDERING Added realism is attained in displays by setting the surface intensity of object according to the