Page 1 of 1

XYZ coordinates

Posted: Sun Feb 22, 2009 1:06 pm
by MarcinS
I have an offtopic question :) i didnt check how is it in other engines but is it common for them to use that set fo coordinates ?

http://www.knupps.net/xyz-coordinates.png

becosue in my Physics classes (studies) we use such version :

http://www.we-r-here.com/cad/tutorials/ ... z_axes.gif

and ofcourse some other wird based on circle (for 2D) and cylinder (for 3D wich is ofcourse that circle but spread in tird deminsion) etc.

it comes to my head while drinking tea ;]

Posted: Sun Feb 22, 2009 3:02 pm
by rooly
graphics engines and cards all use an X=left-to-right, Y=up-and-down, Z=in-and-out coordinate system. This is so because X is seen as the horizontal coordinates of the screen itself, Y the vertical. Z is the extra dimension and that leaves z for depth.

Posted: Sun Feb 22, 2009 3:47 pm
by Pyritie
I've seen it used both ways. Irrlicht and Milkshape, for example, treat Y as "up" but 3ds max, Warcraft 3, and several others use Z as "up".

Seems to mostly be a matter of taste than anything. :P

Re: XYZ coordinates

Posted: Mon Feb 23, 2009 1:27 am
by agi_shi
MarcinS wrote: Image

becosue in my Physics classes (studies) we use such version :

Image
Those two are the same coordinate systems. The second image is just rotated.

Posted: Mon Feb 23, 2009 1:50 am
by Acki
the 1st image shows a coord system used (e.g.) by Irrlicht...
the 2nd image shows a coord system used (e.g.) by 3DSMax...
that's the reason why you have to rotate 3ds meshes around the X axis by -90° (in most cases) !!! ;)

well, if you're using Irrlicht for the graphics (Y up) and your physics engine uses the other coord system (Z up) that shouldn't matter, as long as you use the same axis for up, left and forward...
e.g. you use Y in both engines for the up vector, then the physics world will be rotatet by 90° and also the gravity, but you will never see this because the graphics engine will show you this world correctly with Y as the visible up vector...
you understand what I mean ??? :lol:

Posted: Mon Feb 23, 2009 9:03 am
by hybrid
That would be nice, however there's not just Y-up or Z-up, but also left-handed and right-handed. And translations between the latter can be rather complicated.
The usual way is to negate one of the axes, which transforms the handedness, but it introduces many more problems: Front-facing will become back-facing and vice versa. So all faces have to change their orientation... Moreover, rotations need even more changes, so if you want tp transform right-handed animations into left-handed systems, give the ms3d loader a check, I've gathered much information from various websites and hopefully made all the necessary changes there.
BTW: Some odd people use X-up... But it's not much of a difference once you figured the other problems :wink:

Posted: Mon Feb 23, 2009 10:49 pm
by MarcinS
I see. Well i am not going to do transaltions becouse i dont need to :) but thanks for all answers :) (Now i can drink tea in peace ;] )

And did you ever thougt of that sphere made "systems" thera are very good for all hmm.. "screw like" moves

Posted: Tue Feb 24, 2009 11:50 am
by Pyritie
Why does irrlicht use the left-handed system anyway? Isn't the right-handed one much more popular?

Posted: Tue Feb 24, 2009 1:36 pm
by hybrid
I don't think so. It's at least not related to handedness of humans. Since DirectX uses a left-handed coord system it will probably depend on whether you look for games or 3d apps.

Posted: Tue Feb 24, 2009 6:58 pm
by MarcinS
Maby they use ite becouse for exmaple

for(i=10;i>0;i--) is faster then for(i=0;i<10;i++) (yes it is faster :) )

and such coordinates make it easier to use it. or i just mess something ;p

Posted: Tue Feb 24, 2009 7:03 pm
by roelor
I am used to Z as height as I usually created topdown games.