OGL 2 DX8

Started by
0 comments, last by Dancin_Fool 18 years, 9 months ago
I have a very simple question. I want to convert my game from opengl to DX8/9, but the matrix trans', are bugging me, and it's late at night!!! opengl C++: glLoadIdentity(); glTranslatef(0.0f, 0.0f, -40.0f); glRotatef( 45.0f, 1.0f, 0.0f, 0.0f); glRotatef(-45.0f, 0.0f, 1.0f, 0.0f); glTranslatef(-20.0f, 0.0f, -20.0f); glGetFloatv(GL_MODELVIEW_MATRIX, view_matrix); directX8 C++: ??? This was my attempt: D3DXMATRIX matWorld; D3DXMATRIX matTrans; D3DXMATRIX matRot; D3DXMATRIX a; D3DXMatrixTranslation( &matTrans, 0.0f, 0.0f, 40.0f ); D3DXMatrixRotationYawPitchRoll( &matRot, D3DXToRadian(45.0f), D3DXToRadian(45.0f), D3DXToRadian(0.0f) ); D3DXMatrixTranslation( &a, 20.0f, 0.0f, 20.0f ); matWorld = matRot * matTrans * a; Cheers.
Advertisement
not really sure on this one but since the order of multiplication matters for a matrix, you might wanna try

matWorld = a * matRot * matTrans

just a guess though

This topic is closed to new replies.

Advertisement