4

i'm using blender for my 3D model which uses right-hand coordinate system, so when i try to import the model to my opengl engine(irrlicht, left-hand coordinate system) the mesh and animation looks inverted in x axis.

(for ex, in blender my human Model performs animations in right hand but in opengl it does it on left hand side.)

so i'm trying convert the matrices from right hand coordinate to left hand. Can any one give some guidelines to proceed ?

edit: i'm trying this for animated model like b3d etc.

genpfault
  • 51,148
  • 11
  • 85
  • 139
VivekParamasivam
  • 1,086
  • 2
  • 13
  • 23
  • Multiply it by a scale matrix where the scale for x=1.0, y=1.0, z=-1.0. Assuming the source of its l-handed vs. r-handedness comes from the Z-axis (most common). – Andon M. Coleman Dec 19 '13 at 05:14
  • thanks for your suggestion, i will try this and report here the outcome,in my case it differs on X-axis. Can you please explain how it changes coordinate system by multiplying with scale matrix. – VivekParamasivam Dec 19 '13 at 05:22
  • 4
    Anytime you invert 1 axis in a coordinate system, it changes the [chirality](http://en.wikipedia.org/wiki/Chirality_(mathematics)). Effectively, since you cannot rotate or translate your way into a different chirality (***handedness***), the only other option is to flip an axis (and a scale matrix can do just that). – Andon M. Coleman Dec 19 '13 at 05:42

3 Answers3

1

Here is a quite thorough explanation, "Converting Between Coordinate Systems" by David Eberly, https://www.geometrictools.com/Documentation/ConvertingBetweenCoordinateSystems.pdf

jparimaa
  • 1,964
  • 15
  • 19
  • 3
    Link-only answers are not good answers in SO and are frowned upon; it doesn't really answer the question. Please take the time to summarize the key points so that if/when the external link stops existing your answer will still be useful to everyone else. – code_dredd May 21 '18 at 01:03
  • Vivek's right though: answers.unity3d.com/storage/temp/12048-lefthandedtorighthanded.pdf does look useful. – WillC Oct 25 '18 at 14:18
  • The document is "Converting Between Coordinate Systems" by David Eberly, available at https://www.geometrictools.com/Documentation/ConvertingBetweenCoordinateSystems.pdf – jparimaa Nov 14 '19 at 12:15
1

hi all thanks for your suggestions , i found a clear explanation in the below link , an finally i managed to get it right.

Changing a matrix from right-handed to left-handed coordinate system

Community
  • 1
  • 1
VivekParamasivam
  • 1,086
  • 2
  • 13
  • 23
  • Link-only answers are not good answers in SO and are frowned upon; it doesn't really answer the question. Please take the time to summarize the key points so that if/when the external link stops existing your answer will still be useful to everyone else. – code_dredd May 21 '18 at 01:03
0

Assuming that you are exporting an obj file, there are options for that in the lower-left corner when you are inside the file browser, just use them as you wish, it will adapt the orientation automatically before writing the obj file to disk.

user2485710
  • 9,451
  • 13
  • 58
  • 102
  • thanks for your suggestion , but i'm trying this for animated model like b3d etc. File browser you specified is in blender ? – VivekParamasivam Dec 19 '13 at 05:26
  • 1
    @user2331860 this is the file browser window http://wiki.blender.org/uploads/c/c6/File-savewindow.png , regarding your file format I have never used it, but often times this options are similarly exposed by the exporter plugin, you should also refer to the documentation for the plugin that you are using . – user2485710 Dec 19 '13 at 05:28