III 3 D Transformation Homogeneous Coordinates The three

  • Slides: 37
Download presentation
III 3 D Transformation Homogeneous Coordinates • The three dimensional point (x, y, z)

III 3 D Transformation Homogeneous Coordinates • The three dimensional point (x, y, z) is represented by the homogeneous coordinate (x, y, z, 1) • In general, the homogeneous coordinate (x, y, z, w) represents the three dimensional point (x/w, y/w, z/w) • The generalized transformation matrix: 1

Scaling • In general, this is done with the equations: xn = sx *

Scaling • In general, this is done with the equations: xn = sx * x yn = sy * y zn = sz * z • This can also be done with the matrix multiplication: 2

 • Scaling can be done relative to the object center with a composite

• Scaling can be done relative to the object center with a composite transformation • Scaling an object centered at (cx, cy, cz) is done with the matrix multiplication: 3

Shearing • Equivalent to pulling faces in opposite directions • 4

Shearing • Equivalent to pulling faces in opposite directions • 4

5

5

6

6

7

7

8

8

Rotation • Rotation can be done around any line or vector • Rotations are

Rotation • Rotation can be done around any line or vector • Rotations are commonly specified around the x, y, or z axis • A positive angle of rotation results in a counterclockwise movement when looked at from the positive axis direction • The matrix form for rotation – x axis 9

– y axis – z axis 10

– y axis – z axis 10

11

11

12

12

13

13

Reflection • Reflection through the xy-plane: • Reflection through the yz-plane: • Reflection through

Reflection • Reflection through the xy-plane: • Reflection through the yz-plane: • Reflection through the xz-plane: 14

15

15

16

16

Translations • The amount of the translation is added to or subtracted from the

Translations • The amount of the translation is added to or subtracted from the x, y, and z coordinates • In general, this is done with the equations: xn = x + tx yn = y + ty zn = z + tz • This can also be done with the matrix multiplication: 17

18

18

19

19

20

20

21

21

22

22

Combining Transformations • Matrices can be multiplied together to accomplish multiple transformations with one

Combining Transformations • Matrices can be multiplied together to accomplish multiple transformations with one matrix • A matrix is built with successive transformations occurring from right to left • A combination matrix is typically built from the identity matrix with each new transformation added by multiplying it on the left of the current combination 23

Rotation about an Arbitrary Axis in Space • Assume an arbitrary axis in space

Rotation about an Arbitrary Axis in Space • Assume an arbitrary axis in space passing through the point with direction cosines and rotation about this axis by some angle • 24

 • Direction cosines: 25

• Direction cosines: 25

 • The complete transformation is: 26

• The complete transformation is: 26

27

27

28

28

29

29

30

30

31

31

Reflection through an Arbitrary Plane • 32

Reflection through an Arbitrary Plane • 32

 • The general transformation is: 33

• The general transformation is: 33

34

34

35

35

36

36

37

37