Jump to content
  • Advertisement
Sign in to follow this  
maxalba

OpenGL OGL 2 DX8

This topic is 4890 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!