Original Post
Okay great, so you transform a vector by the matrix. I do it like this Now I wrote this down on paper, tried some algebra and realised.. Hell no, it's not happening that way, atleast not on 2 a4 sides. So according to theory if i Invert the matrix M I can just apply the same transform (backwardly). Anyone has some source code on inversing a matrix 4x4?
/*For this one i copied source from my old code, not to sure if its correct*/
// Input,matrix & vector
__declspec(dllexport) void mTransform(float *m,float &x,float &y,float &z)
{
float tvx,tvy,tvz;
tvx = x*m[0]+y*m[4]+z*m[8] + m[12];
tvy = x*m[1]+y*m[5]+z*m[9] + m[13];
tvz = x*m[2]+y*m[6]+z*m[10] + m[14];
x = tvx;
y = tvy;
z = tvz;
}