Jump to content
  • Advertisement


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


Left handed vs right handed

This topic is 5735 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 Im converting an engine from GL to D3D and im having an issue with the coordinate system. What exactly should I be doing to convert my geometry and transformations from OpenGL, which i believe is right handed, to D3D which is left handed. thanks any help is greatly appreciated.... -Tom

Share this post

Link to post
Share on other sites
DirectX has functions to operate with both
right handed and left handed.

D3DXMatrixLookAtRH() //Right handed
D3DXMatrixLookAtLH() //Left handed


Share this post

Link to post
Share on other sites
From the DX SDK docs:


Microsoft® Direct3D® uses a left-handed coordinate system. If you are porting an application that is based on a right-handed coordinate system, you must make two changes to the data passed to Direct3D.

Flip the order of triangle vertices so that the system traverses them clockwise from the front. In other words, if the vertices are v0, v1, v2, pass them to Direct3D as v0, v2, v1.
Use the view matrix to scale world space by –1 in the z-direction. To do this, flip the sign of the _31, _32, _33, and _34 member of the D3DMATRIX structure that you use for your view matrix.
To obtain what amounts to a right-handed world, use the D3DXMatrixPerspectiveRH and D3DXMatrixOrthoRH functions to define the projection transform. However, be careful to use the corresponding D3DXMatrixLookAtRH function, reverse the backface-culling order, and lay out the cube maps accordingly.

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!