1 / 29

Transformations

Transformations.

julie
Télécharger la présentation

Transformations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Transformations Given two frames in an affine space of dimension n, we can find a (n+1) x (n+1) matrix that converts the coor- dinates of a point in the first frame to the coordinates of the same point in the second frame. The opera- tion are called transformation. The matrix is called transformation matrix. In 3D space, for example, the general form of the matrix is 168 471 Computer Graphics, KKU. Lecture 5

  2. Transformations: The Relationship • In 3D space • The matrix can be applied to - the coordinate,leaving the frame fixed. - the frame, leaving the coordinate fixed. • It is useful to allow us to shift a point between the local coordinates of the point, or between the frames 168 471 Computer Graphics, KKU. Lecture 5

  3. Cramer’s Rule Given a frame and any point having coordinates (u,v,w), we can define a vector Cramer’s Rule states that and 168 471 Computer Graphics, KKU. Lecture 5

  4. Consider two frames denoted as and By Cramer’s rule, let Finding a transformation matrix 1. If we give , then we can get 2. If we give , then we can get 3. If we give , then we can get 4. If we give , then we can get 168 471 Computer Graphics, KKU. Lecture 5

  5. 168 471 Computer Graphics, KKU. Lecture 5

  6. Simple Transformations • Translation • Scaling • Rotation • Shearing 168 471 Computer Graphics, KKU. Lecture 5

  7. Translation • Moves all points of an objects a fixed distance in a specified direction. • Translation of frames the origin is moved but the vectors stay the same. • Translation of points within the frame 168 471 Computer Graphics, KKU. Lecture 5

  8. Translation (Cont.) • A translation matrix is • The matrix is most frequently applied to all points of an object in the local system to move the object within the system. 168 471 Computer Graphics, KKU. Lecture 5

  9. Scaling • Scales the coordinates of an objects • Scaling a frame - expands or contracts the lengths of the vectors • Scaling a point 168 471 Computer Graphics, KKU. Lecture 5

  10. Scaling (Cont.) • A Scaling matrix • By scaling, you multiply each point of an object by a factor which effectively scaling the object about the origin. 168 471 Computer Graphics, KKU. Lecture 5

  11. Scaling (Cont.) • If the center of the object is not at the origin, the operation will move the object away from the origin of the frame. 168 471 Computer Graphics, KKU. Lecture 5

  12. Scaling (Cont.) • For the case of scaling about other points, we need to combine the scaling transformation with two translation transformations in order to correctly get a transformation matrix. 168 471 Computer Graphics, KKU. Lecture 5

  13. Rotating about a point in two dimensions Rotation • performed about an axis which is usually specified by a point P and a vector direction . Rotation matrix 168 471 Computer Graphics, KKU. Lecture 5

  14. Rotation about the X-Axis 168 471 Computer Graphics, KKU. Lecture 5

  15. Rotation about the Y-Axis 168 471 Computer Graphics, KKU. Lecture 5

  16. Rotation about the Z-Axis 168 471 Computer Graphics, KKU. Lecture 5

  17. Rotation about an arbitrary axis • Assuming the axis of rotation is represented by and then a rotation of degrees about this axis can be defined by concatenating the following transformations 1. Translate so that the point P moves to the origin 168 471 Computer Graphics, KKU. Lecture 5

  18. where Rotation about an arbitrary axis (Cont.) 2. Rotate the vector until it is in the yz plane by using a rotation 168 471 Computer Graphics, KKU. Lecture 5

  19. where Rotation about an arbitrary axis (Cont.) 3. Rotate the vector until it coincides with the x axis 168 471 Computer Graphics, KKU. Lecture 5

  20. Rotation about an arbitrary axis (Cont.) 4. Rotate about the z axis. 168 471 Computer Graphics, KKU. Lecture 5

  21. Rotation about an arbitrary axis (Cont.) 5. Use rotations and translations to reverse the first three steps 168 471 Computer Graphics, KKU. Lecture 5

  22. The matrix representation of the general rotation is given by the product of the above transformations. Rotation about an arbitrary axis (Cont.) 168 471 Computer Graphics, KKU. Lecture 5

  23. Shearing • Shearing transformations in three-dimensions alter two of the three coordinate values proportionally to the value of the third coordinate. 168 471 Computer Graphics, KKU. Lecture 5

  24. X-Shearing • X-shearing a frame: We ``x-shear'' a frame by modifying the first vector of the frame by adding to it a linear combination of the other two vectors. 168 471 Computer Graphics, KKU. Lecture 5

  25. X-Shearing (Cont.) • X-shearing a point • The X-shear transformation matrix can be defined by 168 471 Computer Graphics, KKU. Lecture 5

  26. Y-Shearing • Y-shearing a frame 168 471 Computer Graphics, KKU. Lecture 5

  27. Y-Shearing (Cont.) • Y-shearing a point • The Y-shear transformation matrix can be defined by 168 471 Computer Graphics, KKU. Lecture 5

  28. Z-Shearing • Z-shearing a frame 168 471 Computer Graphics, KKU. Lecture 5

  29. Z-Shearing (Cont.) • Z-shearing a point • The Z-shear transformation matrix can be defined by 168 471 Computer Graphics, KKU. Lecture 5

More Related