• Create Account

### #ActualiLikeCarrots

Posted 21 April 2012 - 11:12 PM

you need to compute the product of the inverses in reverse order

I'm assuming that I did this part correctly - I performed Scaling * Rotation * Translation. I flipped the 3x3 rotation section along the diagonal, so the transformed indices (OpenGL) would be..

[0  1  2]
[4  5  6]
[8  9 10]


I don't know what "rot(1,0,0)" means.

I modified the description of my test. They are the values that I use in my object matrix, which is combined in the order Translation, Rotation, Scale.

Also for completeness, this is how I create the matrix. Position, rotation, and scale are arrays with three floats.
mat[12] = node->position[0];
mat[13] = node->position[1];
mat[14] = node->position[2];

float A = cos(node->rotation[1]), B = sin(node->rotation[1]);
float C = cos(node->rotation[0]), D = sin(node->rotation[0]);
float E = cos(node->rotation[2]), F = sin(node->rotation[2]);

mat[0] = ( A*E + B*D*F) * node->scale[0];
mat[1] = ( C*F		) * node->scale[0];
mat[2] = (-B*E + A*D*F) * node->scale[0];

mat[4] = ( B*D*E - A*F) * node->scale[1];
mat[5] = ( C*E		) * node->scale[1];
mat[6] = ( B*F + A*D*E) * node->scale[1];

mat[8] = ( B*C		) * node->scale[2];
mat[9] = (-D           ) * node->scale[2];
mat[10]= ( A*C		) * node->scale[2];


### #3iLikeCarrots

Posted 21 April 2012 - 11:12 PM

you need to compute the product of the inverses in reverse order

I'm assuming that I did this part correctly - I performed Scaling * Rotation * Translation. I flipped the 3x3 rotation section along the diagonal, so the transformed indices (OpenGL) would be..

[0  1  2]
[4  5  6]
[8  9 10]


I don't know what "rot(1,0,0)" means.

I modified the description of my test. They are the values that I use in my object matrix, which is combined in the order Translation, Rotation, Scale.

Also for completeness, this is how I create the matrix. Position, rotation, and scale are arrays with three floats.
mat[12] = node->position[0];
mat[13] = node->position[1];
mat[14] = node->position[2];

float A = cos(node->rotation[1]), B = sin(node->rotation[1]);
float C = cos(node->rotation[0]), D = sin(node->rotation[0]);
float E = cos(node->rotation[2]), F = sin(node->rotation[2]);

mat[0] = ( A*E + B*D*F) * node->scale[0];
mat[1] = ( C*F		) * node->scale[0];
mat[2] = (-B*E + A*D*F) * node->scale[0];

mat[4] = ( B*D*E - A*F) * node->scale[1];
mat[5] = ( C*E		) * node->scale[1];
mat[6] = ( B*F + A*D*E) * node->scale[1];

mat[8] = ( B*C		) * node->scale[2];
mat[9] = (-D		  ) * node->scale[2];
mat[10]= ( A*C		) * node->scale[2];


### #2iLikeCarrots

Posted 21 April 2012 - 11:10 PM

you need to compute the product of the inverses in reverse order

I'm assuming that I did this part correctly - I performed Scaling * Rotation * Translation. I flipped the 3x3 rotation section along the diagonal, so the transformed indices (OpenGL) would be..

[0  1  2]
[4  5  6]
[8  9 10]


I don't know what "rot(1,0,0)" means.

I modified the description of my test. They are the values that I use in my object matrix, which is combined in the order Translation, Rotation, Scale.

Also for completeness, this is how I create the matrix --
mat[12] = node->position[0];
mat[13] = node->position[1];
mat[14] = node->position[2];

float A = cos(node->rotation[1]), B = sin(node->rotation[1]);
float C = cos(node->rotation[0]), D = sin(node->rotation[0]);
float E = cos(node->rotation[2]), F = sin(node->rotation[2]);

mat[0] = ( A*E + B*D*F) * node->scale[0];
mat[1] = ( C*F	    ) * node->scale[0];
mat[2] = (-B*E + A*D*F) * node->scale[0];

mat[4] = ( B*D*E - A*F) * node->scale[1];
mat[5] = ( C*E	    ) * node->scale[1];
mat[6] = ( B*F + A*D*E) * node->scale[1];

mat[8] = ( B*C	    ) * node->scale[2];
mat[9] = (-D		  ) * node->scale[2];
mat[10]= ( A*C	    ) * node->scale[2];


### #1iLikeCarrots

Posted 21 April 2012 - 10:51 PM

you need to compute the product of the inverses in reverse order

I'm assuming that I did this part correctly - I performed Scaling * Rotation * Translation. I flipped the 3x3 rotation section along the diagonal, so the transformed indices (OpenGL) would be..

[0  1  2]
[4  5  6]
[8  9 10]


I don't know what "rot(1,0,0)" means.

I modified the description of my test. They are the values that I use in my object matrix, which is combined in the order Translation, Rotation, Scale.

PARTNERS