` I am following the “Squash the Creeps” project step by step and while scripting player movement, we set ‘z’ direction value to “-1” in order to make the player move forward.
I ctrl+clicked the Vector3D component and indeed it says “FORWARD = Vector3(0, 0, -1)” so the ‘z’ parameter is, indeed, -1 for forward movement. But why?
I understand 2D space, as 0, 0 on a monitor starts from the top-left corner so as you go down, y value increases. This makes sense. But why is this a thing in 3D space? Could someone please clarify this? Thanks a lot in advance and have a nice day! `
So was it just an arbitrary decision? Could they just as well pick +z as forward direction and if so, why didn’t they? I read the documentation page you linked to but it doesn’t say anything about why -z was chosen as forward direction.
The documentation even says: “Imagine you need to shoot a bullet in the direction your player is facing. Just use the forward axis (commonly Z or -Z).”
So they could in fact choose z as forward direction but they didn’t and my funny brain wants to know why
Yes infact they could have chosen anything as the forward direction.
AFAIK Godot only used to have OpenGL for rendering before. So they adapted their directions as it says in the docs
Following the OpenGL convention, X is the Right axis, Y is the Up axis and Z is the Forward axis.