ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    HCI & Computer Graphics
    COMP3145
    Progress0 / 73 topics
    Topics
    1. The Human: Input-output channels2. Human memory3. Thinking, Reasoning, Problem solving4. Emotions and Individual differences5. Psychology and design of interacting systems6. The Computer: Text entry devices7. Positioning, Pointing, and drawing devices8. Display devices9. Devices for virtual reality and 3D interaction10. Physical controls, Sensors and special devices11. Paper printing and scanning12. Memory, Processing and networks13. The Interaction: Models of interaction14. Frameworks and HCI15. Ergonomics16. Interaction styles17. Elements of the WIMP interfaces18. Interactivity and Context of interaction19. Usability Paradigm and Principles: Introduction20. Paradigms for interaction21. Interaction Design Basics: What is design22. Process of design and User focus23. Navigation design24. Screen design and layout25. Iteration and prototyping26. HCI in Software Process: Software life cycle27. Usability engineering28. Iterative design and prototyping29. Design rationale30. Design rules and Guidelines31. Golden rules and heuristics32. HCI patterns33. Evaluation techniques and methods34. Task analysis35. Universal design36. User support systems37. Computer Supported Cooperative Work38. Groupware systems39. Implementation of synchronous groupware40. Ubiquitous computing41. History of Computer Graphics42. Graphics architectures and software43. Imaging and vision: Pinhole camera, Human vision, Synthetic camera44. Modeling vs. rendering45. OpenGL Architecture46. Displaying simple two-dimensional geometric objects47. Positioning systems and windowed environment48. Color perception and models49. RGB, CMY, HLS color models50. Color transformations51. Color in OpenGL: RGB and indexed color52. Input: Network environment and client-server computing53. Input measures: event, sample and request input54. Using callbacks and picking55. Affine transformations: translation, rotation, scaling, shear56. Homogeneous coordinates and concatenation57. Current transformation and matrix stacks58. Three Dimensional Graphics: Classical viewing59. Specifying views in 3D60. Affine transformation in 3D61. Projective transformations62. Ray tracing63. Shading: Illumination and surface modeling64. Phong shading model65. Polygon shading66. Rasterization: Line drawing via Bresenham's algorithm67. Clipping and polygonal fill68. BitBlt operations69. Hidden surface removal (z buffer)70. Discrete Techniques: Buffers71. Reading and writing bitmaps and pixel maps72. Texture mapping73. Compositing
    COMP3145›Current transformation and matrix stacks
    HCI & Computer GraphicsTopic 57 of 73

    Current transformation and matrix stacks

    2 minread
    366words
    Beginnerlevel

    1. Current Transformation

    Definition: The current transformation (often called CTM) is the matrix that represents all the transformations currently applied to objects in a graphics scene.

    • It is used to transform object coordinates into world or screen coordinates.
    • Every vertex of an object is multiplied by the CTM before rendering.

    Key Points:

    • The CTM can represent translation, rotation, scaling, shear, or any combination.
    • When you apply a transformation (e.g., rotate, translate), it modifies the CTM, not the object coordinates directly.

    Example:

    • Suppose the CTM is initially the identity matrix.
    • Applying glTranslatef(2, 0, 0) updates the CTM.
    • All subsequent drawing commands will have their vertices translated by (2, 0, 0) automatically.

    2. Matrix Stack

    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:

      1. Push – Save the current CTM onto the stack.
      2. Pop – Restore the last saved CTM from the stack.

    Purpose:

    • Allows local transformations for individual objects without affecting others.
    • Essential for hierarchical modeling (e.g., a robot arm: shoulder → elbow → hand).

    3. How Matrix Stack Works

    Workflow Example:

    1. Start with identity CTM.
    2. Draw a robot body: apply translation and scaling.
    3. Push CTM before transforming the arm.
    4. Apply rotation for the arm and draw it.
    5. Pop CTM to revert to the body’s transformation.
    6. Draw another object using the original body transformation.

    Diagram Conceptually:

    CTM (identity)
       |
       |-- translate body
       |-- scale body
       |-- push CTM
            |-- rotate arm
            |-- draw arm
       |-- pop CTM
       |-- draw other body parts
    

    4. OpenGL Functions for Matrix Stack

    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

    5. Benefits of Using Matrix Stack

    • Simplifies complex hierarchical transformations.
    • Avoids manual calculation of inverse transformations.
    • Provides modularity: local transformations don’t interfere with global ones.

    6. Summary Table

    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
    Previous topic 56
    Homogeneous coordinates and concatenation
    Next topic 58
    Three Dimensional Graphics: Classical viewing

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time2 min
      Word count366
      Code examples0
      DifficultyBeginner