Notes about 3D matrix primitives

In class we discussed 3D linear transformations using 4x4 matrices, which should largely be review for you, since you've already implemented 2D linear transformations using 3x3 matrices.

3D Transformation Matrices:

Here are the basic 3D matrix primitives (not including perspective):

identity:
1000
0100
0010
0001
translationMatrix(a,b,c):
100a
010b
001c
0001
xRotationMatrix(θ):
1000
0cos(θ)-sin(θ)0
0sin(θ)cos(θ)0
0001
yRotationMatrix(θ):
cos(θ)0sin(θ)0
0100
-sin(θ)0cos(θ)0
0001
zRotationMatrix(θ):
cos(θ)-sin(θ)00
sin(θ)cos(θ)00
0010
0001
scaleMatrix(a,b,c):
a000
0b00
00c0
0001