-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsA-TransformTranslations, rotations and scalesTranslations, rotations and scalesA-glTFRelated to the glTF 3D scene/model formatRelated to the glTF 3D scene/model formatC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Milestone
Description
Bevy version
0.8.0
What you did
- Spawn entity from glTF scene with recognizable forward direction (e.g. character, vehicle).
- Transform the entity along the Transform::forward() direction.
- Observe model moving backward.
What you expected
Model moves forward.
What went wrong
Both Bevy and glTF use a right-handed Y-up coordinate system. They do however disagree on what direction is forward and right:
- glTF defines forward as +Z and right as -X (see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.pdf).
- Bevy's Transform defines forward as -Z and right as +X (see https://docs.rs/bevy/latest/bevy/prelude/struct.Transform.html#method.right and https://docs.rs/bevy/latest/bevy/prelude/struct.Transform.html#method.forward).
Possible solutions
- glTF importer negates X and Z coordinates during import (breaking change for all bevy apps that use glTF import).
- Bevy Transform is changed to follow the glTF convention (breaking change for all bevy apps that use one of the Transform's direction functions).
- Bevy stops defining a forward, back, left, right direction and leaves it up to the user (e.g. by changing the forward, back, left, right functions on Transform to local_neg_z, local_z, local_x, local_neg_x).
In any case, Bevy should be consistent regarding its coordinate system. Currently, the look_at function follows the glTF convention and not the Transform's definition of forward and right (see #1153)
Malax, Shatur, mbrc12, PikminGuts92, AlexAegis and 3 more
Metadata
Metadata
Assignees
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsA-TransformTranslations, rotations and scalesTranslations, rotations and scalesA-glTFRelated to the glTF 3D scene/model formatRelated to the glTF 3D scene/model formatC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!