Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions examples/jsm/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,24 @@ class FBXTreeParser {

sceneGraph.animations = animations;

// Apply coordinate system correction. FBX files can use different
// up-axis conventions (Y-up or Z-up). Three.js uses Y-up, so rotate
// the scene when the file uses Z-up (UpAxis === 2).

if ( 'GlobalSettings' in fbxTree && 'UpAxis' in fbxTree.GlobalSettings ) {

const upAxis = fbxTree.GlobalSettings.UpAxis.value;

if ( upAxis === 2 ) {

console.warn( 'THREE.FBXLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted.' );

sceneGraph.rotation.set( - Math.PI / 2, 0, 0 );

}

}

}

// parse nodes in FBXTree.Objects.Model
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading