Title: Geometrical Transformations:
1Lecture 7
- Geometrical Transformations
- 2D transformations
- 3D transformations
- Matrix representation
- OpenGL functions
2Rendering Pipeline
3Rendering Pipeline
4Rendering Pipeline
5Rendering Pipeline
6Basic 2D Transformations
7Basic 2D Transformations
8Basic 2D Transformations
9Matrix representation
10Combination of 2D transformations
112x2 matrices
122x2 matrices
132x2 matrices
142x2 matrices
152x2 matrices
- Only rotation, scaling, and shear can be
represented in 2x2 matrix form. - These are linear transformations.
16Linear transformations
172D Translation 3x3 matrix
18Homogeneous coordinates
19Basic 2D transformations in homogeneous
coordinates
20Affine transformations
21Projections
22Matrix compositions
23Matrix compositions
24Matrix compositions
253D transformations
26Basic 3D transformations
27Basic 3D transformations
28OpenGL Matrix Stacks
OpenGL works with stacks of 4x4
matrices glMatrixMode(enum mode) mode GL_MODELV
IEWGL_PROJECTIONGL_TEXTURE Specifies whether
the modelview, projection or texture matrix will
be modified.
29OpenGL Matrix Stacks
glLoadIdentity(void) Clears the currently
modifiable matrix for future transformation
instructions. Typically we call this instruction
before specifying modeling, viewing or projection
transformations.
30OpenGL Matrix Stacks
Manipulating stacks the OpenGL calls to push,
pop, or multiply top of stack glLoadMatrix(void)
glMultMatrix(void) glPushMatrix(void) the
topmost matrix is copied glPopMatrix(void) the
topmost matrix is destroyed All vertices of the
object are multiplied by the matrix.
31OpenGL Matrix Stacks
Manipulating stacks the OpenGL calls to push,
pop, or multiply top of stack glLoadMatrix(const
type m) glMultMatrix(const type m) m1 m5
m9 m13 m2 m6 m10 m14 m3 m7 m11 m15 m4 m8
m12 m16
32OpenGL Matrix Stacks
Manipulating stacks the OpenGL calls to push,
pop, or multiply top of stack glPushMatrix(void)
the topmost matrix is copied glPopMatrix(void)
the topmost matrix is destroyed All vertices of
the object are multiplied by the matrix.
33OpenGL Transformations
glTranslate(TYPE x, TYPE y, TYPE z) Multiplies
the current matrix by a translation
matrix. glRotate(TYPE angle, TYPE x, TYPE y, TYPE
z) Multiplies the current matrix by a rotation
matrix. glScale(TYPE x, TYPE y, TYPE
z) Multiplies the current matrix by a scaling
matrix.
34Summary
- Types of transformations
- linear
- affine
- projective
- Representation of transformations
- 3x3 and 4x4 matrices
- homogeneous coordinates
- Compositions of transformations
- OpenGL Matrix Instructions