150 likes | 153 Vues
Geometrical Transformations 2. Adapted from Fundamentals of Interactive Computer Graphics , Foley and van Dam, pp. 245-315, by Geb Thomas. Learning Objectives. Learn how 2D transformations are represented in 3D. Recognize the inverse matrix for a homogeneous transformation.
E N D
Geometrical Transformations 2 Adapted from Fundamentals of Interactive Computer Graphics, Foley and van Dam, pp. 245-315, by Geb Thomas
Learning Objectives • Learn how 2D transformations are represented in 3D. • Recognize the inverse matrix for a homogeneous transformation. • Understand how the transformations also represent coordinate frame transformations. • Understand the concept of a matrix stack.
3D Rotation – Z Axis About the Z axis z y x
3D Rotation – X Axis About the Z axis z y x
3D Rotation – Y Axis About the Z axis z y x
Inverse Matrices • The 3x3 rotation submatrix is orthogonal. • The inverse of the 3x3 matrix is the transform of the original matrix • The inverse of the translation component is just the reverse translation.
Composition of Transforms • Various motions can be tacked, one after the other, in a long sequence of matrices: T1T2T3…T4 • These combinations will maintain the relative shape of the vectors processed, but will shift them around the original coordinate frame.
Thinking of Reference Frames • Another way to think of this mathematics, is to imagine transforming the coordinate frame to a new place Transformation, T, moves things 5 to the right and 2 up. The whole coordinate frame moves to a new position z1 y1 z0 y0 T(5,0,2) x1 x0
Coordinate Rotation y0 y1 R(y=-35) z0 z1 x1 x0
The Matrix Stack • While drawing a world, you often want to draw with respect to a convenient coordinate frame • The graphics card need only keep track of the current position (current transformation) • If you want to shift to the left, multiply the current frame by a left translation • When done, shift back to the right
The Matrix Stack, FILO T(3,2,5) R(x=35) R(y=15) Programmer’s Next desired Shift of reference frames Current position of Drawing reference frame T(2,1,1) R(z=12) T(15,20,35)
Learning Objectives • Learn how 2D transformations are represented in 3D. • Recognize the inverse matrix for a homogeneous transformation. • Understand how the transformations also represent coordinate frame transformations. • Understand the concept of a matrix stack.