Sign in to follow this  
SeikoTheNoob

Billboard in left-hand coordinate system

Recommended Posts

I'm pretty new with openGL and all the 3D stuff and never been good with geometry even in 2D so my question might seems stupid. Seems the program I'm working with is using a left-hand coordinate system. So the result is of course no good. I don't really know how to change everything to match a left-hand coordinate system. Should it be a sign change somewhere? Also if it's only that, should I have a billboard facing a direction, but just not the good one? Because the result I got is worst then that! Thank you very much!

Share this post


Link to post
Share on other sites
In general conversion between left-handedness and right-handedness means to mirror an axis. The operation is a multiplication with a matrix that inverts the axis, e.g. build from a non-uniform scaling matrix
S(1,1,-1)
which means to scale the x and y axes by 1 (i.e. doing nothing) but the z axis by -1 (i.e. to invert it). The corresponding OpenGL invocation is
glScalef(1,1-1);

If all the world should be left-handed it would be sufficient to use this matrix as the very first matrix on OpenGL's MODELVIEW matrix stack when initializing rendering. If the world is right-handed but imported models are not, or imported animations are not, then the things become a bit more complicated. Furthurmore, the "program" you mention may have another assigment of the x,y,z axes, too, so an additional rotation may be needed. Perhaps you need the mirroring about another axis than z. Perhaps ...

So the problem is required to be investigated in more detail if the above principle description isn't sufficient for you. Then start e.g. with the assigment of the up, forward, and side vectors to the x, y, and z vectors in both the program and the wanted set-up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this