Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information about 3D asset direction conventions to "Importing 3D scenes" #7406

Merged
merged 1 commit into from
May 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tutorials/assets_pipeline/importing_scenes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,33 @@ Copy the scene file together with the textures and mesh data (if separate) to
the project repository, then Godot will do a full import when focusing the
editor window.

3D asset direction conventions
------------------------------

Godot uses a right-handed, Y-is-up coordinate system, with the -Z axis as
the camera's forward direction. This is the same as OpenGL. This implies
that +Z is back, +X is right, and -X is left for a camera.

The convention for 3D assets is to face the opposite direction as the camera,
aaronfranke marked this conversation as resolved.
Show resolved Hide resolved
so that characters and other assets are facing the camera by default.
Comment on lines +36 to +40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is confusing me (and making me realize my 3D teachers in college taught even less than I thought, which wasn't much). What exactly is "the camera" that you're referring to here? I assume it's not one you would attach to a player character

Copy link
Member Author

@aaronfranke aaronfranke May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skyace65 Does this image help you understand?

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be paraphrased as a viewpoint of the viewport.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the camera in this case would be the viewport camera when you a open a blank scene?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In most cases, yes.

This convention is extremely common in 3D modeling applications, and is
`codified in glTF as part of the glTF 2.0 specification <https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#coordinate-system-and-units>`.
This means that for oriented 3D assets (such as characters),
the +Z axis is the direction of the front, so -Z is the rear,
+X is the left side, and -X is the right side for a 3D asset.
In Blender, this means that +Y is rear and -Y is front for an asset.

When rotating an oriented 3D asset in Godot, use the ``use_model_front``
option on the ``look_at`` functions, and use the ``Vector3.MODEL_*``
constants to perform calculations in the oriented asset's local space.

For assets without an intrinsic front side or forward direction, such as
a game map or terrain, take note of the cardinal directions instead.
The convention in Godot and the vast majority of other applications is
that +X is east and -X is west. Due to Godot's right-handed Y-is-up
coordinate system, this implies that +Z is south and -Z is north.
In Blender, this means that +Y is north and -Y is south.

Exporting glTF 2.0 files from Blender (recommended)
---------------------------------------------------

Expand Down