Archived

This topic is now archived and is closed to further replies.

billybob

OpenGL d3d matrixes compatible with openGL's?

Recommended Posts

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?

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites