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›Affine transformation in 3D
    HCI & Computer GraphicsTopic 60 of 73

    Affine transformation in 3D

    7 minread
    1,154words
    Intermediatelevel

    1. Definition

    An affine transformation in 3D is a linear mapping that preserves points, straight lines, and planes, and allows translation, scaling, rotation, reflection, and shear of 3D objects.

    • Affine transformations maintain parallelism of lines but not necessarily distances or angles.
    • Represented conveniently using 4×4 matrices with homogeneous coordinates.

    2. Homogeneous Coordinates in 3D

    A 3D point (x,y,z)(x, y, z)(x,y,z) is represented in homogeneous coordinates as:

    P=[x y z 1]P = \begin{bmatrix} x \ y \ z \ 1 \end{bmatrix}P=[x y z 1​]
    • Using 4×4 matrices allows translation to be expressed as matrix multiplication, along with rotation, scaling, and shear.

    3. Types of 3D Affine Transformations

    A. Translation

    Moves a point by a vector (tx,ty,tz)(tx, ty, tz)(tx,ty,tz):

    T=[100tx 010ty 001tz 0001],P′=T⋅PT = \begin{bmatrix} 1 & 0 & 0 & tx \ 0 & 1 & 0 & ty \ 0 & 0 & 1 & tz \ 0 & 0 & 0 & 1 \end{bmatrix}, \quad P' = T \cdot PT=[1​0​0​tx 0​1​0​ty 0​0​1​tz 0​0​0​1​],P′=T⋅P

    B. Scaling

    Scales coordinates along x, y, z axes:

    S=[Sx000 0Sy00 00Sz0 0001],P′=S⋅PS = \begin{bmatrix} Sx & 0 & 0 & 0 \ 0 & Sy & 0 & 0 \ 0 & 0 & Sz & 0 \ 0 & 0 & 0 & 1 \end{bmatrix}, \quad P' = S \cdot PS=[Sx​0​0​0 0​Sy​0​0 0​0​Sz​0 0​0​0​1​],P′=S⋅P
    • Sx,Sy,Sz>1Sx, Sy, Sz > 1Sx,Sy,Sz>1 enlarges, 0<S<10 < S < 10<S<1 shrinks.

    C. Rotation

    Rotation about x, y, or z axes:

    About X-axis (angle θ\thetaθ):

    Rx=[1000 0cos⁡θ−sin⁡θ0 0sin⁡θcos⁡θ0 0001]R_x = \begin{bmatrix} 1 & 0 & 0 & 0 \ 0 & \cos\theta & -\sin\theta & 0 \ 0 & \sin\theta & \cos\theta & 0 \ 0 & 0 & 0 & 1 \end{bmatrix}Rx​=[1​0​0​0 0​cosθ​−sinθ​0 0​sinθ​cosθ​0 0​0​0​1​]

    About Y-axis (angle θ\thetaθ):

    Ry=[cos⁡θ0sin⁡θ0 0100 −sin⁡θ0cos⁡θ0 0001]R_y = \begin{bmatrix} \cos\theta & 0 & \sin\theta & 0 \ 0 & 1 & 0 & 0 \ -\sin\theta & 0 & \cos\theta & 0 \ 0 & 0 & 0 & 1 \end{bmatrix}Ry​=[cosθ​0​sinθ​0 0​1​0​0 −sinθ​0​cosθ​0 0​0​0​1​]

    About Z-axis (angle θ\thetaθ):

    Rz=[cos⁡θ−sin⁡θ00 sin⁡θcos⁡θ00 0010 0001]R_z = \begin{bmatrix} \cos\theta & -\sin\theta & 0 & 0 \ \sin\theta & \cos\theta & 0 & 0 \ 0 & 0 & 1 & 0 \ 0 & 0 & 0 & 1 \end{bmatrix}Rz​=[cosθ​−sinθ​0​0 sinθ​cosθ​0​0 0​0​1​0 0​0​0​1​]

    D. Shear

    Shifts one coordinate proportionally to another:

    Sh=[1ShxyShxz0 Shyx1Shyz0 ShzxShzy10 0001]Sh = \begin{bmatrix} 1 & Sh_{xy} & Sh_{xz} & 0 \ Sh_{yx} & 1 & Sh_{yz} & 0 \ Sh_{zx} & Sh_{zy} & 1 & 0 \ 0 & 0 & 0 & 1 \end{bmatrix}Sh=[1​Shxy​​Shxz​​0 Shyx​​1​Shyz​​0 Shzx​​Shzy​​1​0 0​0​0​1​]

    4. Concatenation of 3D Affine Transformations

    • Multiple transformations can be combined into a single matrix:
    Mfinal=T⋅R⋅S⋅ShM_{final} = T \cdot R \cdot S \cdot ShMfinal​=T⋅R⋅S⋅Sh
    • Apply once to a point/vector:
    P′=Mfinal⋅PP' = M_{final} \cdot PP′=Mfinal​⋅P
    • Order matters (matrix multiplication is not commutative).

    5. Summary Table

    Transformation Matrix Form Effect
    Translation 4×4 matrix with last column (tx,ty,tz,1)(tx, ty, tz, 1)(tx,ty,tz,1) Move object in space
    Scaling Diagonal 4×4 matrix Resize object along axes
    Rotation 4×4 matrix (Rx,Ry,Rz)(R_x, R_y, R_z)(Rx​,Ry​,Rz​) Rotate object about axes
    Shear Off-diagonal elements Skew object along axes

    Key Points:

    • Affine transformations in 3D preserve straight lines and parallelism.
    • Using homogeneous coordinates, translation, rotation, scaling, and shear can all be represented as matrix multiplication.
    • Essential for 3D modeling, animation, and graphics pipelines.
    Previous topic 59
    Specifying views in 3D
    Next topic 61
    Projective transformations

    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 time7 min
      Word count1,154
      Code examples0
      DifficultyIntermediate