---
title: "Derive perspective projection matrix"
subject: "Computer Graphics"
chapter: 4
key: "semester_5/computer_graphics:perspective-projection-matrix-derive"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/perspective-projection-matrix-derive
site: BCT Engineering
---

# Derive perspective projection matrix

Computer Graphics · Chapter 4: Three-Dimensional Graphics

- Asked in: 2074 Chaitra, 6 marks; 2075 Chaitra, 4 marks; 2076 Chaitra, 5 marks (asked 3 times)
- Video: [3D Transformation : perspective projection and types](https://www.youtube.com/watch?v=l5rmdCRuGQU) — Umang Rastogi
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/perspective-projection-matrix-derive
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-4

## Question

Derive the transformation matrix for perspective projection (derive an expression for perspective projection of a 3D point).

## Short answer

Perspective projection maps a point P(x,y,z) to P'(xp,yp,zvp) on the view plane using xp = x·dp/(zprp−z), yp = y·dp/(zprp−z) where dp = zprp−zvp. The homogeneous matrix has row [1 0 0 0; 0 1 0 0; 0 0 -zvp/dp zvp·zprp/dp; 0 0 -1/dp zprp/dp] so that h = (zprp−z)/dp.

## Answer

**Setup:** the centre of projection (COP) is on the z-axis at (0, 0, zprp). The view plane is z = zvp. Let dp = zprp − zvp. A point P(x, y, z) is projected to P'(xp, yp, zvp) where the line from the COP through P meets the view plane.

```text
        y
        |        P(x,y,z)
        |      /
        |    /
   yp   |--/--- view plane (z = zvp)
        |/
 COP ---+----------------> z
      zprp
```

**Derivation (similar triangles):** along the line from the COP to P, any point is

x' = x·u, y' = y·u, z' = zprp − (zprp − z)·u, with 0 ≤ u ≤ 1

Put z' = zvp:

zvp = zprp − (zprp − z)u → u = (zprp − zvp)/(zprp − z) = dp/(zprp − z)

So

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

**Matrix form:** use homogeneous coordinates with h = (zprp − z)/dp, so that xp = x_h/h and yp = y_h/h.

```text
| x_h |   | 1 0  0           0            | | x |
| y_h | = | 0 1  0           0            | | y |
| z_h |   | 0 0  -zvp/dp     zvp·zprp/dp  | | z |
| h   |   | 0 0  -1/dp       zprp/dp      | | 1 |
```

Check: h = −z/dp + zprp/dp = (zprp − z)/dp, and z_h/h = zvp·(zprp − z)/dp ÷ ((zprp − z)/dp) = zvp.

**Special cases**
- View plane at z = 0 (zvp = 0): xp = x·zprp/(zprp − z), and the matrix has third row (0 0 0 0).
- COP at the origin and view plane z = d: xp = x·d/z, yp = y·d/z.

Perspective makes distant objects smaller (perspective foreshortening). Points with z = zprp are projected to infinity (h = 0).

## Check yourself

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

1. How is the projected point P' found in perspective projection?
   A. Where the line from the COP through P meets the view plane
   B. Where the perpendicular from P meets the view plane
   C. By dropping the z coordinate of P
   D. By rotating P onto the view plane
   Answer: A. Projectors converge at the COP, so the image is the intersection of the COP-to-P line with the view plane. (Key point: Projection setup)

2. Setting z' = zvp on the line gives u equal to:
   A. (zprp - z)/dp
   B. dp/(zprp - z)
   C. zvp/z
   D. dp/(zvp - z)
   Answer: B. zvp = zprp - (zprp - z)u gives u = (zprp - zvp)/(zprp - z) = dp/(zprp - z). (Key point: Parameter u)

3. The projected x coordinate is:
   A. xp = x*(zprp - z)/dp
   B. xp = x*zvp/z
   C. xp = x*dp/(zprp - z)
   D. xp = x
   Answer: C. x' = x*u with u = dp/(zprp - z); a farther point (smaller denominator ratio) gives a smaller image. (Key point: Projected x)

4. In the matrix form, the homogeneous factor h and its meaning are:
   A. h = dp/(zprp - z), and the result is multiplied by h
   B. h = 1 always, so no division is needed
   C. h = zvp/zprp, a constant for the scene
   D. h = (zprp - z)/dp, and the result is divided by h
   Answer: D. The bottom row gives h = (zprp - z)/dp; xp = x_h/h and yp = y_h/h. (Key point: Homogeneous factor)

## Related in Computer Graphics

- [3D rotation steps and perspective projection](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotate-3d-arbitrary-axis-perspective) — Computer Graphics, chapter 4
- [Short note: Two-point perspective projection](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Ashort-note-two-point-perspective) — Computer Graphics, chapter 4
- [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
- [Derive parallel projection matrix](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aparallel-projection-matrix-derive) — Computer Graphics, chapter 4, asked 2×
- [Derive oblique projection matrix](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aoblique-projection-matrix-derive) — Computer Graphics, chapter 4, asked 3×
- [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×

## Related in other subjects

- [4-point DFT by linear transformation](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Adft-linear-transformation) — Signals and Systems, chapter 3
- [Derive expression for tile drain spacing](https://www.bctengineer.com/question.md?key=semester_6%2Firrigation_and_drainage_engineering%3Atile-drain-spacing-derivation) — Irrigation and Drainage Engineering, chapter 9, asked 8×
- [Derive development length expression](https://www.bctengineer.com/question.md?key=semester_7%2Fdesign_of_rcc_structure%3Aderive-development-length-expression) — Design of RCC Structure, chapter 6, asked 6×
- [Derive PET expression by Penman's method](https://www.bctengineer.com/question.md?key=semester_5%2Fengineering_hydrology%3Aderive-penman-pet) — Engineering Hydrology, chapter 3
