Three dimensional transformations and projections — Unit 3 Notes (Computer Graphics and Multimedia)

BCS604 · Unit 3

Three dimensional transformations and projections notes — Unit 3

Free unit-wise study notes on three dimensional transformations and projections for Computer Graphics and Multimedia, Semester 6 of B.Tech — Computer Science & Engineering — key concepts, examples, important questions and a revision checklist for semester exams.

Three dimensional transformations and projections

Notebook — 14 pages

Page 1

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

1. 3D Coordinate Systems

Moving from 2D graphics to 3D graphics introduces the Z-axis (depth).

1.1 Right-Hand vs Left-Hand Systems

Most computer graphics systems (including OpenGL) use a Right-Handed Cartesian coordinate system. If you point your right thumb along the positive X-axis and your index finger along the positive Y-axis, your middle finger will point along the positive Z-axis (coming directly out of the screen towards you).

In a left-handed system (like DirectX), the positive Z-axis goes into the screen.

Next — 3D Translation

1 of 14

Page 2

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

2. 3D Translation and Scaling

To maintain the ability to combine transformations using matrix multiplication, 3D systems use 4D Homogeneous Coordinates. A point is represented as a 1x4 matrix `[x, y, z, 1]`, and transformation matrices are 4x4.

2.1 Translation

We add translation distances `tx`, `ty`, and `tz`.

2.2 Scaling

We multiply by scaling factors `sx`, `sy`, and `sz`. As in 2D, scaling is performed relative to the origin. If you want to scale an object without moving its position in space, you must translate it to the origin, scale it, and translate it back.

Next — 3D Rotation

2 of 14

Page 3

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

3. 3D Rotation

In 2D, rotation only happens around a single point. In 3D, rotation must be defined relative to an axis (a line) in space.

3.1 The Principal Axes

  • Z-Axis Rotation: Identical to standard 2D rotation. The X and Y coordinates change; the Z coordinate is untouched.
  • X-Axis Rotation: The Y and Z coordinates change; the X coordinate is untouched.
  • Y-Axis Rotation: The Z and X coordinates change; the Y coordinate is untouched.

By convention, positive rotation angles produce counter-clockwise rotations when looking down the positive half of the axis toward the origin.

Next — Rotation Arbitrary Axis

3 of 14

Page 4

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

4. Rotation About an Arbitrary Axis

What if you want to rotate a 3D object around a diagonal line floating in space?

4.1 The Five-Step Process

We must use composite transformations to temporarily align the arbitrary axis with one of the standard coordinate axes (X, Y, or Z).

  • 1. Translate the object so the arbitrary rotation axis passes through the origin.
  • 2. Rotate the object so the arbitrary axis aligns perfectly with the Z-axis.
  • 3. Perform the desired rotation of angle θ around the Z-axis.
  • 4. Apply the inverse of Step 2 to un-align the axis.
  • 5. Apply the inverse of Step 1 to translate the object back to its original location.

Next — Projections Overview

4 of 14

Page 5

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

5. Projections Overview

Computer monitors are flat 2D grids. We cannot display 3D coordinates directly. We must project the 3D world onto a 2D viewing plane.

5.1 Definition

A projection maps a point `(x, y, z)` in 3D space to a point `(xp, yp)` on the 2D projection plane. This mapping is defined by the Center of Projection (COP).

5.2 The Two Classes

If the Center of Projection is located at an infinite distance from the viewing plane, all projection rays are parallel, yielding a Parallel Projection. If the COP is at a finite distance, all rays converge to that point, yielding a Perspective Projection.

Next — Parallel Projections

5 of 14

Page 6

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

6. Parallel Projections

Parallel projections discard depth information (Z-coordinates) when calculating the final 2D X and Y position. As a result, objects retain their exact size regardless of how far away they are.

6.1 Applications

Because parallel projections preserve exact dimensions and parallel lines, they are heavily used in engineering, architecture (blueprints), and CAD software where accurate measurements are more important than visual realism.

Next — Types of Parallel Projections

6 of 14

Page 7

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

7. Orthographic and Oblique Projections

7.1 Orthographic Projection

The projection rays are perfectly perpendicular (orthogonal) to the projection plane. The classic top, front, and side views in an engineering drawing are orthographic projections.

7.2 Oblique Projection

