220 likes | 326 Views
Graphics Programming: Transformations. Transformation (Isometry). Translations Rotations Scaling Mirror. Transformations. One example of a transformation is the window to viewport transformation.
E N D
Transformation (Isometry) • Translations • Rotations • Scaling • Mirror
Transformations • One example of a transformation is the window to viewport transformation. • Here we have seen an image in the world window scaled and translated (moved) into a viewport window. • We can build on this transformation to allow us to move objects to more complex locations.
Transformations • A Transformation consists of: • a Rotation • a Scaling and • a Translation • a Shearing • They occur in 2D and 3D
Transformations • Transformations allow for: • scene composition
Transformations • Transformations allow for: • easily create symmetrical objects
Transformations • Transformations allow for: • viewing objects at different angles • computer animation where several objects need to move relative to one another
Transforming Points • A transformation simply takes a point and maps it to another location.
Transforming Points • In the 2D case this means…. • Q = M(P) • where M is some mapping matrix Q P
Matrices : Multiplication 2x - y + 2z = 1 x + 2y - 4z = 3 3x - y + z = 0
Matrices :Identity Matrix 2 3 4 4 7 5 5 2 8 1 0 0 0 1 0 0 0 1 2 3 4 4 7 5 5 2 8 x =
Further Reading See Rowe – Chapter 2 for a discussion on homogenous coordinates and further examples of matrix transformations. Also see discussions and technical articles on: www.gamedeveloper.com www.gamedev.net www.ddj.com Dr. Dobb’s Journal - been around since 1976