---
title: "3D rotation steps and perspective projection"
subject: "Computer Graphics"
chapter: 4
key: "semester_5/computer_graphics:rotate-3d-arbitrary-axis-perspective"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/rotate-3d-arbitrary-axis-perspective
site: BCT Engineering
---

# 3D rotation steps and perspective projection

Computer Graphics · Chapter 4: Three-Dimensional Graphics

- Asked in: 2081 Chaitra (new course), 5 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/rotate-3d-arbitrary-axis-perspective
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-4

## Question

Write the steps required to rotate an object in 3D about arbitrary axis. Explain about the perspective projection.

## Short answer

For arbitrary axis rotation: translate to origin, rotate about x-axis by α to put axis in xz-plane, rotate about y by β to align with z, rotate by θ about z, then reverse Ry and Rx and translate back. Perspective projection: projectors converge at COP; distant objects appear smaller. With COP (0,0,zprp) and view plane z=zvp, xp = x·dp/(zprp−z), yp = y·dp/(zprp−z), dp = zprp−zvp.

## Answer

#### Steps to rotate about an arbitrary axis

Let the axis pass through P1(x1, y1, z1) and P2(x2, y2, z2). Unit vector u = (a, b, c) = (P2 − P1)/|P2 − P1|, d = √(b² + c²).

1. Translate P1 to the origin: T(−x1, −y1, −z1).
2. Rotate about the x-axis by α (cosα = c/d, sinα = b/d) so the axis lies in the xz plane.
3. Rotate about the y-axis by β (cosβ = d, sinβ = a) so the axis coincides with the z-axis.
4. Rotate about the z-axis by the required angle θ.
5. Apply the inverse rotations in reverse order: Ry(−β), then Rx(−α).
6. Translate back: T(x1, y1, z1).

M = T(P1) · Rx(−α) · Ry(−β) · Rz(θ) · Ry(β) · Rx(α) · T(−P1)

#### Perspective projection

**Perspective projection** projects 3D points onto a view plane along lines that meet at the centre of projection (COP). Distant objects appear smaller, which gives a realistic picture.

With the COP at (0, 0, zprp) and the view plane at z = zvp, dp = zprp − zvp:

xp = x·dp/(zprp − z), yp = y·dp/(zprp − z), zp = zvp

```text
| 1 0  0        0           |
| 0 1  0        0           |
| 0 0 -zvp/dp   zvp·zprp/dp |
| 0 0 -1/dp     zprp/dp     |
```

The result is divided by the homogeneous factor h = (zprp − z)/dp.

Features:
- Parallel lines that are not parallel to the view plane converge at vanishing points.
- Types: one-point, two-point and three-point perspective.
- Size is not preserved, so it is not used for measurements.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. The first step in rotating about an arbitrary axis is:
   A. Translate P1 to the origin
   B. Rotate about y by β
   C. Apply Rz(θ)
   D. Project onto the view plane
   Answer: A. The axis is moved so it passes through the origin before aligning with an axis. (Key point: First step)

2. Perspective projection projects points along lines that:
   A. Are parallel to each other
   B. Meet at the centre of projection
   C. Are perpendicular to the view plane
   D. Are parallel to the z-axis only
   Answer: B. Converging projectors make distant objects look smaller. (Key point: Perspective definition)

3. Which is a feature of perspective projection?
   A. Sizes and angles are preserved
   B. Distant objects look larger
   C. Parallel lines not parallel to the view plane converge at vanishing points
   D. It is best for measurements
   Answer: C. Vanishing points and foreshortening give realism but destroy true measurements. (Key point: Features)

## Related in Computer Graphics

- [3D rotation about arbitrary axis](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotate-3d-arbitrary-axis-steps) — Computer Graphics, chapter 4, asked 2×
- [Rotate object about axis y=4](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotate-object-about-y-4) — Computer Graphics, chapter 4
- [3D rotation about axis (1,2,3)-(10,20,30)](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotate-3d-axis-1-2-3) — Computer Graphics, chapter 4
- [Derive perspective projection matrix](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aperspective-projection-matrix-derive) — Computer Graphics, chapter 4, asked 3×
- [Need of perspective projection](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Awhy-perspective-projection-world-to-viewing) — Computer Graphics, chapter 4
- [Perspective projection of pyramid](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aperspective-pyramid-zprp-20) — Computer Graphics, chapter 4, asked 2×
