Jump to content
  • Advertisement
Sign in to follow this  
foxbat

up axis convention

This topic is 3493 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would like to know whether there is any particular convention in games for world coordinate setup; i.e which axis to use for 'up' and 'forward' directions. I've noticed that engines such as Quake, CryEngine 2, Unreal and Torque all seem to define the +ve Z axis as up, but I've also seen other engines where a Y axis up vector is used. I know that it makes no difference to the engine internally, but is there any particular standard which artists prefer or expect?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by foxbat
I would like to know whether there is any particular convention in games for world coordinate setup; i.e which axis to use for 'up' and 'forward' directions.

I've noticed that engines such as Quake, CryEngine 2, Unreal and Torque all seem to define the +ve Z axis as up, but I've also seen other engines where a Y axis up vector is used. I know that it makes no difference to the engine internally, but is there any particular standard which artists prefer or expect?
There is no set, or even preferred, standard (at least as far as I'm aware). Different game engines and modeling packages use different conventions (a few even allow you to choose which axis is treated as up).

I've never seen 'x' used as up, but 'y' and 'z' seem to be treated as up with about equal frequency. Personally, for simulations with a strong 2-d component (e.g. an FPS), I prefer 'z-up', since that places many of the computations that you'll want to perform in the XY plane.

Share this post


Link to post
Share on other sites
Both z-up and y-up have decent rationales behind them:
  • z-up makes sense for architects, etc. because plans are 2d, and have an x and y axis already.
  • y-up makes sense from a traditional 2d graphics background, where x and y are the screen axes, and z is then into (or more often, out of) the screen.
For a 2d game, you probably want to use x and y as your primary axes, and then z becomes solely an artefact of the transition to 3d graphics.

For a 3d game it really doesn't matter, use whatever feels more comfortable - but don't piss off your team members: on a project I worked on a while back, the initial coders had not communicated well, so that the 2d component of the game used x and y coordinates, and the 3d component used a y-up, requiring a translation from x,y to x,z in the opposite handed-ness [grin]

Share this post


Link to post
Share on other sites
Yup, there's no standard.

To add to the list, Valve uses Z as up as well.

At my school, we are taught 2D graphics, and then naturally we all took the Z as the depth value. It all works out the same, as long as you are consistent and make a conscious descision early with your team members! :)

Share this post


Link to post
Share on other sites
One other small advantage to having Z as up is that positive Y becomes forward. Thus, you use positive values for forward, without having to resort to a left-handed coordinate system.

Share this post


Link to post
Share on other sites
Heh, I just checked a couple of modelling tools.. Blender uses +Z up and Maya uses +Y up. I personally like the +Z up in any situation where you need the concept of an overhead map. In general if the game can be presented on a plane it makes sense to think of that plane as the XY.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fingers_
Heh, I just checked a couple of modelling tools.. Blender uses +Z up and Maya uses +Y up. I personally like the +Z up in any situation where you need the concept of an overhead map. In general if the game can be presented on a plane it makes sense to think of that plane as the XY.
If you are writing an exporter/converter, the option to flip axes is a must [smile]

Share this post


Link to post
Share on other sites
Quote:
Original post by Fingers_
Heh, I just checked a couple of modelling tools.. Blender uses +Z up and Maya uses +Y up. I personally like the +Z up in any situation where you need the concept of an overhead map. In general if the game can be presented on a plane it makes sense to think of that plane as the XY.


3DS max is Z up too.
But it seams that most of game programmers I talk to prefer Y up. And I think this comes from maths courses at university. (I was doing 3d programming before that, so I didn't get assimilated hehehe)

Share this post


Link to post
Share on other sites
Quote:
Original post by n00body
One other small advantage to having Z as up is that positive Y becomes forward. Thus, you use positive values for forward, without having to resort to a left-handed coordinate system.


But that assumes that the left-handed system is somehow more "right" than a right-handed one, which is wrong. Confusing eh?

The point is, as the OP alludes, its all a matter of convention whether Y/Z or even X is up -- you could call them A, Q and an unpronounceable alien vowel and it wouldn't make a lick of difference. Same goes for handedness, just be consistent and know how to convert between them as necessary.

Share this post


Link to post
Share on other sites
Let me clarify. I wasn't making a statement about how right or wrong left-handed systems are versus right-handed systems. I was merely making an FYI point about one reason he might consider such a system.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!