Skip to content

Coordinate system mismatch between Bevy and glTF #5670

Open
@pkupper

Description

@pkupper

Bevy version

0.8.0

What you did

  1. Spawn entity from glTF scene with recognizable forward direction (e.g. character, vehicle).
  2. Transform the entity along the Transform::forward() direction.
  3. 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:

Possible solutions

  1. glTF importer negates X and Z coordinates during import (breaking change for all bevy apps that use glTF import).
  2. Bevy Transform is changed to follow the glTF convention (breaking change for all bevy apps that use one of the Transform's direction functions).
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AssetsLoad files from disk to use for things like images, models, and soundsA-TransformTranslations, rotations and scalesA-glTFRelated to the glTF 3D scene/model formatC-BugAn unexpected or incorrect behaviorD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions