Quote:Original post by Cryoknight If all you are doing is rotation, sure. But not if you want to be able to do the full 3d pipeline of matrix multiplications. If you didn't need the 4x4 matrices, they wouldn't bother using them in EVERY SINGLE 3d programming book.
All he is talking about is rotations without respect to a 3d pipeline. For all you know this isn't even related to graphics in any way.
if your going to pass bare arrays i would recommend this version as the typical way using pointers just leads to arrays decaying to pointers (pointer decay). You know specifically the dimensions are always the same then you are just losing information using pointers. Statically allocated arrays are rich in information compared to pointers.
it will preserve all the dimensional information, and it is passed as a pointer anyways, so don't worry about it being copied every time, 'cause it won't.
Quote:Original post by Cryoknight If all you are doing is rotation, sure. But not if you want to be able to do the full 3d pipeline of matrix multiplications. If you didn't need the 4x4 matrices, they wouldn't bother using them in EVERY SINGLE 3d programming book.
I've seen professional renderers that utilize 4x3 matrices, a 3x3 rotation and then the offset vector. There are plenty of different ways to work with matrices. People find shortcuts, optimizations, etc. Never convince yourself that there is only one right answer to a programming question.
it will preserve all the dimensional information, and it is passed as a pointer anyways, so don't worry about it being copied every time, 'cause it won't.
Actually, my version is the one that preserves dimension information, yours does not. Yours only preserves the number of columns and not the number of rows, whereas mine preserves both.