0

我在 .FBX 中有一个文件,我需要在 collada 中转换它们,以便可以在 Three.js 中使用它们。我设法用 FBX Converter 转换它们,但后来我丢失了纹理。如何转换它们以便我可以使用纹理。

这是使用 FBX Converter 转换的 FBX: pearl.dae

这是我在 Maya 2013 model2.dae中导出为 FBX_DAE 的模型链接 我刚刚导入 FBX 并导出为 FBX_DAE

如果我在 Mac 上进行快速预览,在 Maya 中导出的模型具有纹理,但是当我在 Three.js 中加载它时,它没有纹理。

并且使用 FXB 转换器转换的pearl.dae 在快速预览和 Three.js 中都没有纹理

这是我的加载程序代码:

var Loader  = new THREE.ColladaLoader();
        Loader.options.convertUpAxis = true;
        Loader.load('./models/pearl.dae', function(collada){
            Bracelet = collada.scene;
            Skin = collada.skins[0];

            Bracelet.scale.x = Bracelet.scale.y = Bracelet.scale.z = 1;
            Bracelet.updateMatrix();

            init();
            render();

        });

请帮忙。

4

1 回答 1

0

I have looked over your model files, pearl.dae contains no references to any textures. You might want to double-check your FBX converter settings and any errors or warning you may get. model2.dae on the other hand does reference a texture with the relative path of "../../Model/Nialaya_perla.fbm/Perla_diffuse.jpg" (the texture is not contained within the model file itself). I don't recall if Three.JS will automatically load textures from Collada model files, but unless that path is correct it will definitely fail. In my experience with Three.JS, it's usually better to load textures, create shaders, and apply them to plain models with just code. This will also give you the greatest control over the final look.

于 2014-02-01T05:32:01.963 回答