Handedness Confusion
by William Todd Scott · in Torque Game Engine Advanced · 12/02/2007 (2:11 pm) · 5 replies
Hi,
I have managed to confuse myself on whether Torque is left or right handed. I am hoping someone can read this and set me straight.
I believe that Torque uses a right-handed coordinate system rotated 90 degrees around the X-axis. So, we start with the x-axis to the right, y-axis pointing up, and z-axis pointing out of the screen. We rotate 90 degrees around the x-axis and we get y-axis pointing into the screen and z-axis pointing up. This rotation is done in the projection matrix sent to the graphics card.
However, in audio.cpp there is a comment that OpenAL uses a right-handed coordinates system and, as a result, the torque matrix has to be converted from left-handed to right-handed. Additionally, the rotations I am applying do appear to be happening in a left-handed manner.
Can someone clarify if TGEA is left or right handed (and why the rotations seem to be left-handed).
Thanks for the help.
Todd
edited for typos
I have managed to confuse myself on whether Torque is left or right handed. I am hoping someone can read this and set me straight.
I believe that Torque uses a right-handed coordinate system rotated 90 degrees around the X-axis. So, we start with the x-axis to the right, y-axis pointing up, and z-axis pointing out of the screen. We rotate 90 degrees around the x-axis and we get y-axis pointing into the screen and z-axis pointing up. This rotation is done in the projection matrix sent to the graphics card.
However, in audio.cpp there is a comment that OpenAL uses a right-handed coordinates system and, as a result, the torque matrix has to be converted from left-handed to right-handed. Additionally, the rotations I am applying do appear to be happening in a left-handed manner.
Can someone clarify if TGEA is left or right handed (and why the rotations seem to be left-handed).
Thanks for the help.
Todd
edited for typos
#2
Another correction to my understanding (or lack thereof).
First, we start with a right-handed coordinate system. When creating the projection matrix the z-axis is negated, turning it into a left-handed coordinate system and then we rotate by 90 degrees around the x-axis to get the Torque coordinate system.
I think I finally got it.
One thing that has come up though, I think that there are mistakes in the creation of the projection matrix. In particular the z component of the third row should be (near + far) / (near - far) and the z component of the fourth row should be multiplied by 2.
If there is max on the number of self-replies, I'm likely to hit it with this thread. :)
Todd
12/02/2007 (9:40 pm)
One more time...Another correction to my understanding (or lack thereof).
First, we start with a right-handed coordinate system. When creating the projection matrix the z-axis is negated, turning it into a left-handed coordinate system and then we rotate by 90 degrees around the x-axis to get the Torque coordinate system.
I think I finally got it.
One thing that has come up though, I think that there are mistakes in the creation of the projection matrix. In particular the z component of the third row should be (near + far) / (near - far) and the z component of the fourth row should be multiplied by 2.
If there is max on the number of self-replies, I'm likely to hit it with this thread. :)
Todd
#3
Another correction to my understanding (or lack thereof).
First, we start with a right-handed coordinate system. When creating the projection matrix the z-axis is negated, turning it into a left-handed coordinate system and then we rotate by 90 degrees around the x-axis to get the Torque coordinate system.
I think I finally got it.
One thing that has come up though, I think that there are mistakes in the creation of the projection matrix. In particular the z component of the third row should be (near + far) / (near - far) and the z component of the fourth row should be multiplied by 2.
If there is max on the number of self-replies, I'm likely to hit it with this thread. :)
Todd
12/02/2007 (9:41 pm)
One more time...Another correction to my understanding (or lack thereof).
First, we start with a right-handed coordinate system. When creating the projection matrix the z-axis is negated, turning it into a left-handed coordinate system and then we rotate by 90 degrees around the x-axis to get the Torque coordinate system.
I think I finally got it.
One thing that has come up though, I think that there are mistakes in the creation of the projection matrix. In particular the z component of the third row should be (near + far) / (near - far) and the z component of the fourth row should be multiplied by 2.
If there is max on the number of self-replies, I'm likely to hit it with this thread. :)
Todd
#4
Thats one of the main reasons for the sometimes funny bugs in TGEA like the decal projector that projects against the roof instead of the ground and the like.
12/02/2007 (11:32 pm)
Torque is not any handed unless you clearly specify which one you mean as TGE is OpenGL and TGEA is DX which by definition have different handiness.Thats one of the main reasons for the sometimes funny bugs in TGEA like the decal projector that projects against the roof instead of the ground and the like.
#5
Thanks
Todd
12/03/2007 (9:03 am)
Ah, sorry, I am working in TGEA so that is what I meant by Torque. I should have been more specific.Thanks
Todd
Torque Owner William Todd Scott
Ignore my question/confusion.
I twist myself up every time I have to work with SDKs that use different coordinate systems....
Torque is left-handed.
Todd