d3d matrixes compatible with openGL's?

Started by
1 comment, last by billybob 21 years, 8 months ago
i''m using a physics library that returns a thing supposedly compatible with opengl''s matrixes. can i just copy that into a dx matrix?
Advertisement
AFAIK the **data structures** should be compatible, i.e. a GL 4x4 matrix should be compatible with a D3D 4x4 matrix.

However, the information stored may not be:

- It''s likely that the contents of the GL matrices will be *Right Handed* whereas D3D is usually *Left Handed* - Look in the D3D docs under "3-D Coordinate Systems" for more info and how to convert.

- There may also be a row major versus column major difference. If there is, simply transpose the matrix.

- Any GL perspective projection matrices are extremely likely to be different, due to (IIRC) slight differences in clip space between D3D and OpenGL. Though if you''re translating rigid body physics stuff, it''s highly unlikely you''d ever have any.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

quote:
There may also be a row major versus column major difference. If there is, simply transpose the matrix.


Yes this is true. I saw it in an article which I used for my degree project.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

This topic is closed to new replies.

Advertisement