Coordinate system confusing
by Michael Bartnett · in Torque Game Engine · 12/21/2004 (5:57 pm) · 4 replies
I'm learning TorqueScript, but a big hurdle that's preventing me from doing so is a lack of a clear explanation of how the coordinate system works with obj.setTransform and obj.getTransform.
There are 7 parameters,
I know one of those parameters is assigned to each of these:
x position
y position
z position
x rotation
y rotation
z rotation.
I can't figure out:
1. What the seventh parameter is.
2. What order the parameters go in.
3. I think (imagining in a first person perspective) that positive x moves left, positive z moves forward, positive y moves up. And when using negative values for those reverses direction, but I'm not confident, and I don't know if the values represent global positions in the world or loca offsets from the current position.
I've been looking for this for a while. I skipped ahead in the 3d Game Programming All In 1 book figuring I would understand as I progressed, but already several chapters later I'm still confused.
Any information would be deeply appreciated.
Thank you,
Michael Bartnett
There are 7 parameters,
I know one of those parameters is assigned to each of these:
x position
y position
z position
x rotation
y rotation
z rotation.
I can't figure out:
1. What the seventh parameter is.
2. What order the parameters go in.
3. I think (imagining in a first person perspective) that positive x moves left, positive z moves forward, positive y moves up. And when using negative values for those reverses direction, but I'm not confident, and I don't know if the values represent global positions in the world or loca offsets from the current position.
I've been looking for this for a while. I skipped ahead in the 3d Game Programming All In 1 book figuring I would understand as I progressed, but already several chapters later I'm still confused.
Any information would be deeply appreciated.
Thank you,
Michael Bartnett
About the author
#2
4-6 define an axis of rotation (also xyz).
7 is how far to rotate about that axis (angle).
12/21/2004 (7:20 pm)
1-3 are definately xyz position as you said.4-6 define an axis of rotation (also xyz).
7 is how far to rotate about that axis (angle).
#3
12/21/2004 (8:32 pm)
Okay, I see how that would work. When you pass it the angle to rotate by is that relative to the current angle or global?
#4
Time to experiment, right? :)
12/21/2004 (9:21 pm)
I would guess global, but I don't really know. Time to experiment, right? :)
Zod
x y z amount(in degrees)