Qhimm.com Forums
Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: mirex on 2002-09-26 11:25:07
-
One technical question here. Let there be a 3d coordinate system with axes x,y,z. Which way is up, front, left and so on ?
I think it is like Z+ = up, X+ = forward, Y+ = left; but im not sure if it is ok. Because I've seen also a system with Y- = up (it does not make any sense to me).
And also, how about rotations in this system, where is 'direction zero', and how should rotations be performed ?
(My opinion: zero = X+, Heading = XYplane, Y+=90; Pitch = XZ, Z+ = 90; Roll = YZ, Y- = 0, Z+ = 90; order of rotations is Roll Pitch Heading )
-
I think that usually, X is left-right, Y is up-down, and Z is forward-back. Not sure.
-
I think it depends on which coordinate system you are using.
In our "normal" coord systems, it *should* be like Aaron said:
X: left/right
Y: up/down
Z: forward/back
In a mathematical coord system, I think it is as you said, mirex...
However, not sure after all...
- Alhexx
-
In a "standard" right-oriented coordinate system, x+ is right, y+ is up, and z+ is towards you. Right-oriented means that if you walk from X+ to Y+ to Z+, you will move counter-clockwards. This is the normal mathematical coordinate system, but as you can see, your suggested coordinate system is also right-oriented (a rotated version of the standard). Usually 3D engines use the standard, but then again it doesn't really matter since you can simply rotate the camera and voila!, things move like your coordinate system.
By "direction zero", I'm guessing you're asking which way the default view is oriented if you feed a 3D engine (0,0,0) as rotation values. This I do not know, but if you're looking at the above-mentioned coordinate system, you're looking into Z-.
Rotations (pitch,yaw,roll) would then be defined as follows: pitch = rotation around X, yaw (heading) = rotation around Y, and roll = rotation around Z. Positive rotation would be defined as counter-clockwise movement if you saw it from the positive side of the axis. But as I said, rotation "zero" is just a matter of definition, so I guess it depends on the 3D engine.
-
Ahhh reminds me of Calculus 3...
*depends on which coordinate*
-
Ok ppl, so if you all say Y is up then I'll use it. I dont know why I got used to Z+ = up.
Thank you all ! :wink: