Graphics
Vectors 1
Matrices 6
Transformations 7
Viewing Transformation 10
Ray Tracing 12
Rasterization 13
, Rendering Creating shaded images from 3D models
- Image-order rendering (ray tracing): each pixel considered in turn, taking into account all
objects that influence that pixel
- Object-order rendering (rasterization): each object considered in turn and the pixels
influenced by that object are updated
Vectors
Scalar Quantity represented by a magnitude (single number)
Point Entity describing a location (x, y, z)
Vector Quantity requiring a magnitude and a direction
- Points and vectors are represented using a cartesian coordinate system
2 2 2
- Magnitude/Norm (length) of a vector: ||𝑣|| = 𝑣1 + 𝑣2 +... + 𝑣𝑖
Normalisation Setting the magnitude to 1 by dividing each part of the vector by the magnitude
1
- ^𝑣 = · [𝑣1, 𝑣2, ... , 𝑣𝑖] ⇒ ||𝑣|| = 1
||𝑣||
- Normalized vector ^𝑣 is the unit vector of 𝑣
Basis Union of vectors form a basis for a given dimension if the angle between them is > 0, i.e.
in 3D it would consist of^𝑥 = [1, 0, 0], ^𝑦 = [0, 1, 0] and ^𝑧 = [0, 0, 1]
- The basis is orthogonal if the basis vectors form an angle of 90°
- If the basis vectors both have a unit length of 1 and are orthogonal, it’s orthonormal
- A vector [𝑣𝑥, 𝑣𝑦] can be represented as the linear combination of ^𝑥 and ^𝑦 by
𝑣𝑥 · ^𝑥 + 𝑣𝑦 · ^𝑦
- To find the coordinates of a point 𝑃 in some other basis defined by â and ^𝑏,
you calculate 𝑝 · â + 𝑝 · ^𝑏c if the basis is orthonormal
Vector operations
- Addition/subtraction: 𝑢 ± 𝑣 = [𝑢 ± 𝑣 , 𝑢 ± 𝑣 , ... , 𝑢 ± 𝑣 ]
1 1 2 2 𝑖 𝑖
- Scalar multiplication: 𝑙 · 𝑣 = [𝑙 · 𝑣 , 𝑙 · 𝑣 , ... , 𝑙 · 𝑣 ]
1 2 𝑖
- Dot product: 𝑢 · 𝑣 = 𝑢 𝑣 + 𝑢 𝑣 +... + 𝑢 𝑣
1 1 2 2 𝑖 𝑖
- Alternatively, 𝑢 · 𝑣 = ||𝑢|| · ||𝑣|| · 𝑐𝑜𝑠(θ) where θ is the angle between 𝑢 and𝑣
2
- 𝑢 · 𝑢 = ||𝑢||
- Projection of one vector on another (𝑡 = 𝑐 · 𝐷)
- Think directional multiplication, only multiplications in the same direction count
◦
- Two vectors are orthogonal if their dot product is 0 (θ = 90 ; perpendicular)
- Cross product: 𝑎 × 𝑏 = [𝑎𝑦𝑏𝑧 − 𝑎𝑧𝑏𝑦, 𝑎𝑧𝑏𝑥 − 𝑎𝑥𝑏𝑧, 𝑎𝑥𝑏𝑦 − 𝑎𝑦𝑏𝑥] (calculator)
- Anticommutative (𝑎 × 𝑏 = − 𝑏 × 𝑎) and non-associative (
𝑎 × (𝑏 × 𝑐) ≠ (𝑎 × 𝑏) × 𝑐)
- ||𝑎 × 𝑏|| = ||𝑎|| · ||𝑏|| · 𝑠𝑖𝑛(θ)
- 𝑎 and 𝑏 are parallel iff 𝑎 × 𝑏 = 0
1
Vectors 1
Matrices 6
Transformations 7
Viewing Transformation 10
Ray Tracing 12
Rasterization 13
, Rendering Creating shaded images from 3D models
- Image-order rendering (ray tracing): each pixel considered in turn, taking into account all
objects that influence that pixel
- Object-order rendering (rasterization): each object considered in turn and the pixels
influenced by that object are updated
Vectors
Scalar Quantity represented by a magnitude (single number)
Point Entity describing a location (x, y, z)
Vector Quantity requiring a magnitude and a direction
- Points and vectors are represented using a cartesian coordinate system
2 2 2
- Magnitude/Norm (length) of a vector: ||𝑣|| = 𝑣1 + 𝑣2 +... + 𝑣𝑖
Normalisation Setting the magnitude to 1 by dividing each part of the vector by the magnitude
1
- ^𝑣 = · [𝑣1, 𝑣2, ... , 𝑣𝑖] ⇒ ||𝑣|| = 1
||𝑣||
- Normalized vector ^𝑣 is the unit vector of 𝑣
Basis Union of vectors form a basis for a given dimension if the angle between them is > 0, i.e.
in 3D it would consist of^𝑥 = [1, 0, 0], ^𝑦 = [0, 1, 0] and ^𝑧 = [0, 0, 1]
- The basis is orthogonal if the basis vectors form an angle of 90°
- If the basis vectors both have a unit length of 1 and are orthogonal, it’s orthonormal
- A vector [𝑣𝑥, 𝑣𝑦] can be represented as the linear combination of ^𝑥 and ^𝑦 by
𝑣𝑥 · ^𝑥 + 𝑣𝑦 · ^𝑦
- To find the coordinates of a point 𝑃 in some other basis defined by â and ^𝑏,
you calculate 𝑝 · â + 𝑝 · ^𝑏c if the basis is orthonormal
Vector operations
- Addition/subtraction: 𝑢 ± 𝑣 = [𝑢 ± 𝑣 , 𝑢 ± 𝑣 , ... , 𝑢 ± 𝑣 ]
1 1 2 2 𝑖 𝑖
- Scalar multiplication: 𝑙 · 𝑣 = [𝑙 · 𝑣 , 𝑙 · 𝑣 , ... , 𝑙 · 𝑣 ]
1 2 𝑖
- Dot product: 𝑢 · 𝑣 = 𝑢 𝑣 + 𝑢 𝑣 +... + 𝑢 𝑣
1 1 2 2 𝑖 𝑖
- Alternatively, 𝑢 · 𝑣 = ||𝑢|| · ||𝑣|| · 𝑐𝑜𝑠(θ) where θ is the angle between 𝑢 and𝑣
2
- 𝑢 · 𝑢 = ||𝑢||
- Projection of one vector on another (𝑡 = 𝑐 · 𝐷)
- Think directional multiplication, only multiplications in the same direction count
◦
- Two vectors are orthogonal if their dot product is 0 (θ = 90 ; perpendicular)
- Cross product: 𝑎 × 𝑏 = [𝑎𝑦𝑏𝑧 − 𝑎𝑧𝑏𝑦, 𝑎𝑧𝑏𝑥 − 𝑎𝑥𝑏𝑧, 𝑎𝑥𝑏𝑦 − 𝑎𝑦𝑏𝑥] (calculator)
- Anticommutative (𝑎 × 𝑏 = − 𝑏 × 𝑎) and non-associative (
𝑎 × (𝑏 × 𝑐) ≠ (𝑎 × 𝑏) × 𝑐)
- ||𝑎 × 𝑏|| = ||𝑎|| · ||𝑏|| · 𝑠𝑖𝑛(θ)
- 𝑎 and 𝑏 are parallel iff 𝑎 × 𝑏 = 0
1