Odejava axes

The ode docs describe the z axis as being vertical. It would be most useful for me to use y as the vertical axis, as this would corespond the the axis alignment with JOGL. It seems to me that there is nothing in ODE that depends on the z axis being vertical, so using Y as the vertical axis should be a simple matter of setting a gravity of (0, -9.8, 0).

Am I right in thinking this? Are there any problems with using this coordinate system?

Mark McKay

There shouldn’t be. :wink: Imagine, you have a space game, then you actually don’t specify, where up is, so there is no problem.

JOGL (and LWJGL since they are bound by OpenGL standards) can have any axis as up, any axis as left, any axis any axis as directional, the default is Y being up. Mathmatically, Z should be up. Imagine viewing a piece of graph paper on your desk with Y going up the paper, X left/right, that leaves Z to be up.

Some people prefer Y as up, others make it as Z. I think most physics calculations that need to know the axis (can’t think of any off the top of my head) assume Z as up tho.

DP

Well, Y up is the coordinate system my 3D modeling package uses, so it’s probably easies to keep that convention. It does make some sense, since the XY plane can corespond to the viewport.

I’ve been looking through the red book, but can’t find anything about changing coordinate systems. How does one do this?

Mark McKay

You don’t need to change the coordinate system. simply code as if y were up, even if the ode docs say differently. Just think for what function would one need to have to specify where up is? Gravitation? There you simply set the gravity to (0,-9.8,0) - so no problem . Other functionalities ? … None.

No, I mean how would I adjust the coorinate system in JOGL? Not that I’m going to do this, I’m just interested from a curiosity point of view.

I dont’ know how to do that in JOGL.
The only thing I know is when you adjust the camera settings in Xith3D (that has a JOGL renderer) you have one parameter that specify the up axis : e.g. 0,0,1 for Z or 0,1,0 for Y

Actually it’s all about matrices. To change your coordinate system, you can simply create a matrix with which you can multiply all the positions and stuff in your current coordinate space, to transform it into the new coordinate space.
This thing, where you set, where up is in Xith is actually also only creating such a matrix. As example you could (I also do, hehe) use this function Bluesky described for the view, also for any other transformation of geometry.