Posted By: druid
about OpenGL matrix transform to D3D Shader(in a7) - 08/30/10 11:04
i m working on slin's AckR link
i want to change the source code to matrix transform to fix the Gimbal Lock problem.
what i want to which transform matrix is need to change OpenGL matrix to D3D Shader matrix(in a7);
i know that need mul() or something eles. i have try differernt trans matrix but some direction vector in the matrix still not match.
if anyone can help ,plz~~~~
thank u all
the material matrix transform code like these
ps:the position is correct transform .question is about the rotation transform
i want to change the source code to matrix transform to fix the Gimbal Lock problem.
what i want to which transform matrix is need to change OpenGL matrix to D3D Shader matrix(in a7);
i know that need mul() or something eles. i have try differernt trans matrix but some direction vector in the matrix still not match.
if anyone can help ,plz~~~~
thank u all
the material matrix transform code like these
Code:
function mtl_init() { float mat_Rot[16]; float mat_Trans[16]; float mat_Trans2[16]; mat_identity(mat_Trans); mat_identity(mat_Rot); mat_identity(mat_Trans2); while(1) { mat_Trans[2] = 1; mat_Trans[5] = 0; mat_Trans[6] = 1; mat_Trans[9] = -1; mat_Trans[10] = 0; mat_Rot[0] = fromDllAxisX.x; mat_Rot[1] = fromDllAxisX.y; mat_Rot[2] = fromDllAxisX.z; mat_Rot[3] = 0; mat_Rot[4] = fromDllAxisY.x; mat_Rot[5] = fromDllAxisY.y; mat_Rot[6] = fromDllAxisY.z; mat_Rot[7] = 0; mat_Rot[8] = fromDllAxisZ.x; mat_Rot[9] = fromDllAxisZ.y; mat_Rot[10] = fromDllAxisZ.z; mat_Rot[11] = 0; mat_Rot[12] = 0; mat_Rot[13] = 0; mat_Rot[14] = 0; mat_Rot[15] = 1; // mat_multiply(mat_Rot, mat_Trans); mat_set(mtl.matrix, mat_Rot); wait(1); } }
ps:the position is correct transform .question is about the rotation transform