Presentation is loading. Please wait.

Presentation is loading. Please wait.

168 471 Computer Graphics, KKU. Lecture 51 Transformations Given two frames in an affine space of dimension n, we can find a ( n+1 ) x ( n +1) matrix that.

Similar presentations


Presentation on theme: "168 471 Computer Graphics, KKU. Lecture 51 Transformations Given two frames in an affine space of dimension n, we can find a ( n+1 ) x ( n +1) matrix that."— Presentation transcript:

1 168 471 Computer Graphics, KKU. Lecture 51 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

2 168 471 Computer Graphics, KKU. Lecture 52 Transformations: The Relationship 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 In 3D space

3 168 471 Computer Graphics, KKU. Lecture 53 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

4 168 471 Computer Graphics, KKU. Lecture 54 Finding a transformation matrix Consider two frames denoted as and By Cramer’s rule, let 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

5 168 471 Computer Graphics, KKU. Lecture 55

6 6 Simple Transformations Translation Scaling Rotation Shearing

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

8 168 471 Computer Graphics, KKU. Lecture 58 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.

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

10 168 471 Computer Graphics, KKU. Lecture 510 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.

11 168 471 Computer Graphics, KKU. Lecture 511 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.

12 168 471 Computer Graphics, KKU. Lecture 512 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.

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

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

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

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

17 168 471 Computer Graphics, KKU. Lecture 517 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

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

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

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

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

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

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

24 168 471 Computer Graphics, KKU. Lecture 524 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.

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

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

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

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

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


Download ppt "168 471 Computer Graphics, KKU. Lecture 51 Transformations Given two frames in an affine space of dimension n, we can find a ( n+1 ) x ( n +1) matrix that."

Similar presentations


Ads by Google