Jump to content
  • Advertisement
Sign in to follow this  

OpenGL DirectX to OpenGL coordinate and transformation conversion

This topic is 4831 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

Hello, I write a parser for .x model files. As matrices and coordinates in this file format are (or should be?) in DirectX's left handed row major form I want to convert everything to right handed column major as in OpenGL. Could somebody tell me if this approach is correct: 1. Matrices are read as they are and automatically transposed in this process. 2. The z coordinate of all coordinates and normals is multiplied by -1. 3. The matrices from 1. should be transformed to do this: As vertex (x,y,z,w) transformed by matrix M resulted in (x',y',z',w') a converted matrix M' should transform (x,y,-z,w) to (x',y',-z',w'). So I get M' as: M'=S*M*S with S being a scaling matrix: 1 0 0 0 0 1 0 0 0 0-1 0 0 0 0 1 Should this work or is there a logical mistake in that? Thanks a lot. Markus

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!