Closed WebFreak001 closed 9 years ago
afaik they apply on mat3 awell:
static if((rows == cols) && (rows >= 3)) {
static if(isFloatingPoint!mt) {
/// Returns an identity matrix with an applied rotate_axis around an arbitrary axis (nxn matrices, n >= 3).
static Matrix rotation(real alpha, Vector!(mt, 3) axis) {......
see: https://github.com/Dav1dde/gl3n/blob/master/gl3n/linalg.d#L1444
A 2x2 rotation matrix is indeed missing, not sure how useful it would be (but I wouldnt be against adding it anyways), since you normally work with homogeneous coordinates anyways (correct me if I am wrong!). 3x3 rotation/translation/scale matrices are supported (as @Extrawurst stated), 3x2 aren't, if you give me a good resource why they are needed and what they do, I am all for adding them.
There is D2D1_MATRIX_3X2 in Direct2D for 2D transformation.
https://msdn.microsoft.com/en-us/library/windows/desktop/dd372275(v=vs.85).aspx
Ok, but why is it important to have a 3x2 matrix, instead of a 3x3. How does it work? I was looking for something more mathematical, since I've never seen a use for a 3x2 matrix.
Not mathematical but it saves 12 bytes in ram for each matrix
Which is irrelevant. You don't create millions of matrices and keep these in memory. Also you don't send them to the GPU with every vertex, but once via uniform.
It would be nice to have rotate, translate and scale in 2d aswell