Title: Chapter 5: Transforming Objects
1Chapter 5 Transforming Objects
- 5.2 Introduction to Transformations
- Affine transformations are useful
- Compose scene from instances
- Exploit and repeat symmetries
- Different viewpoints of same scene (move camera)
- Computer animation
- Graphics pipeline and current transformation (CT)
- Object transformation vs coordinate
transformation
2Chapter 5 Transforming Objects
- 5.2.1 Transforming Points and Objects
- Map point P to image Q
- Most mappings continuous
- Restrict ourselves to affine (linear)
transformations. - 5.2.2 The Affine Transformations
- and similarly for vectors.
3Chapter 5 Transforming Objects
- 5.2.3 Geometric Effects of Elementary 2D Affine
Transformations - Combinations of Translation, scaling, rotation,
shear. - Translation
- Or, Q P d
- Scaling
- scaling about the origin
- negative reflection
- uniform vs differential scaling
4Chapter 5 Transforming Objects
5Chapter 5 Transforming Objects
- 5.2.4 Inverse of an Affine Transformation
- Most affine transformations are nonsingular (ie
det(M) is nonzero) - To undo transformation Q MP, use P M-1Q.
- Scaling
- Rotation
- Shearing
- Translation
6Chapter 5 Transforming Objects
- 5.2.5 Composing Affine Transformations
- For homogeneous coordinates Affine
transformations composed by matrix multiplication
in reverse order. - 5.2.6 Examples Composing 2D Transformations
- Rotate about an arbitrary point translate,
rotate, translate - Reflections about a tilted line
7Chapter 5 Transforming Objects
- 5.2.7 Useful Properties of Affine Transformations
- AT preserve affine combinations of
pointsT(a1P1a2P2) a1T(P1) a2T(P2) - AT preserve lines and planes If L(t)(1-t)AtB,
thenQ(t) (1-t)T(A) tT(B) - Parallelism of lines and planes is preserved
Given Abt, we have M(Abt)MA (Mb)t.
Independent of A, with same direction b. - Columns of matrix reveal transformed coordinate
frame - m1Mi, m2Mj
- Frame (i,j,?) transforms into frame (m1,m2,m3)
8Chapter 5 Transforming Objects
- Relative ratios are preserved
- Effects of transformations on areasdet M
- Every AT is composed of elementary operations
- 2Dany M can be written as (translation)(shear)(sc
ale)(rotation) - 3Dany M as (transl)(scale)(rotation)(shear1)(shea
r2)
9Chapter 5 Transforming Objects
- 5.3 3D Affine Transformations
- 5.3.1 Elementary 3D Transformations
- As for 2D. Selfstudy pp. 234-238.Note
rotations x-roll, y-roll, z-roll. - 5.3.2 Composing 3D Affine Transformations
- As for 2D. Selfstudy p. 238.
- 5.3.3 Combining rotations
- 3D rotation matrices do not commute!
- M Rz(ß3)Ry(ß2)Rx(ß1) Eulers angles
10Chapter 5 Transforming Objects
- Rotations about arbitrary axis
- Any rotation about a point is equivalent to a
single rotation about some axis through the point
(Eulers theorem). - Ru(ß) Ry(-?)Rz(?)Rx(ß)Rz(?)Ry(?)
- OpenGL glRotated (angle, ux, uy, uz)
11Chapter 5 Transforming Objects
- Finding axis and angle of rotation Read.
- 5.4 Changing Coordinate Systems
- (a,b,1)T M(c,d,1)T
- Successive changes in coordinate frame (a,b,1)T
M1(c,d,1)T M1M2(e,f,1)T - Note to transform points, premultiply.To
transform coordinate system, postmultiply. - OpenGL postmultiply by default.
12Chapter 5 Transforming Objects
- Finding axis and angle of rotation Read.
- 5.5 Affine Transformations in a Program
- Selfstudy.
- 5.6 Drawing 3D Scenes with OpenGL
- Selfstudy. Note modelview matrix,
- projection matrix,
- viewport matrix.
13Chapter 5 Transforming Objects
- Homework Task 4
- Practice Exercise 5.2.6, p. 223.
- Practice Exercise 5.2.21, pp. 228.
- Practice Exercise 5.3.9, p. 243.
- Practice Exercise 5.5.3, p. 258.
- Practice Exercise 5.6.1, p. 264.
- Practice Exercise 5.8.10, p. 283.