XYZ coordinates

Discussion about everything. New games, 3d math, development tips...
Post Reply
MarcinS
Posts: 25
Joined: Tue Feb 17, 2009 3:14 pm
Location: Poland

XYZ coordinates

Post 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 ;]
rooly
Posts: 224
Joined: Tue Oct 25, 2005 4:32 pm
Location: Louisiana, USA, backwater country
Contact:

Post 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.
When banks compete, you win.
When ISPs compete, you win.
When electronics retailers compete, you win.
When governments compete...you get drafted.
Pyritie
Posts: 120
Joined: Fri Jan 16, 2009 12:59 pm
Contact:

Post 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
Hive Workshop | deviantART

I've moved to Ogre.
agi_shi
Posts: 122
Joined: Mon Feb 26, 2007 12:46 am

Re: XYZ coordinates

Post 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.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post 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:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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:
MarcinS
Posts: 25
Joined: Tue Feb 17, 2009 3:14 pm
Location: Poland

Post 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
Pyritie
Posts: 120
Joined: Fri Jan 16, 2009 12:59 pm
Contact:

Post by Pyritie »

Why does irrlicht use the left-handed system anyway? Isn't the right-handed one much more popular?
Hive Workshop | deviantART

I've moved to Ogre.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
MarcinS
Posts: 25
Joined: Tue Feb 17, 2009 3:14 pm
Location: Poland

Post 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
roelor
Posts: 240
Joined: Wed Aug 13, 2008 8:06 am

Post by roelor »

I am used to Z as height as I usually created topdown games.
Post Reply