Jump to content
  • Advertisement

Archived

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

polygonsheep

Question about RH coordinate system

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

Hi, I just recently started messing around with DX8 and I''m using the .X exporter with Maya. When I create a scene in Maya and display it in my graphics engine (as a D3DMesh) all the geometry is fliped about the ZY plane. I get the same thing when loading tiny.x into my program. The word "Microsoft" on her shirt is backwards. This is the same result as loading tiny.x into the OptimizedMesh example. However if you load tiny.x into the SkinnedMesh example the shirt displays properly. I assume it''s because SkinnedMesh is using a RH coordinate system? However, I have been unsuccessful at converting my program to RH. Any suggestions? Since the tiny.x file looks different in each example program, maybe SkinnedMesh is loading the file differently or rearranging the vertices? Basically, I''m just interested in getting the geometry I see in Maya to match what''s in my program. Should I convert my program to RH (if so, how?) or change the .X extractor to arrange the vertices differently? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Hmmm, ok, so I just changed all my LH functions to RH and set D3DRS_CULLMODE to D3DCULL_CW instead of D3DCULL_CCW. Now everything displays properly. Is that all I needed to do to convert to a right handed system?

BTW, why is the default left-handed for DirectX? I know of no other APIs, programs, or school classes that use a left handed system. MS just wants to be "special"?

Share this post


Link to post
Share on other sites
quote:
Original post by polygonsheep
Hmmm, ok, so I just changed all my LH functions to RH and set D3DRS_CULLMODE to D3DCULL_CW instead of D3DCULL_CCW. Now everything displays properly. Is that all I needed to do to convert to a right handed system?

BTW, why is the default left-handed for DirectX? I know of no other APIs, programs, or school classes that use a left handed system. MS just wants to be "special"?


I believe it has to do with OpenGL using the RH system, and DX trying to make itself imcompatible as much as possible with it (to help make sure everyone keeps with their systems), same thing behind the win32 libraries etc.

Share this post


Link to post
Share on other sites
the left handed system does make a bit of sense when you consider how it applies to screen coordinates. i.e. the x runs across the screen, y up and down and the z into the screen.

that said tho, coming from an engineering backgroud i tend to prefer a right handed system with the base reference frame rotated so that the z axis represents ''up''.

if you want to keep the LH system, i also remember that to convert from 3dsmax to directx friendly one needs to swap the z and y coordinates as they are being loaded. (i cant remember if, or which, coordinates need to be ''negatived'', or whether culling order is reversed; easy to play with tho.

Share this post


Link to post
Share on other sites
You may also want to consider that when rendering in hardware, some drivers are lazy implemented and prefer a LH system. I started using RH, but some drivers (like my gf3) need then negative fog values and things like that, so if you have the choice, use LH.

- thomas

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!