340 likes | 646 Views
Two-Dimensional Geometric Transformations ch5. 참조. Subjects : Basic Transformations Homogeneous Coordinates Composite Transformations Other Transformations Properties of Transformation matrix. Basic Transformations : Translation (1/2). Translation ( 이동 )
E N D
Two-Dimensional Geometric Transformations ch5. 참조 Subjects : • Basic Transformations • Homogeneous Coordinates • Composite Transformations • Other Transformations • Properties of Transformation matrix
Basic Transformations : Translation (1/2) • Translation (이동) • Definition : repositioning objects along a straight line path from one position to another • Let : original position, : new position • We need translation distance (translation vector) for x direction for y direction • Then,
Translation (2/2) • In matrix form • Translation is rigid-body Transformation that moves objects without deformation • every point on the object is translated by the same amount • For straight line • applying translation distance to each line end points • For polygon, curves
Basic Transformations : Rotation (1/3) • Rotation • Definition : repositioning objects along a circular path in the xy plane • We need to specify • rotation angle • rotation point (pivot point) • direction (clockwise (-), counter clockwise(+)) • a rotation about a rotation axis Z
Rotation (2/3) • Rotation angle : • rotation point : origin (0,0) • direction : c.c.w • Then • where • original points are • so,
Rotation (3/3) • In matrix form called Rotation matrix • Rotation about an arbitrary pivot position • As with translations, rotations are rigid-body transformations
Basic Transformations : scaling (1/2) • Scaling • Definition : alters the size of an objects • we need scaling factors : for x value : for y value • In matrix form • Then • if : Uniform scaling : differential scaling
scaling (2/2) • if : uniform compression • move objects to the coordinate origin • if : uniform Enlargement • move objects farther from the origin • Fixed point scaling : scaling based on a fixed point • An object is scaled relative to the fixed point by scaling distance from each vertex to fixed point • when
Homogeneous Coordinates (1/4) • Let’s consider combination of two transformation, translation after rotation • We can combine two matrices into a single matrix by expanding the 2x2 matrix to 3x3 matrix i.e.
Homogeneous Coordinates (2/4) • To utilize above 3x3 matrix, • represent Cartesian coordinate point (x,y) with the Homogeneous Coordinate (xh, yh, h) • where • Homogeneous Coordinate : (xh, yh, h) • first developed in geometry (1946) • applied in graphics by Roberts (1965) • usually h=1 (called weight value) • then (2,3) = (2,3,1) = (1,1.5,0.5)
Homogeneous Coordinates (3/4) • there is infinite number of equivalent representation for point (x,y) • origin case (0,0,1) • for (xh, yh, h), at least one of triple must be nonzero, i.e. (0,0,0) is not allowed • if (x,y,0) called point at infinity • For Translation, Rotation, Scaling Translation: Scaling: Rotation:
Homogeneous Coordinates (4/4) • with the H.G.C we can perform uniform scaling with scaling factor S • when S>1 : Uniform compression 0<S<1 : Uniform enlargement • with the H.G.C the transformation matrix be 3x3, i.e. m, n : translation factor s : scaling factor
Composite Transformation (1/2) • Translation • If two successive translation factor (tx1, ty1) and (tx2, ty2) are applied to a coordinate point P • then • ex) i.e, • Two successive Translation are additive
Composite Transformation (2/2) • Rotation • two successive rotation • two successive rotations are also additive • Scaling • successive scalings are multiplicative
General pivot-point Rotation (1/2) • Rotation about arbitrary point p (xr, yr) • step1) Translate P to origin • step2) Rotation about origin • step3) Retranslation to position P.
General pivot-point Rotation (2/2) • Composite transformation matrix
General Fixed-Point Scaling • Scaling about arbitrary point p(xr, yr) • step 1) translate p to origin • step 2) scaling about origin • step 3) Retranslate to position P
General Scaling Directions • Normal scaling performed along x and y directions • To accomplish the scaling for arbitrary direction without changing object orientation • Rotate direction by • Perform scaling • Rerotate by
Concatenation properties. • Matrix multiplication : associative • ex) For three matrices A, B and C • Translation or Rotation : additive property commutative • scaling : multiplicative property commutative • However, Translation and Rotation : non commutative • order of transformation matrix multiplication is important
Other Transformations : Reflection (1/4) • Reflection : produce a mirror images of an object • We need axis of reflection • rotating the objects 180°about reflection axis • Reflection about line y=0, the x axis. • x coordinate values are unchanged • the transformation matrix
Reflection (2/4) • Reflection about line x=0, the y axis • y coordinate values are unchanged • Reflection about origin • both x and y values are changed
Reflection (3/4) • Reflection through arbitrary point P (xr, yr) • translate point p to origin : Tr • perform reflection about origin : Ro • retranslate to original position : Tr • Reflection through y=x line
Reflection (4/4) • Reflection through an arbitrary line y=Lx+b
Other Transformations: Shear (1/3) • Shear : distorts the shape of an object • Shearing (slide over) can be done either x or y direction • x direction shearing by shearing factor shx • point is shifted by horizontally by an amount proportional to its distance from x-axis • y values are unchanged
Shear (2/3) • So, • Transformed positions • y direction shearing • x-direction shearing relative to line
Shear (3/3) • y-direction shearing relative to line
Properties of Transformation matrix (1/5) • Properties of Rotation matrix • case1) rotate point p p’ c.c.w direction by • case2) rotate point p’ p c.w. direction by • same result to rotate ( ) to c.c.w direction • is a Inverse matrix of • i.e,
Properties of Transformation matrix (2/5) • Examine (A) & (B) then Inverse matrix = Transpose matrix of R I.e, • So, the inverse of the general rotation matrix [R] is its transpose • Def) An nxn matrix A is an orthogonal matrix if • Def) Every 2x2 orthogonal matrix R with det[R]=1 is pure rotation matrix
Properties of Transformation matrix (3/5) • Properties of Reflection matrix • Determinant of Reflection matrix = -1 • Def) Every 2x2 orthogonal matrix R with det(R) = -1 is a pure reflection matrix • If two pure reflections about line passing through the origin are applied successively, the result is a pure rotation about the origin • ex) reflection through x axis (RX) and reflection through y axis (RY)
Properties of Transformation matrix (4/5) • Rigid-body Transformation • concept : moves object without deformation • i.e, perpendicular lines transformed as perpendicular lines or unit square remains a unit square • Translation, rotation, or combination of both
Properties of Transformation matrix (5/5) • Affine Transformation • Concepts : • parallel lines transformed as parallel lines • finite points maps to finite points • but not length and angle • Rot, Trans, Ref preserves angle and length • Tra, Rot, Sca, Ref, and Shr or combination of those