godot-docs icon indicating copy to clipboard operation
godot-docs copied to clipboard

"Using 3D transforms" is misleading or wrong about the forward direction

Open neonmoe opened this issue 1 year ago • 3 comments

Your Godot version: 4.2

Issue description: The Using 3D transforms page says in a few places that positive Z is the forward direction in Godot, even though it's really seems like negative Z actually is:

  1. Why would cameras point backwards by default?
  2. Vector3.Forward at least in C# is defined as (0, 0, -1), which seems very odd, if forward is actually positive Z.
  3. If you consider a right-handed coordinate system where Y is up and X is right, Z is backwards, not forwards. To my understanding (Introduction to 3D), Godot does use a right-handed coordinate system with Y up, and I'm assuming X right, which would imply Z backward.
    • Later edit: I just noticed, the figure at the top of the article is a bit odd as well: it looks like a left-handed gizmo, and the colors don't really match what I'd expect (which would be XYZ -> RGB, like in the figure on the Intro to 3D page and in the editor, where as the figure maps it XYZ -> RBG)
  4. The docs themselves seem undecided about this, under Obtaining information ("commonly" seems like a good wording for general info about using basis vectors, but I think the docs for Godot specifically could be a bit more decided on it):

    Imagine you need to shoot a bullet in the direction your player is facing. Just use the forward axis (commonly Z or -Z).

URL to the documentation page: https://docs.godotengine.org/en/stable/tutorials/3d/using_transforms.html

I did not open a pull request yet because this might just be a misunderstanding on my part. I do have a fixed version of the figure already though, as I originally intended to open a PR, but since there's actually quite a few places where "Z" is referred to as "forward" in the article, I thought I'd ask first.

So is this actually an issue, or am I just crossing my wires here? There appears to be a few code examples on the page as well which use basis.Z as a forward vector, which simply does not look right to me, though I've not tested the snippets in-game.

I can write a PR for this, correcting the whole page to assume that negative Z is forward, if this is actually an issue as I think.

I can definitely see why this would be confusing, since Unity is probably another engine many people have used, and it uses the left-handed coordinate system where +Z is forward.

neonmoe avatar Mar 30 '24 00:03 neonmoe