Godot: XYZ-Axis consistency in 2D and 3D

Created on 30 Mar 2018  路  10Comments  路  Source: godotengine/godot

Godot version: 3.0.2.stable.costum_build

OS/device including version: Linux Mint 18.3

I would like more consistency between 2D and 3D in the editor, and as I checked lately, most game engines handle axis-composition their own way.

In Godot, Unity and Banshee (&Maya) in 3D-space the Y-axis is vertical, while in Torque, Unreal-Engine and CryEngine (&Blender and 3DStudio) Z-axis is vertical in 3D.
In Unity positive-Z is facing away from the camera, while in Godot and Banshee the Z-axis is facing towards the camera.
In Unreal-Engine positive-Y faces towards the camera, while in Torque and CryEngine positive-Y faces away from the camera.

The same in 2D: Godot and Torque have positive-Y downwards while Unity has positive-Y upwards.

We should really discuss which way is the most logical and intuitive to learn and work with and also consistent between 2D and 3D.

My suggestion is:
3D:
X: horizontal, facing positive to the right
Y: horizontal, facing positive away from the camera
Z: vertical, facing positive upwards
2D:
X: horizontal, facing positive to the right
Y: vertical, facing positive upwards
(optional virtual-Z for 2.5D-games facing positive _towards_ the camera, good for top-down and generic)
maybe alternative 2D option:
X: horizontal, facing positive to the right
Z: vertical, facing positive upwards
(optional virtual-Y facing positive _away from_ the camera, good alternative for 2.5D-platformers)

virtual axis could be linked to 0.1X and 0.1Y/Z and maybe +/- 0.01scale.

please discuss, because I think it is the very foundation of any 2D/3D-engine/game engine/content creation application.

archived

Most helpful comment

2D:
X > 0: Right
Y > 0: Up

agree so far

3D:
X > 0: To the camera
Y > 0: Right
Z > 0: Up

also agree, but I prefer turning the coordinate-system for X > 0: right, so it's consistent to the 2D-view top down.
Front view:

3D:
X > 0: Right
Y > 0: Away from the camera
Z > 0: Up

thanks for the link

All 10 comments

Always thought it was dumb. You got it from math use it as math does.

2D:
X > 0: Right
Y > 0: Up

3D:
X > 0: To the camera
Y > 0: Right
Z > 0: Up

http://mathworld.wolfram.com/CartesianCoordinates.html

2D:
X > 0: Right
Y > 0: Up

agree so far

3D:
X > 0: To the camera
Y > 0: Right
Z > 0: Up

also agree, but I prefer turning the coordinate-system for X > 0: right, so it's consistent to the 2D-view top down.
Front view:

3D:
X > 0: Right
Y > 0: Away from the camera
Z > 0: Up

thanks for the link

In 2D applications having the Y increasing going down is really common, and I for one would prefer it stay consistent here in Godot.

In 2D applications having the Y increasing going down is really common, and I for one would prefer it stay consistent here in Godot.

But where is the consistency when switching to 3D?
In Godot you would have to turn the camera upside down to have the Y-axis increase downwards.

Wait a sec...

I just realized in Godot the vertical axis is Z increasing downwards.
The transition-message in the lower left-hand corner of the viewport lists it as Y-axis increasing upwards.
anyone else seeing this or is it just me?
I'll be back tomorrow, just checking this...

I'm back already...

The gizmos (commonly X=red, Y=green, Z=blue with the arrows pointing at > 0)
the translation message in the viewport
and the default-gravity-vector in project settings
indicate that in 3D the Y-axis is vertical increasing upwards

while the Inspector indicates that the Z-axis is vertical increasing downwards!

WTF Godot??? please fix that!

also: since when is vertical increasing downwards?
if the object rises, the number must rise as well, it's only logical.
the only exception to that rule, that I know of, is the display refresh, when the pixel jumps one row downwards when having reached the end of a row, but that's not common real-world logic.

@TrickMe Well, in the inspector, _increasing Y_ (the second coordinate) of the transform/translation property moves the body _up_, at least on my end. Are you sure none of the object's parents are rotated?

For 3D, Godot follows OpenGL convention which is Right hand coordinate system. Camera normally points to -Z.

http://docs.godotengine.org/en/3.0/tutorials/3d/introduction_to_3d.html?highlight=coordinate#coordinate-system

For 2D I think it's Left hand with Z points toward the player. This is how most applications work by default. I am against changing it. (Photoshop, GIMP etc.)

http://docs.godotengine.org/en/3.0/tutorials/math/vector_math.html?highlight=coordinate#coordinate-systems-2d

Related: #2980


https://www.khronos.org/opengl/wiki/Coordinate_Transformations

The recommended convention (used in most 3D software) is to define your model/scene in a right-handed coordinate system.

[...] eye coordinates, which are defined relative to the viewer such that the X axis is horizontal and increasing to the right, Y is vertical and increasing upwards, and Z is horizontal and increasing directly towards the viewer. These are then finally transformed into normalized device coordinates and mapped to pixels on the user鈥檚 display.

@Noshyaar explained it perfectly. This should be closed and any further requests to change how axis work should point to this issue

@bojidar-bg The parent node was indeed rotated (I was playing around too much in my first try-project)
Thanks a lot, I would never have cought that on my own.

@Noshyaar I know what left-hand and right-hand coordinate systems are, UE4 uses left-hand Z-up, X-right, Cryengine uses right-hand Z-up, x-right, Godot uses right-hand Y-up, X-right.
What Godot is lacking is consistency between 2D and 3D, when switching between 2D and 3D you always have to wrap your brains around the fact that the sign of Y is changing, unless you turn the camera upside down.
If you have a link to a Khronos-page that explaines why Godot's coordinate systems are common in openGL, it would be more useful than a book-ad explaining right-left-hand.

What I'm suggesting is not a left-hand coordinate system but a right-hand with Z-up and X-right in 3D, and switching the sign of Y in 2D.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RebelliousX picture RebelliousX  路  3Comments

mefihl picture mefihl  路  3Comments

SleepProgger picture SleepProgger  路  3Comments

rgrams picture rgrams  路  3Comments

timoschwarzer picture timoschwarzer  路  3Comments