-
A square matrix is invertible if and only if ...
It's determinant is non-zero
-
A vector has both ...
Magnitude and direction
-
A camera is an example of a ...
Viewer
-
-
Implicit line equation
ax + by + c = 0
-
Parametric line equation
( x, y ) = t ( x0, y0 ) + t ( dx, dy )
-
Alternate parametric line equation
( x, y ) = ( x0, y0 ) + ( 1 - t ) ( x1, y1 )
-
Number of points needed to define a line
2
-
What is a ray
- A half infinite line
- I.e the line goes from t = 0 to infinity
-
What does the implicit equation in 3D yield?
A plane (not a line)
-
Number of points needed to define a plane
3
-
How to obtain normal vector from a plane
- For points p1, p2, p3
- Normal vector = ( p2 - p1 ) x (p3 - p1)
-
How is a triangle defined
Three non-colinear points
-
Barycentric coordinate equation
p = λ1p1 + λ2p2 + λ3p3
-
When are barycentric coordinates used
To plot coordinates inside of triangles
-
Geometric transformations are used for
converting from one coordinate system to another
-
3D Homogeneous coordinates
- Four elements (x, y, z, w)
- Allow all transformations to be performed by matrix multiplication
-
Homogeneous coordinates: w value for a point
w = 1
-
Homogeneous coordinates: w value for a vector
w = 0
-
Coordinate system (3D)
- Three linearly independent vectors
- Usually orthogonal
-
Coordinate frame
A coordinate system with a point representing the origin
-
Model-view-projection steps
- 1. Model transformation
- 2. View transformation
- 3. Projection transformation
- 4. Perspective division (where needed)
- 5. Window coordinates are computed
-
Model transformation
Placing the object into the world
-
View transformation
The world is transformed into eye/camera coordinates
-
Projection transformation
The coordinates are transformed into clip-coordinates
-
Purpose of perspective division in MVP
Obtaining normalized device coordinates
-
MVP frames that the programmer works with
- Model frame
- Object frame
- Eye frame
-
Affine transformation
A transformation that preserves lines
-
Most efficient way to apply multiple transformations to many points
- 1. Since each transformation is a matrix, multiply the matrices
- 2. Pass the matrix product to the GPU/shader
- 3. Multiply each point with the matrix product
- Matrix-matrix multiplication is slow and shouldn't be repeated if no necessary
-
Requirements for a rotation tranformation
- An axis (x, y, z) that is unchanged by the rotation
- A rotation angle
-
How to rotate around some point P (other than the origin)
- Translate everything, so that P is at the origin T(P)
- Perform the rotation
- Translate everything back so that P is where it was before T(-P)
-
How to perform arbitrary rotations about the origin
- A combination of x, y and z rotations
- Finding the angle of each rotation is usually difficult
-
How to rotate by some angle, θ, about an arbitrary axis (given by a vector, u)
- 1. Normalize u to get v2. Rotate such that v is along the pos-z axis (use x, y rotations)
- 3. Perform z-rotation by θ
- 4. Rotate so that v is back to where it started (inverse of step 2)
-
Instance transformation
A transformation on a given instance of an object
-
Typical order of transformations
- 1. Scale
- 2. Rotate
- 3. Translate
- M= TRS · v
-
Order of transformation matrices when constructing an MVP matrix
- 1. Initialize to or multiply by translation matrix first
- 2. Multiply result by rotation matrix
- 3. Multiply result by scale matrix
- This will produce a matrix product of the form TRS
-
Where should the transformation matrix be computed?
- In the application (on the CPU)
- Calculate only once
-
Where should the transformation matrix be applied?
- On the GPU (shader program)
- Pass the prepared matrix and the vertices to transform to the shader
|
|