Upload
ira-phelps
View
213
Download
1
Embed Size (px)
Citation preview
Matrices, Transformations and the 3D Pipeline
Matthew Rusch
Paul Keet
Matrices
What is a MATRIX“A concise and useful way of uniquely
representing and working with linear transformations.”
Notation
Column or row major?Above is row major
Matrix Operations - Scalar
Scalar - MatrixAdditionSubtractionMultiplicationDivision
Matrix Operations - Matrix
Matrix – MatrixTransposeDeterminantMatrix AdditionMatrix MultiplicationMatrix Inverse
Transpose
The object obtained by replacing all elements aij with aji
Optimization note: Matrix elements down the diagonal can be left alone
Properties of the transpose:
Determinant
The determinant of a matrix A is usually denoted det(A) or |A| For a 2x2 matrix, the determinant is defined as:
An NxN matrix can be expanded by minors to obtain:
Sign is given by (-1)i+j
Matrices with a determinant of zero are called singular matrices
Matrix Multiplication
Einstein summation
Associative
Not generally commutative [A][B] != [B][A]
Identity matrices and matrices that are diagonal and of the same dimension are exceptions
Matrix Inverse
A matrix times its inverse yields an identity matrix
Same as the transpose for orthogonal matrices
Gauss-Jordan elimination Gaussian elimination LU Decomposition
Matrix Inverse
2x2 matrix
3x3 matrix
Matrix Transforms
Scale Rotation
Around isolated axis Around arbitrary axis
Translation Can be a vector addition Homogenous coordinates can be used
Shearing Affine
Preserves colinearity and relations of distances Projection matrices are NOT affine
Transformations in the 3D Pipeline
Model to World, or World Transform World to View, or View Transform
OpenGL combines this with the world transform and calls it the modelview matrix
Lighting is done in world space in this case
View to Projection, or Projection Transform How do we get from projection space to screen space?
Screen Transform Homogenezation, or divide by w
Concatination, or combining transforms