Three.js: Issue with Display of fbx file

Created on 8 Feb 2019  路  12Comments  路  Source: mrdoob/three.js

Description of the problem

FBX File displayed correctly in Microsoft 3D viewer:

2019-02-08 21_50_45-modell 190207 fbx - 3d-viewer

and wrong with ThreeJS ( https://discoverthreejs.com/apps/loader/ )

2019-02-08 21_51_25-quickly load and test your models with three js

Modell 190207.zip

Three.js version

Version of https://discoverthreejs.com/apps/loader/

Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)
Loaders

Most helpful comment

Sounds like no one is actively working on trying to fix the FBXLoader so it may be a good idea to also remove it and recommend FBX2GLTF from now on...

The FBXLoader is still very useful for anybody working with DCC tools that don't have glTF exporters, since it allows quick prototyping. It's quite frustrating to have to export to FBX and then convert to glTF - for large models this process may take several minutes and prototyping often involves making many small changes. Also, as I mentioned above, the loader works fine with files from most major FBX exporters.

My recommendation when using a DCC tool that only exports FBX is to use FBX for development and glTF for production.

All 12 comments

Do you know which program this was exported from?

yes, Demo3D

@looeee why do you ask? is anything wrong in the file?

tested now with bleder, it works also correct

seems the biggest issue is the rotation wich got lost when using fbx

Can you try converting to GLTF using FBX2GLTF and loading it with the GLTFLoader?

Ah, sounds like you already did something like that. #17393

This reminds me to the Three.js Blender exporter. We never managed to get the orientation of objects robust enough and eventually we removed it.

Sounds like no one is actively working on trying to fix the FBXLoader so it may be a good idea to also remove it and recommend FBX2GLTF from now on...

Is it so hard to get the orientation from this format?

Seems like it is.

Is it so hard to get the orientation from this format?

Yeah, unfortunately. There's two official methods of specifying transforms in FBX, 3DS Max style and Maya style. You can see them outlined here.

3DS Max

WorldTransform = ParentWorldTransform * T * Roff * Rp * Rpre * R * Rpost -1 * Rp -1 * Soff * Sp * S * Sp -1

Maya

WorldTransform = ParentWorldTransform * T * R * S * OT * OR * OS

Each item in the transforms is a transformation matrix, and the whole transform has to be mapped to just two matrices in three.js: object.matrix and object.matrixWorld.

That wouldn't be so bad, except for a couple of snags:

  1. there's no way to tell which transform type is being used in a file (that I've found)
  2. there are loads of FBX exporters, and while most of them use 3DS max style some may use Maya style - and some implement the transforms incorrectly so we have to deal with bugs as well.

That's not even considering bone transforms which are equally tricky and which definitely have a few edge cases we haven't solved yet.

However, as far as I can can tell, all files from 3DS Max, Maya and Blender do work. All the bug reports we are getting here regarding transforms seem to be from other programs (Demo3D, Daz3D, Cinema4D etc.). Ideally we'll fix the loader to work for these as well at some point, but it's as likely to be bugs in the exporter as the loader so that makes these very tricky to fix.

Sounds like no one is actively working on trying to fix the FBXLoader so it may be a good idea to also remove it and recommend FBX2GLTF from now on...

The FBXLoader is still very useful for anybody working with DCC tools that don't have glTF exporters, since it allows quick prototyping. It's quite frustrating to have to export to FBX and then convert to glTF - for large models this process may take several minutes and prototyping often involves making many small changes. Also, as I mentioned above, the loader works fine with files from most major FBX exporters.

My recommendation when using a DCC tool that only exports FBX is to use FBX for development and glTF for production.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bandit picture Bandit  路  3Comments

ghost picture ghost  路  3Comments

zsitro picture zsitro  路  3Comments

makc picture makc  路  3Comments

konijn picture konijn  路  3Comments