Presentation is loading. Please wait.

Presentation is loading. Please wait.

Week 4 - Monday.  What did we talk about last time?  Vectors.

Similar presentations


Presentation on theme: "Week 4 - Monday.  What did we talk about last time?  Vectors."— Presentation transcript:

1 Week 4 - Monday

2  What did we talk about last time?  Vectors

3

4

5

6  The cross product of two vectors finds a vector that is orthogonal to both  For 3D vectors u and v in an orthonormal basis, the cross product w is:

7

8  Vectors can represents points or directions  The norm of a vector gives its length  The dot product of two vectors gives a measure of how much they point in the same direction  A scalar!  The cross product of two vectors gives a third vector, orthogonal to both of the original vectors

9

10

11

12  A matrix M is a set of p x q scalars with each element named m ij, where 0 ≤ i ≤ p – 1 and 0 ≤ j ≤ q – 1  We display them as p rows and q columns

13  The identity or unit matrix I is a square matrix whose diagonal is all ones with zeroes elsewhere

14  We will be interested in a number of operations on matrices, including:  Addition  Scalar multiplication  Transpose  Trace  Matrix-matrix multiplication  Determinant  Inverse

15  Similar to vector addition, matrix-matrix addition gives as its result a new matrix made up of element by element additions  The two matrices must be the same size

16  Similar to scalar-vector multiplication, scalar-matrix addition results in a matrix where each element is multiplied by the scalar  Properties  0M = 0  1M = M  a(bM) = (ab)M  a0 = 0  (a+b)M = aM + bM  a(M + N) = aM + aN

17  Transposing a matrix means exchanging its rows for columns  It has the effect of mirroring the matrix around its diagonal (or close to it, if not square)  Properties  (aM) T = aM T  (M + N) T = M T + N T  (M T ) T = M  (MN) T = N T M T

18  The trace of a square matrix is the sum of its diagonal elements  This is useful in defining quaternion conversions

19  Multiplication MN is legal only if M is p x q and N is q x r  Each row of M and each column of N are combined with a dot product and put in the corresponding row and column element

20  Properties:  (LM)N = L(MN)  (L + M)N = LN + MN  MI = IM = M  Matrix-matrix multiplication is not commutative  We can treat a vector as an n x 1 matrix and do matrix-vector multiplication similarly

21  The determinant is a measure of the "magnitude" of a square matrix  We'll focus on determinants for 2 x 2 and 3 x 3 matrices

22  The subdeterminant or cofactor d ij of matrix M is the determinant of the (n – 1) x (n – 1) matrix formed when row i and column j are removed  Below is d 02 for a 3 x 3 matrix M

23  The adjoint of a matrix is a form useful for transforming surface normals  We can also use the adjoint when finding the inverse of a matrix  We need the subdeterminant d ij to define the adjoint  The adjoint A of an arbitrary sized matrix M is:  For a 3 x 3:

24  For a square matrix M where |M| ≠ 0, there is a multiplicative inverse M -1 such that MM -1 = I  For implicit inverse, we only need to find v in the equation u = Mv, done as follows:  For cases up to 4 x 4, we can use the adjoint:

25  For cases larger than 4 x 4, other methods are necessary:  Gaussian elimination  LU decomposition  Fortunately, we never need more than 4 x 4 in graphics  Properties of the inverse:  (M -1 ) T = (M T ) -1  (MN) -1 = N -1 M -1

26  A square matrix is orthogonal if and only if its transpose is its inverse  MM T = M T M = I  Lots of special things are true about an orthogonal matrix M  |M| = ± 1  M -1 = M T  M T is also orthogonal  ||Mu|| = ||u||  Mu  Mv iff u  v  If M and N are orthogonal, so is MN  An orthogonal matrix is equivalent to an orthonormal basis of vectors lined up together

27  Why do we often have vectors of 4 things or 4 x 4 matrices in graphics?  We have points (locations) and vectors (directions)  What's really confusing is that we represent them the same way (in what looks like a vector for both)  We need to translate points but translation isn't meaningful for vectors  A 3 x 3 matrix can rotate, scale, or shear, but it can't translate

28  We add an extra value to our vectors  It's a 0 if it’s a direction  It's a 1 if it's a point  Now we can do a rotation, scale, or shear with a matrix (with an extra row and column):

29  Then, we multiply by a translation matrix (which doesn't affect a vector)  We'll cover how we make the transforms we want starting Friday

30

31  Geometric techniques  Any trigonometry that seems useful

32  Keep reading Appendix A  Read Appendix B  Keep working on Project 1, due Friday


Download ppt "Week 4 - Monday.  What did we talk about last time?  Vectors."

Similar presentations


Ads by Google