Skip to main content
gamedev.net
🔒 Locked

Axis conversion

Started by rajesh_nest 0 replies 450+ views
Original Post
rajesh_nest
rajesh_nest
I am using a Graphics Library(not necessarly opengl or D3DX) which follows LHS (Left hand coordinate system). I wish to convert the library's coordinate system to RHS. In first place, can I do this? If so,What are the issues and dangers(if any), involved in such a coordinate conversion.
Zakwayda
Zakwayda
Quote:
Original post by rajesh_nest

I am using a Graphics Library(not necessarly opengl or D3DX) which follows LHS (Left hand coordinate system). I wish to convert the library's coordinate system to RHS.

In first place, can I do this? If so,What are the issues and dangers(if any), involved in such a coordinate conversion.
In OpenGL and D3D at least, the difference between the coordinate systems really comes down to how the basis vectors are oriented in the local space of the camera. In OpenGL, the x, y, and z vectors point right, up, and back, respectively, and in D3D they point right, up, and forward.

This only affects a few transform types (that I can think of at the moment at least): 'look-at' matrices, and the various projection matrices. (Note that the OpenGL and D3D projection matrices also differ with respect to how they handle the canonical clipping volume, but this is unrelated to coordinate system handedness.)

Other transform types - scaling, reflection, translation, rotations in matrix and quaternion form, etc. - are not affected by handedness. However, you may need to modify some of these transforms when *switching* from one handedness to another if you want the apparent visual effects to remain the same. (Other things may need to be changed as well, such as signs of rotation angles and polygon winding orders.)

I'm not sure though what you mean by 'convert the library's coordinate system to RHS'. Do you mean modify its source code? Or just interface with it in a different way? Can you tell us what library it is?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.