Jump to content
  • Advertisement

Archived

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

onnel

OpenGL Converting from Opengl

This topic is 6192 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 ve some relatively simple code that I want to convert from opengl. Anyone lend a hand? glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); glPushMatrix(); glMultMatrixf(m); // m is a known matrix - do I need to do anything to convert from opengl to dx matrices? DrawModel(link); // A new method I wrote...no problem glPopMatrix(); Any help on the pushmatrix and matrix multiply would be great. Also, any help on converting an opengl matrix to dx if it''s not direct. Thanks! Onnel

Share this post


Link to post
Share on other sites
Advertisement
look at the sdk documentation:

look at SetTransform

and the D3DXMatrix... functions

Also, DX8 doesn''t have a stack by default, but there are D3DX stack helper interfaces.

Share this post


Link to post
Share on other sites
I figured to use the D3DXMatrixMultiply. Does the order of the matrices matter in this case?

I assume the stack is simply a way to store a matrix and then be able to retrieve it. If this is the case, I can simply store my existing matrix and then reset it afterwards.

Which DX matrix matches gl_modelview?

Also, do any changes need to be made to the way a matrix is stored?

Onnel

Share this post


Link to post
Share on other sites
at the risk of sounding bad... It will be worth your time to skim the documentation...

Some answers:

* multiplication order matters (always)

* stack - sure, you could store/reset...

* in DX, there is a world matrix and a view matrix (read the docs)

* no, I believe the matrix format is the same...

Share this post


Link to post
Share on other sites
O.K., I think all that matches up with what I was thinking (I knew most of it, but wanted confirmation).

I switched to using the D3D Matrix stack, but I don''t think that makes any functional difference. I noticed there was a MatrixMultiply and MultMatrixLocal..I''ll try with the Local version...

Thanks for confirming my thoughts!

Onnel

Share this post


Link to post
Share on other sites

  • 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!