The projection rays intersect the projection plane at an oblique angle (not 90 degrees).

  • Cavalier Projection: Rays hit at 45 degrees. Lines perpendicular to the projection plane are drawn at their true length.
  • Cabinet Projection: Rays hit at ~63.4 degrees. Lines perpendicular to the projection plane are drawn at half their true length. Looks more realistic than Cavalier.

Next — Perspective Projections

7 of 14

Page 8

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

8. Perspective Projections

Perspective projections mimic human vision. The projection rays are not parallel; they converge at a single point (the viewer's eye or a virtual camera).

8.1 Foreshortening

The primary characteristic of perspective projection. The further an object is from the projection plane, the smaller it appears. This creates a powerful illusion of depth, making it the standard for video games and movies.

8.2 The Trade-off

Unlike parallel projections, perspective projections do not preserve exact dimensions, and parallel lines in 3D space will not remain parallel on the 2D screen.

Next — Vanishing Points

8 of 14

Page 9

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

9. Vanishing Points

In perspective projection, any set of parallel lines in the 3D scene (that are not parallel to the viewing plane) will appear to converge to a single point on the 2D screen. This point is called a Vanishing Point.

9.1 Principal Vanishing Points

A 3D cube has three sets of parallel lines (aligned with the X, Y, and Z axes). Depending on how the cube is oriented relative to the viewing plane, it will have 1, 2, or 3 principal vanishing points.

Next — Types of Perspective

9 of 14

Page 10

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

10. One, Two, and Three-Point Perspective

  • One-Point Perspective: The projection plane is perfectly parallel to two axes of the object. (e.g., looking straight down a long hallway). There is only one vanishing point.
  • Two-Point Perspective: The projection plane is parallel to only one axis (usually the vertical Y-axis). Commonly used in architectural drawings showing the corner of a building, with horizontal lines receding to the left and right.
  • Three-Point Perspective: The projection plane is not parallel to any of the object's axes. Used for dramatic shots, like looking down at a skyscraper from an airplane.

Next — The View Volume

10 of 14

Page 11

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

11. The View Volume (Frustum)

In 3D graphics, we do not want to render objects that are behind the camera, nor objects that are extremely far away. We define a 3D clipping region called the View Volume.

11.1 Perspective Frustum

In perspective projection, the view volume takes the shape of a truncated pyramid (a Frustum). It is bounded by six planes: the near clipping plane, the far clipping plane, and the top, bottom, left, and right planes.

Any polygon that falls entirely outside this frustum is instantly discarded by the clipping algorithm.

Next — Normalization

11 of 14

Page 12

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

12. Normalization Transformation

Clipping mathematically against the angled walls of a perspective frustum is computationally expensive.

12.1 The Canonical View Volume

To speed up hardware processing, graphics pipelines apply a 'Normalization Transformation' to the 3D world before clipping. This matrix transformation warps the perspective frustum (the pyramid shape) into a perfect 2x2x2 cube centered at the origin (from -1 to 1 on all axes).

This process forces the foreshortening effect into the XYZ coordinates themselves. Clipping against a perfect cube is vastly faster.

Next — 3D Clipping

12 of 14

Page 13

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

13. 3D Clipping Algorithms

Once the world is normalized into the Canonical View Volume, 3D clipping is very similar to 2D clipping.

13.1 3D Cohen-Sutherland

The 2D Cohen-Sutherland region code was 4 bits (Top, Bottom, Right, Left). The 3D extension adds two more bits: Front and Back, making a 6-bit region code.

The algorithm tests the endpoints of a 3D line against these 6 bits. Trivial accepts (000000) and trivial rejects (bitwise AND != 0) work exactly the same way as in 2D.

Next — Viewports in 3D

13 of 14

Page 14

Wink Notes

B.Tech CSE — 6th Semester

Computer Graphics and Multimedia

Unit - 3

14. Mapping to the Screen

The final step in the geometry pipeline.

14.1 The Viewport Transformation

After clipping, the 3D coordinates (which are now in the normalized range of -1 to +1) must be mapped to physical pixel coordinates on the user's screen (e.g., a window that is 1920x1080 pixels).

The X and Y coordinates are mapped to the 2D screen. The Z coordinate (depth) is scaled and stored in the Z-Buffer for use in the Hidden Surface Removal phase, which occurs during rasterization.

14 of 14

Continue in this subject