Definition: The current transformation (often called CTM) is the matrix that represents all the transformations currently applied to objects in a graphics scene.
Key Points:
Example:
glTranslatef(2, 0, 0) updates the CTM.Definition: A matrix stack is a stack data structure used to save and restore transformation matrices.
Common in OpenGL to manage hierarchical transformations.
Two main operations:
Purpose:
Workflow Example:
Diagram Conceptually:
CTM (identity)
|
|-- translate body
|-- scale body
|-- push CTM
|-- rotate arm
|-- draw arm
|-- pop CTM
|-- draw other body parts
| Function | Description |
|---|---|
glPushMatrix() |
Saves the current CTM on the stack |
glPopMatrix() |
Restores the last saved CTM from the stack |
glLoadIdentity() |
Resets CTM to identity matrix |
glMultMatrixf() |
Multiplies CTM by a given matrix |
| Concept | Definition | Use |
|---|---|---|
| Current Transformation Matrix (CTM) | Matrix representing all active transformations | Applied to all vertices for rendering |
| Matrix Stack | Stack storing CTMs for save/restore | Supports hierarchical and modular transformations |
Open this section to load past papers