Sign in to follow this  
browny

relation between OGL and DX matrix

Recommended Posts

browny    139
OGL arranges matrix in column major order... and DX arranges in row major oder. However, the mathematical relation between DX and OGL matrices is that one is the transpose of the other. But due the different memory represention, i guess a simply memcpy actually does the transpose right.. so i am guessing float m[4][4]; which works fine for OGL should also work find for the following D3DXMATRIX16 matdx; memcpy(matdx.m, m, sizeof(m)); please correct me if am wrong.

Share this post


Link to post
Share on other sites
_neutrin0_    241
OpenGL does not order matrices.
Read this.

"Column-major versus row-major is purely a notational convention. Note that post-multiplying with column-major matrices produces the same result as pre-multiplying with row-major matrices. The OpenGL Specification and the OpenGL Reference Manual both use column-major notation. You can use any notation, as long as it's clearly stated."

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this