7 3d Graphics And Projections

Computer Graphics · Unit 7

3D Graphics and Projections

Exam-focused notes for 3D Graphics and Projections (Computer Graphics, BIT304): what the TU syllabus asks and how it has actually been tested, with 5 solved past questions from this unit.

3D Graphics and Projections in short

To show a 3D object on a flat screen we must first describe it in 3D and then project it onto a 2D plane. This chapter covers 3D coordinates, the two kinds of projection, and how 3D objects are stored.

3D Graphics and Projections: notes

3D coordinate systems

A 3D point needs three values $(x, y, z)$. There are two common systems:

  • Right-handed system: point the fingers of the right hand along $+x$ and curl them to $+y$. The thumb points along $+z$. Most maths books and OpenGL use this.
  • Left-handed system: the same with the left hand. Here $+z$ goes into the screen, away from the viewer. Some graphics systems use it.

Coordinate systems used in 3D graphics:

  • Modeling coordinates: for each object alone.
  • World coordinates: one common space for the whole scene.
  • Viewing coordinates: based on the camera position and direction.
  • Projection and screen coordinates: the 2D result.

Positive rotation is counterclockwise when looking from the positive end of an axis towards the origin (right-handed system). 3D transformations use $4 \times 4$ matrices with homogeneous coordinates $(x,y,z,1)$.

$$T = \begin{bmatrix} 1 & 0 & 0 & t_x \ 0 & 1 & 0 & t_y \ 0 & 0 & 1 & t_z \ 0 & 0 & 0 & 1 \end{bmatrix}$$

Parallel projection

In a parallel projection the lines from every point (projectors) are parallel to each other, and they meet the projection plane. The size of an object does not change with its distance. Parallel lines stay parallel, and real proportions are kept, so it is used in engineering drawings.

Types:

  • Orthographic: projectors are perpendicular to the plane. Front, top and side views are orthographic. Projection onto the plane $z = 0$ is simply $x_p = x$, $y_p = y$.
  • Axonometric (isometric): an orthographic view of a rotated object, so that three faces are seen at once. In isometric all three axes are foreshortened equally.
  • Oblique: projectors are not perpendicular to the plane. Two kinds:
    • Cavalier: depth lines are drawn at 45 degrees with full length. It looks stretched in depth.
    • Cabinet: depth lines are drawn at half length, which looks more natural.

For an oblique projection onto $z = 0$ with depth-line angle $\phi$ and depth factor $L$ (1 for cavalier, 0.5 for cabinet):

$$x_p = x + L,z\cos\phi, \qquad y_p = y + L,z\sin\phi$$

Example: cabinet projection with $\phi = 45^\circ$ of the point $(2,3,4)$. Here $L = 0.5$ and $\cos 45^\circ = \sin 45^\circ = 0.707$:

$$\begin{aligned} x_p &= 2 + 0.5(4)(0.707) = 3.41 \ y_p &= 3 + 0.5(4)(0.707) = 4.41 \end{aligned}$$

What this unit covers

  • 3D coordinate systems
  • Parallel projection
  • Perspective projection
  • Projection coordinate calculations
  • Wireframe representation of 3D objects
  • 3D object representations and storage

3D object representations and storage

2081 · 5 marks

How the geometric and attribute information of a 3D objects are stored for the object representations? Explain with suitable example. [5]

3D objects are represented in computer graphics by storing two fundamental types of information: 1. Geometric Information - shape and spatial structure 2. Attribute Information - visual and material properties --- Geometric data defines the shape and position of 3D objects: a) Vertex Data - Coord...

Open this answer on its own page →

Parallel projection

2080 · 10 marks

Differentiate between parallel and perspective projection. Perform the rotation of triangle with vertices A(5,7), B(12,85) and C(5,3) counterclockwise 30 degree about the pivot point (5,3).[10]

Show solved answer

Model Answer: Parallel vs Perspective Projection and Triangle Rotation

Part 1: Parallel vs Perspective Projection

AspectParallel ProjectionPerspective Projection
ProjectorsProjection lines (projectors) are parallel to each otherProjectors converge to a single point (center of projection)
Center of projectionAt infinityAt a finite distance
Vanishing pointNone; parallel lines remain parallelOne or more vanishing points; parallel lines converge
Depth realismDoes not depict realistic depth; size independent of distanceRealistic depth; distant objects appear smaller (foreshortening)
Scale/proportionTrue dimensions and proportions preservedScale varies with distance from viewpoint
MathematicsSimpler (orthographic/oblique matrices, no division)More complex; requires division by the depth coordinate
ApplicationsEngineering/technical drawings, CAD, blueprintsRealistic rendering, architecture, games, photography

Part 2: Rotation of Triangle 30° CCW about Pivot (5,3)

Given data:

  • Vertices: $A(5,7)$, $B(12,85)$, $C(5,3)$
  • Angle: $\theta = 30^\circ$ counterclockwise
  • Pivot: $P(p_x,p_y) = (5,3)$

Rotation about a pivot: $$x' = p_x + (x-p_x)\cos\theta - (y-p_y)\sin\theta$$ $$y' = p_y + (x-p_x)\sin\theta + (y-p_y)\cos\theta$$

Trig values: $\cos 30^\circ = 0.8660$, $\sin 30^\circ = 0.5$

Vertex A(5,7): $\Delta x = 0,\ \Delta y = 4$ $$x'_A = 5 + (0)(0.866) - (4)(0.5) = 5 - 2 = 3$$ $$y'_A = 3 + (0)(0.5) + (4)(0.866) = 3 + 3.464 = 6.464$$ $$A' = (3,\ 6.464)$$

Vertex B(12,85): $\Delta x = 7,\ \Delta y = 82$ $$x'_B = 5 + (7)(0.866) - (82)(0.5) = 5 + 6.062 - 41 = -29.938$$ $$y'_B = 3 + (7)(0.5) + (82)(0.866) = 3 + 3.5 + 71.012 = 77.512$$ $$B' = (-29.938,\ 77.512)$$

Vertex C(5,3): $\Delta x = 0,\ \Delta y = 0$ (this is the pivot) $$x'_C = 5 + 0 - 0 = 5,\quad y'_C = 3 + 0 + 0 = 3$$ $$C' = (5,\ 3)$$

Final Result:

  • $A' \approx (3.00,\ 6.46)$
  • $B' \approx (-29.94,\ 77.51)$
  • $C' = (5,\ 3)$

(Note: vertex B(12,85) appears unusually large for a triangle, but the computation follows the given data exactly.)

Open this answer on its own page →

0 · 5 marks

Differentiate between parallel and perspective projection. [5]

Definition: Parallel projection is a projection technique where all projection lines are parallel to each other and perpendicular (or at a fixed angle) to the projection plane. Key Characteristics: - Projection lines remain parallel throughout - No vanishing point exists - All parallel lines in t...

Open this answer on its own page →

Wireframe representation of 3D objects

2080 · 5 marks

Explain the wireframe representation of 3D objects. [5]

Wireframe representation is a method of displaying 3D objects using only edges and vertices, without rendering surfaces or faces. The object appears as a skeleton made of lines connecting corner points in 3D space. 1. Structure - Consists of vertices (corner points) connected by edges (lines) - N...

Open this answer on its own page →

Projection coordinate calculations

0 · 10 marks

Obtain perspective projection co-ordinates for the pyramid with vertices of base (15, 15, 10), (20, 20, 10), (25, 15, 10), (20, 10, 10) and apex (20, 15, 2), given that Zprp = 20 and Zvp = 0.[10]

  • Base vertices: - $V1(15, 15, 10)$ - $V2(20, 20, 10)$ - $V3(25, 15, 10)$ - $V4(20, 10, 10)$ - Apex: $V5(20, 15, 2)$ - Center of projection: $Z{prp} = 20$ - View plane: $Z{vp} = 0$ For a center of projection on the z-axis at $z = Z{prp}$ and view plane at $z = Z{vp}$, the perspective projection m...
Open this answer on its own page →