Computer Graphics · 2D Transformations and Viewing
Composite Transformations and Coordinate Systems
Overview
A composite transformation combines several elementary 2D transformations into one matrix, so an object can be translated, rotated, scaled, reflected or sheared in a chosen order.
The same ideas explain coordinate systems: model/object, world, viewing, normalized device and physical device coordinates.
UGC NET tests this area through arbitrary-pivot rotations, matrix order, homogeneous coordinates, window-to-viewport mapping, and identification of a matrix from before/after figures.
Before reading, know basic matrix multiplication, the trigonometric values at , and the representation of a point as .
Unless stated otherwise, the notes use column vectors and counterclockwise positive angles in the standard right-handed -plane with right and up.
Key concepts
- A transformation matrix maps a point to a new point. In homogeneous column-vector form, a 2D point is and every affine transformation is a matrix.
- Composite transformation: if transformation is applied first and second, then . Thus the composite matrix is ; the rightmost matrix acts first.
- Composite transformations are generally non-commutative: translation then rotation is not the same as rotation then translation.
- Homogeneous coordinates allow translation to be represented as matrix multiplication: . A general 2D homogeneous point is ; finite Cartesian point is , and represents a point at infinity or direction.
- An affine transformation has matrix
.
Its last row is . Translation, rotation, scaling, reflection and shear are affine. - A homography or projective transformation is a general homogeneous matrix with a bottom row not necessarily .
It maps lines to lines but need not preserve parallelism. “Steganography” is data hiding, not a graphics transformation. - Rotation about an arbitrary pivot is done by: translate pivot to origin, rotate about origin, translate pivot back. In column-vector form:
. - Scaling about a fixed point is similarly:
. - Model/object/local coordinates describe one object. A modeling transformation places it in world coordinates, the common scene coordinate system.
- A viewing transformation maps world coordinates to viewing or normalized coordinates; in UGC/NET convention it maps world coordinates to Normalized Device Coordinates (NDC), not directly to physical screen pixels.
- A window is the rectangular region selected in world coordinates. A viewport is the rectangular display area, usually in NDC or device coordinates, where the window is mapped.
- Normalization transformation is the window-to-viewport mapping. A workstation transformation or device transformation maps NDC to actual physical device/screen pixels.
- Aspect ratio is width divided by height. If window and viewport aspect ratios are equal, the mapping is uniform; otherwise the image is stretched.
- A reflection matrix has determinant , so it is not a rotation matrix. A rotation matrix has determinant .
How it works
- Convert every point to homogeneous column form: .
- Write each elementary transformation as a matrix.
- Decide the order of transformations. For column vectors, if acts first, then , then , the composite is
. - Apply the composite to a point: .
- For rotation about pivot : translate by , rotate by , translate by .
So . - For scaling about fixed point : translate by , scale by , translate by .
So . - For window-to-viewport mapping: scale the window size to the viewport size, then translate the window lower-left corner to the viewport lower-left corner.
. - Coordinate pipeline: model coordinates are transformed to world coordinates; the world window is mapped to a viewport in NDC; NDC is mapped to physical device coordinates.
For matrix order, remember:
Drawing the diagram…
Drawing the diagram…
Formulas
-
Let be counterclockwise rotation, translation, scale factors, and the fixed pivot.
-
Homogeneous point:
-
Translation:
-
Rotation about origin:
-
Scaling about origin:
-
Composite rule for column vectors: if is first and is last,
-
Inverse: if , then
-
Rotation about pivot :
-
Scaling about fixed point :
-
Reflection matrices:
-
About -axis: .
-
About -axis: .
-
About origin: .
-
About line : .
-
Shear:
-
-shear by : .
-
-shear by : .
-
-shear relative to line :
-
Window-to-viewport mapping:
-
Homography in 2D:
-
If , the point is at infinity.
-
Aspect ratio:
Worked examples
Example 1: rotation about an arbitrary point. Rotate by counterclockwise about .
Translate pivot to origin:
Rotate : , so .
Translate back: .
Matrix check:
Answer: .
Example 2: composite order. A point is scaled by about the origin, then translated by .
Scale first: .
Translate second: .
Composite matrix:
Answer: . If the order were reversed, the result would be , so order matters.
Example 3: find the affine matrix from point correspondences. A transformation maps , , . Find its homogeneous matrix.
Let
From : .
From : , and .
From : , and .
Thus
Answer: the matrix is .
Example 4: window-to-viewport mapping. Map window lower-left , upper-right onto viewport lower-left , upper-right . Find the matrix and map point .
For : Answer: .
Example 5: statement type. Statement I: In column-vector notation, the rightmost matrix in a product acts first. Statement II: Reflection about the -axis is a rotation matrix because its determinant is .
Statement I is true: applies first. Statement II is false: a rotation matrix has determinant ; reflection has determinant .
Answer: only Statement I is true.
Comparison
| Transformation | Coordinate rule | Determinant | Exam note |
|---|---|---|---|
| Translation | Needs homogeneous matrix; translation is in third column | ||
| Rotation about origin | Positive angle is CCW; preserves shape and size | ||
| Scaling about origin | Negative factor also reflects | ||
| Reflection about -axis | Not a rotation | ||
| -shear | Shifts parallel to proportional to | ||
| -shear | Shifts parallel to proportional to |
| Coordinate system | Purpose | Main transform to next stage |
|---|---|---|
| Model/object/local | Defines one object | Modeling transformation to world |
| World | Common scene coordinates | Viewing transformation to viewing/NDC |
| Viewing/camera/eye | Coordinates relative to camera | Projection/normalization to NDC |
| Normalized device coordinates, NDC | Device-independent display coordinates | Workstation/device transformation to physical device |
| Physical device | Actual screen or workstation pixels | Final display |
| Look-alike pair | Difference |
|---|---|
| Window vs viewport | Window is in world coordinates; viewport is the display area where the window is mapped |
| Viewing transformation vs workstation transformation | Viewing maps world to viewing/NDC; workstation maps NDC to physical device |
| Object transformation vs coordinate transformation | Object transformation moves the object; coordinate transformation changes the reference frame and is usually the inverse |
| Affine vs homography | Affine has bottom row ; homography has a general bottom row and may send parallel lines to intersecting lines |
| Rotation vs reflection | Rotation determinant ; reflection determinant |
Revision summary
- Column-vector rule: ; the rightmost matrix acts first.
- If then , composite is , not .
- Translate pivot to origin, apply transformation, translate back.
- Translation cannot be represented by a matrix; use homogeneous .
- Rotation about pivot: .
- Scaling about fixed point: .
- Homogeneous point gives Cartesian ; is a point at infinity.
- General homogeneous matrix is a homography; bottom row means affine.
- Window is in world coordinates; viewport is in NDC/device coordinates.
- Window-to-viewport: scale by viewport size divided by window size, then translate.
- Aspect ratio is width/height; equal aspect ratios avoid distortion.
- Reflection has determinant ; rotation has determinant .
Previous-year exam insights
- Arbitrary-pivot rotation is asked directly: identify the sequence translate to origin, rotate, translate back, and apply it numerically.
- Matrix matching questions give matrices and transformation diagrams; check the third column for translation and the diagonal/off-diagonal entries for scale, rotation, reflection or shear.
- Numeric composite questions test order: with column vectors the rightmost matrix acts first; reversing order changes the answer.
- Affine-matrix construction questions give before/after vertices; solve from the origin image, then from the -unit image and from the -unit image.
- Window-to-viewport questions ask for the normalization matrix or the mapped point; compute first, then .
- Coordinate-system questions test definitions: viewing transformation maps to NDC, not directly to physical device; workstation/device transformation maps NDC to screen pixels.
- Homogeneous-coordinate traps: is not a finite point; a general projective matrix is a homography, while affine is a special case.
- Statement/assertion traps: composite translations remain translations; composite rotations about the same origin remain rotations; reflection is not rotation; inverse reverses order.
Practice at PARIKSHA
You are ready for the PARIKSHA tests of this sub-topic when you can:
- write the homogeneous matrices for translation, rotation, scaling, reflection and shear;
- derive and apply the composite matrix for rotation about an arbitrary pivot;
- derive and apply the composite matrix for scaling about a fixed point;
- decide the order of transformations from a matrix product and from a word problem;
- construct an affine matrix from three point correspondences;
- compute a window-to-viewport matrix and map a given point correctly;
- explain model, world, viewing, NDC and physical device coordinates in order;
- distinguish affine from homography and identify points at infinity using ;
- state the inverse of a composite transformation with the order reversed;
- identify a transformation matrix from a before/after figure or a diagram.
Attempt the PARIKSHA sub-topic test first; then attempt the subject test.