Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

2.8 3D Transformation Matrices (Forms)

Lesson 17 of 32 in the free Computer Graphics notes on Siksha Sarovar, written by Rohit Jangra.

Step Up to 4x4

3D points become (x, y, z, 1) and transformations are 4x4 matrices in homogeneous coordinates.

Translation T(tx, ty, tz)

[ 1 0 0 tx ] [ 0 1 0 ty ] [ 0 0 1 tz ] [ 0 0 0 1 ]

Scaling S(sx, sy, sz) about origin

[ sx 0 0 0 ] [ 0 sy 0 0 ] [ 0 0 sz 0 ] [ 0 0 0 1 ]

Rotation about X-axis Rx(theta)

[ 1 0 0 0 ] [ 0 cos -sin 0 ] [ 0 sin cos 0 ] [ 0 0 0 1 ]

Rotation about Y-axis Ry(theta)

[ cos 0 sin 0 ] [ 0 1 0 0 ] [ -sin 0 cos 0 ] [ 0 0 0 1 ]

(Sign of sin matches right-handed coordinate system, looking down +Y.)

Rotation about Z-axis Rz(theta)

[ cos -sin 0 0 ] [ sin cos 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ]

Rotation about Arbitrary Axis

Compose: align axis with a coordinate axis (typically Z), rotate, then undo the alignment. M = T(p) R_align^-1 Rz(theta) R_align T(-p), where p is a point on the axis.

Reflection (about coordinate planes)

  • About XY plane: scale Z by -1.
  • About YZ plane: scale X by -1.
  • About XZ plane: scale Y by -1.

Shear (about XY plane)

[ 1 0 shx 0 ] [ 0 1 shy 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ]

Sample Composition: Model Matrix for an Object

M_model = T_world R_orientation S_scale. Apply to a vertex: v' = M_model * v.

Right-Handed vs Left-Handed

OpenGL/GLM and most math books use right-handed coordinates; DirectX uses left-handed by default. The rotation matrices change sign on sin to account for the handedness.

Composition Rules Are Identical

Order, associativity, and inverse rules from 2D apply unchanged. Real engines store the camera as view = inverse(camera world transform) because moving the camera right is equivalent to moving the world left.