+ All Categories
Home > Documents > Transformations

Transformations

Date post: 09-Feb-2016
Category:
Upload: julie
View: 23 times
Download: 1 times
Share this document with a friend
Description:
Transformations. - PowerPoint PPT Presentation
Popular Tags:
29
168 471 Computer Graphics, KKU. Lec ture 5 1 Transformations Given two frames in an affine space of d imension n, we can find a (n+1) x (n+1) m atrix that converts the coor- dinates of a point in the first frame to the coordi nates of the same point in the second fr ame. The opera- tion are called transform ation. The matrix is called transformation matrix. In 3D space, for example, the gen eral form of the matrix is
Transcript
Page 1: Transformations

168 471 Computer Graphics, KKU. Lecture 5

1

Transformations

Given two frames in an affine space of dimensionn , we can find a (n+1 ) x (n +1 ) matrix that conver

- ts the coor dinates of a point in the first frame to the coordinates of the same point in the second f

- rame. The opera tion are called transformation . The matrix is called transformation matrix . I

n 3 D space, for example, the general form of th e matrix is

Page 2: Transformations

168 471 Computer Graphics, KKU. Lecture 5

2

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

Page 3: Transformations

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 that1

2

3

Du DDv DDw D

and

Page 4: Transformations

168 471 Computer Graphics, KKU. Lecture 5

4

Finding a transformation matrix

Consider two frames denoted as and By Cramer’s rule, let

1. If we give , then we can get 1,1 1,2 1,3, , ande u e v e w

2. If we give , then we can get 2,1 2,2 2,3, ,ande u e v e w

3. If we give , then we can get 3,1 3,2 3,3, , ande u e v e w

4 . If we give , then we can get4,1 4,2 4,3, , ande u e v e w

Page 5: Transformations

168 471 Computer Graphics, KKU. Lecture 5

5

168 471 Computer Graphics (First Semester, 2001)Assignment#2 (Due on June 27, 2001)

1. For three points in 2D cartesian frame, 1 1( , )x y , 2 2( , )x y and 3 3( , )x y , show that thedeterminant

1 2 3

1 2 3

1 1 1

x x xy y y

is proportional to the area of the triangle whose corner are the three points.

2. By using Cramer’s rule, determine the transformation matrix of the example given at the endof the lecture 4.

Page 6: Transformations

168 471 Computer Graphics, KKU. Lecture 5

6

Simple Transformations

• Translation• Scaling• Rotation• Shearing

Page 7: Transformations

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

• Translation of points within the frame

the origin is moved but the vectors stay the same.

Page 8: Transformations

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.

Page 9: Transformations

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

Page 10: Transformations

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.

Page 11: Transformations

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.

Page 12: Transformations

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.

Page 13: Transformations

168 471 Computer Graphics, KKU. Lecture 5

13

• 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

Page 14: Transformations

168 471 Computer Graphics, KKU. Lecture 5

14

Rotation about the X-Axis

;xR

Page 15: Transformations

168 471 Computer Graphics, KKU. Lecture 5

15

Rotation about the Y-Axis

;yR

Page 16: Transformations

168 471 Computer Graphics, KKU. Lecture 5

16

Rotation about the Z-Axis

;zR

Page 17: Transformations

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

Page 18: Transformations

168 471 Computer Graphics, KKU. Lecture 5

18

Rotation about an arbitrary axis (Cont.)

2. Rotate the vector until it is in the yz ppppp pp ppppp p pppppppp

where

Page 19: Transformations

168 471 Computer Graphics, KKU. Lecture 5

19

Rotation about an arbitrary axis (Cont.)

3. Rotate the vector until it coincides with the x axis

where

Page 20: Transformations

168 471 Computer Graphics, KKU. Lecture 5

20

Rotation about an arbitrary axis (Cont.)

4. Rotate about the z axis.

Page 21: Transformations

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

Page 22: Transformations

168 471 Computer Graphics, KKU. Lecture 5

22

Rotation about an arbitrary axis (Cont.)

The matrix representation of the general rotation is given by the product of the above transformations.

Page 23: Transformations

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.

Page 24: Transformations

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.

Page 25: Transformations

168 471 Computer Graphics, KKU. Lecture 5

25

- X Shearing (Cont.)

• X-shearing a point

• The X-shear transformation matrix can be defined by

Page 26: Transformations

168 471 Computer Graphics, KKU. Lecture 5

26

Y-Shearing

• Y-shearing a frame

Page 27: Transformations

168 471 Computer Graphics, KKU. Lecture 5

27

- Y Shearing (Cont.)

• Y-shearing a point

• The Y-shear transformation matrix can be defined by

Page 28: Transformations

168 471 Computer Graphics, KKU. Lecture 5

28

Z-Shearing

• Z-shearing a frame

Page 29: Transformations

168 471 Computer Graphics, KKU. Lecture 5

29

- Z Shearing (Cont.)

• Z-shearing a point

• The Z-shear transformation matrix can be defined by


Recommended