-
Why is Bevy's coordinate system right-handed y-up? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Beta Was this translation helpful? Give feedback.
-
I feel the need to answer this, since working with coordinate systems was the second most annoying thing in Bevy I encountered last project (the most annoying by far was delayed transform propagation). I actually had 4 different coordinate systems in one project. Bevy as game engine, blender as asset editor (from which I can't simply copy displayed XYZ coordinates to bevy). And then, since it was a robotics project, there're two standards, NED and ENU, because americans can't possibly agree with europeans on anything related to standards, and I had to use both to interop with different things. The most natural system (for me at least, but hopefully many agree) is: X forward, Y right, Z up. Is that what Unreal does? If so, I can very much respect them picking usability choice over legacy support. X forward, Y right, Z up is great, very intuitive, with a small downside. It's left handed. Is it actually a downside? What does chirality change actually? You need to flip cross-products (including normals), and that's about it. If you don't want to do that, maybe consider compatibility with 3d modeling tools. X forward, Y left, Z up (or Y forward, X right, Z up) is going to be at least compatible with Blender, which has XY as ground plane. It is a bit annoying in yaw/pitch/roll calculations, but at least it removes coordinate transforms from blender imports (that's probably the most widely used 3d editor nowadays). I seriously can't understand Y being vertical. For 3D it is natural to have XY as ground plane. For 2D it is natural to have XY as screen plane. Only difference here is camera rotation: for 2D it looks towards -Z, and for 3D first-person shooter it would look towards X. And finally, the coordinate system I'm considering to use nowadays is: X forward, Y right, Z down. This corresponds to a standard in robotics called NED (North-East-Down). It is right handed, it has natural XY. Z is inverted to preserve chirality, but that's easy to get used to. |
Beta Was this translation helpful? Give feedback.
This can be broken up into two questions, but the optimal solve requires considering both:
This really only comes down to these choices (from the perspective of our current right handed coordinate system):