Advertisement

X,Y and Z Axis???

Started by March 12, 2004 07:10 AM
6 comments, last by Tree Penguin 20 years, 11 months ago
Hi, i always see the Y and Z axis being used as either the vertical or the depth axis. At school i learned the Z was the vertical axis and the X and Y formed the ground plane but many OpenGL apps use the Y as the vertical axis. What is the official vertical (up) axis (is there any)? Thanks
The default is x as horizontal, y is vertical, and z is depth. That''s how you''ll find it in almost every app.

Of course, it''s all relative, just rotate your camera 90 degrees and suddenly x and z become horizontal and vertical, and y becomes depth.
Advertisement
I see many programs use y as vertical, but when you look at for example 3dsmax or a map editor such as worldcraft you will see z as vertical. I think i will follow the leaders.

[edited by - Tree Penguin on March 12, 2004 8:32:48 AM]
You must understand one thing, openGL is originaly made for 2D rendering with 3D rendering attached to it, the z value is actuarly just interpolated between the vertics just like lighting and color (this is allso what causes most cases of z-fighting).

This is the way most hardware render this, as do most software APIs.
In 2D you only have XY coordinates, so if you are going to attach 3D to that then you will get Z as depth.

maya can use either y or z as vertical axis, and it is definitly better than max or worldcraft.
Frankly it doesn''t matter, if your modeler use z up then just convert it to y up, just remember the right hand rule.

---------------------------------
For an overdose of l33tness, flashbang.nu
penguin, you are right, most math courses teach the Z-axis as vertical & because I have thought this way all my life... I just rotate 90 at the start like "Evil Bachus" said, it helps me keep my sanity.
Whatsoever you do, do it heartily as to the Lord, and not unto men.
Most mathematical references that I use ( mostly mechanical science based ) use z as the "up" axis. Most graphical based references use y as the "up" axis.

Of course, this is totally trivial, as the maths is identical in either case. ( Just don''t mix the two and expect it to work! )

You have to remember that you''re unique, just like everybody else.
If at first you don't succeed, redefine success.
Advertisement
In mathematics the Z is up and in engineering the y is up (at least in the US). Being a math major in an engineering school I'm used to both

Edit: Thought I would add this in...

The first computer 3d graphics was for flight simulators, aerionotics uses the engineering method y being up.

[edited by - skow on March 12, 2004 11:40:31 PM]
The Reason Warcraft III uses x,y as the ground plane and z as horizontal is because lots of their strategy engine is based upon previous 2D releases like SC and thus its easier to do it this way and say unit is in block X,Y (Looking from the minimap) and then define Z as horizontal

If you make a 2d program X--->
Y
|
|
^
so they made sc using those type of co-ords and now when they make wc3 they use the same engine and just inplement 3d
Spy

This topic is closed to new replies.

Advertisement