---
title: "Transform scene to camera orientation"
subject: "Computer Graphics"
chapter: 4
key: "semester_5/computer_graphics:camera-orientation-transform-matrix"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/camera-orientation-transform-matrix
site: BCT Engineering
---

# Transform scene to camera orientation

Computer Graphics · Chapter 4: Three-Dimensional Graphics

- Asked in: 2067 Mangsir (old course), 10 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/camera-orientation-transform-matrix
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-4

## Question

A 3-D scene is viewed from point (1,1,1) with camera orientation described by the orientation of three orthogonal vectors (1,1,1), (1,2,-3) and (-5,4,1). Obtain the transformation matrix to describe the scene with respect to camera orientation.

## Short answer

Normalize axes: u=(0.2673,0.5345,-0.8018), v=(-0.7715,0.6172,0.1543), n=(0.5774,0.5774,0.5774). Translate by (-1,-1,-1), then rotate with rows u,v,n. Matrix M = [0.2673 0.5345 -0.8018 0; -0.7715 0.6172 0.1543 0; 0.5774 0.5774 0.5774 -1.7321; 0 0 0 1].

## Answer

**Assumptions:** the camera is at R0 = (1,1,1). The three orthogonal vectors are the camera axes: u = (1,2,−3) (camera x), v = (−5,4,1) (camera y) and n = (1,1,1) (camera z, the viewing direction). Check of orthogonality and handedness:

- u·v = −5 + 8 − 3 = 0, u·n = 1 + 2 − 3 = 0, v·n = −5 + 4 + 1 = 0
- u × v = (14, 14, 14) = 14·n, so (u, v, n) is a right-handed set.

**Step 1: unit vectors**

- |u| = √14 = 3.742 → u = (0.2673, 0.5345, −0.8018)
- |v| = √42 = 6.481 → v = (−0.7715, 0.6172, 0.1543)
- |n| = √3 = 1.732 → n = (0.5774, 0.5774, 0.5774)

**Step 2: translate the camera to the origin**

```text
T = | 1 0 0 -1 |
    | 0 1 0 -1 |
    | 0 0 1 -1 |
    | 0 0 0  1 |
```

**Step 3: rotate the camera axes onto the world axes** (the rows are u, v, n)

```text
R = |  0.2673  0.5345 -0.8018 0 |
    | -0.7715  0.6172  0.1543 0 |
    |  0.5774  0.5774  0.5774 0 |
    |  0       0       0      1 |
```

**Step 4: M = R · T.** The last column is −R·(1,1,1) = −(u·R0, v·R0, n·R0). Here u·R0 = 0, v·R0 = 0 and n·R0 = 1.732.

```text
M = |  0.2673  0.5345 -0.8018   0      |
    | -0.7715  0.6172  0.1543   0      |
    |  0.5774  0.5774  0.5774  -1.7321 |
    |  0       0       0        1      |
```

Every world point P is described in camera coordinates as P' = M·P. Check: the camera position (1,1,1) maps to (0,0,0), and the point (2,2,2), one step along n, maps to (0, 0, 1.732).

If the vectors are instead taken in the given order as the camera x, y, z axes ((1,1,1), (1,2,−3), (−5,4,1), which is also right-handed), the same method simply reorders the rows: the rows of M become (0.5774, 0.5774, 0.5774, −1.7321), (0.2673, 0.5345, −0.8018, 0) and (−0.7715, 0.6172, 0.1543, 0).

**Answer:** M above.

## Check yourself

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

1. In this problem, which vector is the viewing direction (camera z-axis)?
   A. (1,1,1)
   B. (1,2,-3)
   C. (-5,4,1)
   D. (1,1,-1)
   Answer: A. u × v = 14·(1,1,1), so (1,1,1) is n, completing a right-handed set. (Key point: Camera axes)

2. Why are dot products u·v, u·n, v·n computed?
   A. To find the camera position
   B. To confirm the vectors are mutually perpendicular
   C. To normalise the vectors
   D. To compute the translation
   Answer: B. A zero dot product shows perpendicular axes, which is required for a rotation matrix. (Key point: Orthogonality)

3. The final matrix is:
   A. M = T·R with columns u, v, n
   B. M = R only
   C. M = R·T with rows of R = u, v, n
   D. M = T inverse
   Answer: C. Translate the camera to the origin, then rotate the camera axes to the world axes. (Key point: Matrix form)

4. The last entry of the third row is -n·R0 = ?
   A. 0
   B. -3
   C. 1
   D. -1.732
   Answer: D. n·R0 = 3/sqrt(3) = 1.732; the other two terms (u·R0, v·R0) are 0. (Key point: Translation term)

## Related in Computer Graphics

- [3D world to viewing coordinate matrix](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aworld-to-viewing-3d-matrix) — Computer Graphics, chapter 4, asked 2×
- [Scaling about arbitrary fixed point](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Ascaling-about-fixed-point) — Computer Graphics, chapter 3
- [3D window to viewport transformation](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Awindow-viewport-3d-matrix) — Computer Graphics, chapter 4
- [3D scaling about arbitrary point](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Ascale-3d-arbitrary-point) — 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×
- [Rotation about a pivot point](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Arotation-about-pivot-point-derive) — Computer Graphics, chapter 3, 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
- [Point transformation rectangular-spherical](https://www.bctengineer.com/question.md?key=semester_3%2Felectromagnetism%3Acoordinate-point-transform-spherical) — Electromagnetism, chapter 1
- [Product of orthogonal matrices](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Aproduct-of-orthogonal-matrices-two) — Mathematics III, chapter 1, asked 4×
- [Electric vectors E, P and D](https://www.bctengineer.com/question.md?key=semester_1%2Fengineering_physics%3Adielectric-vectors-d-e-p) — Engineering Physics, chapter 7, asked 3×
