【问题标题】:Three.js FBX Binary format not supportedThree.js FBX 二进制格式不支持
【发布时间】:2016-08-31 07:20:27
【问题描述】:

我正在一个基于 javascript 的移动应用程序中使用three.js。我正在为 3D 模型使用 .fbx 文件。但它不支持 FBXLoader 中的二进制格式。我不太了解 3D 模型和格式。任何帮助,将不胜感激。

控制台错误: FBX加载器:!!!不支持 FBX 二进制格式!!!

这是我加载 fbx 的代码:

    var loader = new THREE.FBXLoader( manager );
    // alert(loader);
    loader.load( 'img/watcher.FBX', function( object ) {
alert(object);
      object.traverse( function( child ) {

        if ( child instanceof THREE.Mesh ) {

          // pass

        }

        if ( child instanceof THREE.SkinnedMesh ) {

           if ( child.geometry.animations !== undefined ||     child.geometry.morphAnimations !== undefined ) {

            child.mixer = new THREE.AnimationMixer( child );
            mixers.push( child.mixer );

            var action = child.mixer.clipAction( child.geometry.animations[    0 ] );
            action.play();

          }

        }

       } );

       scene.add( object );


     }, onProgress, onError );

【问题讨论】:

    标签: javascript 3d three.js fbx


    【解决方案1】:

    如果您查看header of the javascript filehttps://github.com/yamahigashi/FBXLoaderJS' github repo,您会看到它说:ASCII 和版本 7 格式

     /**
      * @author yamahigashi https://github.com/yamahigashi
      *
      * This loader loads FBX file in *ASCII and version 7 format*.
      *
      * Support
      *  - mesh
      *  - skinning
      *  - normal / uv
      *
      *  Not Support
      *  - material
      *  - texture
      *  - morph
     */
    

    另一种方法是使用 glTF 和 FBX converter to glTF,并使用 glTF loader

    请注意,二进制 FBX 文件还有另一个问题,有时可能会导致问题。在 2016.0 中,进行了更改以支持大文件 (> 2Gb)。此更改仅影响二进制 FBX 文件格式。因为文件指针的大小不同,所以老读者无法阅读这些内容。但对于其余的,这些文件几乎是兼容的。当然这不会影响这里的 javascript 加载器,因为我是为使用 FBX SDK 的人提到的,但值得一提。

    【讨论】:

      猜你喜欢
      • 2020-06-14
      • 1970-01-01
      • 2016-04-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-14
      • 2010-09-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多