GEOMETRIC TRANFORMATIONS Presented By -Lakshmi Sahithi
GEOMETRIC TRANSFORMATIONS Geometric Transformation The object itself is moved relative to a stationary coordinate system or background. With respect to some 2-D coordinate system, an object O is considered as a set of points. O = { P(x,y)} If the Object O moves to a new position, the new object O’ is considered: O’ = { P’(x’,y’)}
GEOMETRIC TRANSFORMATIONS There are two types of Transformations: 2D Transformations 3D Transformations
2D-Transformations Types of 2D Transformations: 2D Translations 2D Scaling 2D Rotation 2D Reflection 2D Shear
2D Scaling Scaling Linear transformation that enlarges (increases) or shrinks (diminishes) objects by a scale factor that is the same in all directions. The result of uniform scaling is similar (in the geometric sense) to the original.
2D Translation 2D Translations Moving an object is called a translation. We translate an object by translating each vertex in the object It translates the point P to P’ using the dx and dy. dx and dy refers to the distance between x and y co ordinates of P and P’.
2D Rotation Rotation is moving a point in space in non-linear manner. It involves moving the point from one position on a sphere whose center is at origin to another position on sphere. Rotating a point requires: The coordinates for the point The rotation angles
2D Reflection is a transformation that produces a mirror image of an object. It is obtained by rotating the object by 180 deg about the reflection axis
2D Shear Shear is a 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 Two common shearing transformations are those that shift coordinate x values and those that shift y values
2D Translations
11 P The new position P’ for the point P is calculated as below. p’ = p+ T where and x’ = x + dx y’ = y + dy Here dx and dy are the change’s in distance of x and y co ordinates of axis. 2D Translation dx = 2 dy = 3 Y X (Note: Points are at object’s local coordinate system origin)
2D Scaling Let P be P(x,y) Now we scale the point P(x,y) to point P(x’,y’) by a factor sx and sy along x and y axis respectively So we have to find out P’(x’,y’) where S=(sx,sy). P P’
Y X D Scaling
2D Rotation
2D Reflection ’ 2’ 3’ Original position Reflected position Reflection of an object relative to an axis perpendicular to the xy plane and passing through the coordinate origin X-axis Y-axis Origin O (0,0) The above reflection matrix is the rotation matrix with angle=180 degree. This can be generalized to any reflection point in the xy plane. This reflection is the same as a 180 degree rotation in the xy plane using the reflection point as the pivot point.
Reflection of an object w.r.t the straight line y=x ’ 3’ 2’ Original position Reflected position X-axis Y-axis Origin O (0,0)
Reflection of an object w.r.t the straight line y=-x ’ 3’ 2’ 3 X-axis 1 Original position Reflected position 2 Y-axis Origin O (0,0) Line Y = - X
2D Shears Original Datay Shearx Shear sh x 0 sh y
An X- direction Shear (0,1) (1,1) (1,0) (0,0) (1,0) (2,1) (3,1) For example, Sh x =2
An Y- direction Shear (0,1) (1,1) (1,0) (0,0) (0,1) (1,3) (1,2) For example, Sh y =2 X X YY
Transformations Let P be the original point, then the transformed point is given by the following Translation P=T + P Scale P=S P Rotation P=R P
3D Transformations Translations Scaling Rotation Shear Reflection
3D Translation 3D Translations are very similar to that of 2D Translations Let us take a three dimensional coordinate system and consider a point P(x,y,z) in the system.
3D Translation Let P’(x’,y’,z’) be the point after translation X’=x+t x Y’=y+t y Z’=z+t z Where t x, t y and t z represent the distance between x, y and z co-ordinate’s from original point P.
3D Translation The diagram below explains it clearly,
3D Scaling When we enlarge object the position of the object changes from origin
Scaling with respect to a fixed point (not necessarily of object)
3D Rotation z x y 3D rotation can take place about each axis i.e. It can rotate about x-axis, y-axis, and z-axis z x y z x y
3D Rotation In 2-D, a rotation is define by an angle θ & a center of rotation P. Whereas in 3-D rotations we need the an angle of rotation & an axis of rotation. Rotation about the z axis: R θ,K x’ = x cosθ – y sinθ y’ = x sinθ – y cosθ z’ = z
3D Rotation Rotation about the y axis: R θ,J x’ = x cosθ + z sinθ y’ = y z’ = - x sinθ + z cosθ Rotation about the x axis: R θ,I x’ = x y’ = y cosθ – z sinθ z’ = y sinθ + z cosθ
& the rotation matrix corresponding is cos θ -sin θ 0 R θ,K = sin θ cos θ cos θ 0 sin θ R θ,J = sin θ 0 cos θ R θ,I = 0 cos θ -sin θ 0 sin θ cos θ
3D Reflections The matrix expression for the reflection transformation of a position P = (x, y, z) relative to x-y plane is given below: Transformation matrices for inverting x and y values are defined similarly, as reflections relative to yz plane and xz plane, respectively.
3D Shears The matrix equation for the shearing transformation of a position P = (x, y, z), to produce z-axis shear, is shown below:
Shears Parameters a and b can be assigned any real values. The effect of this transformation is to alter x- and y- coordinate values by an amount that is proportional to the z value, while leaving the z coordinate unchanged. Shearing transformations for the x axis and y axis are defined similarly.
Thank you!!