2-D Translation (moving in the x and y direction)

| 1 ; 0 ; 0 |
| 0 ; 1 ; 0 |
| xTrans ; yTrans ; 1 |

2-D Scaling

| xScale ; 0 ; 0 |
| 0 ; yScale ; 0 |
| 0 ; 0 ; 1 |

2-D Rotation (around the z-axis)

| cos( angle) ; -sin( angle) ; 0 |
| sin( angle) ; cos( angle) ; 0 |
| 0 ; 0 ; 1 |

All of the above 2-D operations combined into one 3×3 matrix

| xScale * cos( angle); xScale * -sin( angle); xscale * -sin(angle) |
| yScale * sin( angle); yScale * cos( angle); 0 |
| xTrans; yTrans; 1 |

…according to a game dev book, anyway. Not that these would be important to the project. This last one, call it Q, however might very well be:

2*q[0]^2-1+2*q[1]^2; 2*q[1]*q[2]-2*q[0]*q[3]; 2*q[1]*q[3]+2*q[0]*q[2]
2*q[1]*q[2]+2*q[0]*q[3]; 2*q[0]^2-1+2*q[2]^2; 2*q[2]*q[3]-2*q[0}*q[1]
2*q[1]*q[3]-2*q[9]*q[2]; 2*q[2]*q[3]+2*q[0]*q[2]; 2*q[0]^2-1+2*q[3]^2

w = Q*v, where w and v are 3×1 matrices (vectors). So far, it’s just a “note to self”.

### Like this:

Like Loading...

*Related*