Game Development Community

X, Y, Z, the book says Y is up, Torque says Z is up

by Sean Brockest · in Torque Game Engine · 02/08/2007 (3:10 pm) · 8 replies

As long as i've been doing 3d modeling and playing around in games, Z has always been up (and -Z down, of course)

I was just reading through a copy of this book i borrowed from a friend (so i dont have the CD to back up my theories), on page 90 and 91, it says that Y is the up/down dimension. Torque, 3DS max, and various others all put Z in the vertical position.

was the book written wrong, or has the standard changed or been disputed?

#1
02/08/2007 (3:12 pm)
Wait, i read further and they start to change things around.

should i just go with what i've always believed to be true, and read through these pages with a grain of salt?
#2
02/08/2007 (4:08 pm)
I would say the book is wrong. I would also say that whatever TGE thinks is up is pretty authoritative :)

That said, I would agree, Z is vertical.
#3
02/08/2007 (7:00 pm)
Normally relative to the screen, X is left/right, Y is up/down, and Z is in/out. In Torque, X is left/right, Y is in/out, and Z is up/down.

Just consider it a non-standard naming convention. It's the sort of thing that *could* be fixed, but only at the expense of having to change every resource, and code-snippet ever created for the engine.
#4
02/08/2007 (7:08 pm)
Quote:
Normally relative to the screen, X is left/right, Y is up/down, and Z is in/out. In Torque, X is left/right, Y is in/out, and Z is up/down.

That's correct, the first statement being mathematically correct too.
#5
02/08/2007 (11:26 pm)
If you thing this further, I said that Torque is keeping the standard.

You should look at it this way, you should see the axes from looking for up so you move in X/Y coordinate on the terrain and Z axis for elevation. That's a no brainer I think.

What you actually propose is that your point of view determine the axis, so if it's a FPS you get XZ Y but for a RTS you get XY Z It all depend on the plane you use as origin. So torque is correct in that matter only you view it in a FPS mode which if keepin the up/down = X right/left = Y should give you XZ Y. But the engine need a fixed coordinate system, with XY being the plane and Z the elevation.

Thing of it as if looking at a map, XY is the horizontal plane (the map) and elevation Z. Then it all become clear.
#6
02/09/2007 (11:22 am)
Believe it or not, there is no 'normal' case because there is no standard for coordinates. They differ between Max and Maya and most every 3D modelling app and game engine. It's not something that's broken, it's just how Torque chose to align its axes. The two most common configurations are x/y are height and width and z is depth, and in the other x/y are lateral and z is height. The first one is absolutely obnoxious to work with, because for most games you will be modifying x and z more often than anything else. It just makes good sense to make x and y lateral and use z for vertical.

I think the first configuration is rooted in real world art. If you're looking at a canvas, it makes sense for x and y to be across the face of the canvas and z to be into or out of it. The second makes way more sense for games.

As for the book, I haven't personally read it, so I can't offer any feedback there.
#7
02/09/2007 (4:30 pm)
I've always separated 2d and 3d in my mind

2D, X across and Y down (or up, depending on the situation)

3D, X and Y on the ground, and Z going up. left or right handed i dont care.
#8
02/09/2007 (4:37 pm)
What Thomas said.