Project 2 Phase 1 solution

 

Question 1

The x-axis points towards (-1, 0, 0).
The rotation matrix is:
-1 0 0 0
0 -sqrt(2)/2 sqrt(2)/2 0
0 sqrt(2)/2 sqrt(2)/2 0
0 0 0 1

Question 2

This question is a little confusing. Remember that it says "Rotate around ITS x axis" - this isn't the "global" (or original X axis), its the X axis of the local coordinate system. Doing the rotation in the local or the global coordinates are both legitimate, but they give different results. So you need to pay close attention to this minor detail.

Where do the three axes (in the objects coordinate system) go in the result?
x-axis: (-1, 0, 0)
y-axis: (0, -sqrt(2)/2, -sqrt(2)/2)
z-axis: (0, -sqrt(2)/2, sqrt(2)/2)
If you had used the global X axis for the 2nd rotation, you would have gotten: x-axis: (-1, 0, 0)
y-axis: (0, -sqrt(2)/2, sqrt(2)/2)
z-axis: (0, sqrt(2)/2, sqrt(2)/2)

What is the matrix form of this transformation?

-1

0

0

0

0

-sqrt(2)/2

-sqrt(2)/2

0

0

-sqrt(2)/2

sqrt(2)/2

0

0

0

0

1

If you did the global coordinates, you would have gotten: Where do the three axes (in the objects coordinate system) go in the result?
x-axis: (-1, 0, 0)
y-axis: (0, -sqrt(2)/2, -sqrt(2)/2)
z-axis: (0, -sqrt(2)/2, sqrt(2)/2)
If you had used the global X axis for the 2nd rotation, you would have gotten: x-axis: (-1, 0, 0)
y-axis: (0, -sqrt(2)/2, sqrt(2)/2)
z-axis: (0, sqrt(2)/2, sqrt(2)/2)

What is the matrix form of this transformation?

-1

0

0

0

0

-sqrt(2)/2

-sqrt(2)/2

0

0

-sqrt(2)/2

sqrt(2)/2

0

0

0

0

1

If you did the global coordinates, you would have gotten:

-1

0

0

0

0

-sqrt(2)/2

sqrt(2)/2

0

0

sqrt(2)/2

sqrt(2)/2

0

0

0

0

1

What is the inverse of this matrix?
The inverse of a rotation matrix is its transpose. Notice that this matrix is symmetric, so its its own inverse!

If this seems counterintuitive, don't worry - many things about rotations often are!

Question 3

C: viewing matrix
M: transformation matrix
P: projective transform matrix

answer = h ( P C M ) [0 0 0 1]
 
M [ 0 0 0 1] = [ 3 4 5 1]
C (above) = [ -5/2 3/2 8 1 ]
P (above) = [ -5/2 3/2 1 -8]
answer = h (above) = (5/16, -3/16)

Question 4

Question 5:

Consider a 3D transformation M (a 4x4 homogeneous coordinate matrix) that is created by composing a rotation and a uniform scale. M maps the unit X vector to (0,1,1), and the unit Y vector to (0,1,-1).

Question 5A:

Where does M map the unit Z vector to?

The direction of the unit Z vector will be in the direction of the cross product of where the X and Y vectors go. (since neither rotation nor uniform scale distorts the angles between the axes).

X cross Y = -2,0,0

However, the cross product doesn't necessarily do the right thing with the scale. All three vectors need to have the same length (and X and Y have length sqrt(2)) so the Z vector needs to be:

-sqrt(2), 0, 0

Question 5B:

What is the amount of the scale used to make M?

sqrt(2)