OpenGL – uses right-hand coordinate system and column vectors. Since column vectors are being used, the matrices have to be multiplied backwards, i.e. the vector you want to transform will be at the end of the equation.
Therefore, if you want your vector to apply a translation and then a rotation, you first multiply the rotation, then translation, then apply it to your column vector, RTv (R=rotation matrix, T=translation matrix, v=vector).
DirectX – uses the left-hand coordinate system and row vectors. With row vectors, calculations are done in order. So if you want your vector to apply a translation and then a rotation (as in the above), your equation becomes vTR.
Y u so different? They are complete opposites, it seems. I know DirectX chooses row vectors for some optimization reason (row faster to access in memory, etc), and there are texts that I will probably read up more on regarding the matter. But as of now, going through these can get a bit confusing.
Cross Product
So when it comes to cross products how do you figure out the direction of the resultant vector when there are two coordinate systems?
If you are trying to get the cross product of axb (a & b are vectors) trace the angle going from a to b. If the direction of the traced angle is clockwise, on a left-hand system, the resultant vector will be pointing towards you.
Now, on a right hand system, if you trace the angle from a to b and it is counter-clockwise the resultant vector will be pointing…towards you!
Aughh! Lol. It’s much easier to draw it and/or use hand motions. I should update this with images.
Long story short, there are possible combinations. What are the answers? Dun dun dun…
| coordinate system | angle traced | resultant direction | |
| axb | right-handed | clockwise | away from you ? |
| axb | left-handed | clockwise | towards you ? |
| axb | right-handed | counter-clockwise | towards you ? |
| axb | left-handed | counter-clockwise | away from you ? |
| bxa | right-handed | clockwise | ? |
| bxa | left-handed | clockwise | ? |
| bxa | right-handed | counter-clockwise | ? |
| bxa | left-handed | counter-clockwise | ? |
Well that’s some basic learning for today. If any of this sounds wrong please let me know, otherwise I will be very sad. :C