Archived

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.

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 on other sites
D3D can be lefthanded or righthanded, as far as I know.

¬_¬

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

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

Kamikaze

Share on other sites
thanks but that doesnt answer my question. i am using a left handed system. and besides im not using those look at functions

Share on other sites
From the DX SDK docs:

quote:

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.

1. 1
2. 2
Rutin
23
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 23
• 11
• 11
• 9
• Forum Statistics

• Total Topics
631766
• Total Posts
3002233
×