Right-Hand model to Left-Hand mode problem?

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.

Right-Hand model to Left-Hand mode problem?

Postby likewater » Tue Apr 19, 2016 9:42 am

There is a model file , came from the right-hand system, and the 3d format is ply.
Now I load in Irrlicht to show! and rotation itself by Y axis, but the result is rotation a cycle.

I review the source code, see the ply loader make the right-hand to left-hand is just do as:
Y_lefthand = Z_righthand
Z_lefthand = Y_righthand,
but this is equally rotate the X axis 90 degree.
so I do the Y axis rotation, make the model the trial is cycle!

How can I sole the problem? any body can help?

here are the some article to descript the same problem!
http://stackoverflow.com/questions/1263072/changing-a-matrix-from-right-handed-to-left-handed-coordinate-system
http://irrlicht.sourceforge.net/forum/viewtopic.php?f=4&t=49419

but I did't get the right result in the irrlicht
likewater
 
Posts: 4
Joined: Tue Apr 19, 2016 7:52 am

Re: Right-Hand model to Left-Hand mode problem?

Postby REDDemon » Tue Apr 19, 2016 12:31 pm

Changin coordinate system is simple, however you need to take a bit of care for rotations,
I published the algorithm for doing that (however right know seems that the publisher site is down for maintenance, I'll link that in near future).

I think the PLY code is bugged because makes the wrong conversion, after swapping 2 axis you should also invert the related rotations by sign.

In example imagine a clock, the pointers of the clock are going clockwise around the XY plane, if you put a vertical mirror on the ZX plane you'll still see the clock, but this time it is going anticlockwise.

Swapping 2 axis or mirroring an axis should be always paired with a change in rotation sign.

Try to mark the 12 on the clock with GREEN and the 3 with RED, if the arrow is moving towards red, if you swap XY you will have RED and GREEN swapped, but the arrow should still have to go towards RED, so you have to invert the rotation again.

Euler angles are a bit tricky in changing coordinate system, Quaternions are much easier.

It would be of help to show a model inside the 3D editor (how you expect it to be displayed, screenshot the whole editor window) and show how actually it is showed inside irrlicht)
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
User avatar
REDDemon
Developer
 
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Right-Hand model to Left-Hand mode problem?

Postby likewater » Wed Apr 20, 2016 7:20 am

@REDDemon,
thanks!

I slove this problem, just for get the result!
In the right-hand coordiante system, no problem!
when change the Y&Z, so the camera do the same ,change the up and lookat and rotate axis
get the result!
likewater
 
Posts: 4
Joined: Tue Apr 19, 2016 7:52 am

Re: Right-Hand model to Left-Hand mode problem?

Postby REDDemon » Thu Apr 21, 2016 2:47 pm

of course when you change coord system you have to keep consistent with it. good :)
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
User avatar
REDDemon
Developer
 
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)


Return to Everything 2d/3d Graphics

Who is online

Users browsing this forum: No registered users and 1 guest