See also: rendering, imaging, illumination, colour, GLSL

## Coordinate Frames

Let $A$ be the original basis and $B$ be the new basis

$ xy1 _{B}= ad0 be0 cf1 xy1 _{A}$

Then:

- $[ad ]$ is $i_{A}$, how to transform the $x$ coordinate
- $a$ is how much of $i_{B}$ we need to make one $i_{A}$
- $d$ is how much of $j_{B}$ we need to make one $i_{A}$

- $[be ]$ is $j_{A}$, how to transform the $y$ coordinate
- $b$ is how much of $i_{B}$ we need to make one $j_{A}$
- $e$ is how much of $j_{B}$ we need to make one $j_{A}$

- $[cf ]$ is $O_{A}$, the translation of the entire frame
- $c$ is how much of $i_{B}$ we need to get from $O_{B}$ to $O_{A}$
- $f$ is how much of $j_{B}$ we need to get from $O_{B}$ to $O_{A}$

The translation from $P_{A}$ to $P_{B}$ can be represented as $P_{B}=O_{A}+x_{A}i_{A}+y_{A}j_{A}$

## Transformation Matrices

`Translate(x,y,z)`

- $ x_{′}y_{′}z_{′}1 = 1 1 1 abc1 xyz1 $

`Rotate(z,theta)`

- $ x_{′}y_{′}z_{′}1 = cosθsinθ −sinθcosθ 1 1 xyz1 $

`Scale(x,y,z)`

- $ x_{′}y_{′}z_{′}1 = a b c 1 xyz1 $

### Transformations

- Object Coordinate System: modeling transformation
- World Coordinate System: viewing transformation
- Viewing Coordinate System (Camera): projection transformation
- Clipping Coordinate System: /h
- Normalized Device Coordinate System (NDCS): viewport transformation
- Device Coordinate System

In a scene hierarchy, the Camera Coordinate Frame ($F_{VCS}$) is generally the root.

Transformations in scene graphs are written right to left, starting with source frame and ending with target frame.

## Viewing Transformation

- Defined using
- eye point
- target point
- up vector

$k=∥P_{eye}−P_{ref}∥P_{eye}−P_{ref} $

$i=∥V_{up}×k∥V_{up}×k $

$j =k×i$

$M_{cam}= i_{1}i_{2}i_{3}0 j_{1}j_{2}j_{3}0 k_{1}k_{2}k_{3}0 P_{eye1}P_{eye2}P_{eye3}1 $

$M_{view}=M_{cam}$