从Maya导出时,DAE文件的图像纹理在Aframe中不显示 [英] DAE files image texture doesn't show up in Aframe when exported from Maya

查看:297
本文介绍了从Maya导出时,DAE文件的图像纹理在Aframe中不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从Maya中导出了带有图片纹理的.dae文件。但是当该.dae文件与Aframe一起使用时,图像纹理不会出现,您只能看到基础材质。

I've exported an .dae file with an image texture from Maya. But when that .dae file is used with Aframe, the image texture does not appear, and you can only see the base material.

我可以在Maya中使用哪些导出器会解决这个问题吗?

What exporter can I use with Maya that will fix this problem?

以下是PSD和Aframe中相同的.dae文件:

Below is the same .dae file in PSD, and Aframe:

更新:

将模型作为通过脚本运行Threejs.json可以,但是有点违反了使用AFrame的目的。
截图

Injecting the model as a Threejs.json via a script works, but kinda defeat the purpose of using AFrame. Screenshot

推荐答案

我假设您添加了collada(dae)模型,如在aframe文档中所示:

I presume You added Your collada ( dae ) model like presented on the aframe docs:

<a-scene>
  <a-assets>
    <a-asset-item id="head" src="/path/to/head.dae"></a-asset-item>
  </a-assets>
  <a-entity collada-model="#head"></a-entity>
</a-scene>

要对模型进行纹理处理,您需要:

1.制作一个引用实体材质中的纹理。
< a-assets> 中进行img参考:< img id = texture src = head.jpg > ,然后在您的实体中声明材料:

To texture the model, You either need to:
1. Make a reference to the texture in the material of the entity. In <a-assets> make an img reference: <img id="texture" src="head.jpg"> then in Your entity declare the material:

<a-entity collada-model="#head" material="#texture"></a-entity>



2.将带有纹理的模型上传到clara.io,转换将其保存到json(threejs)模型,并确保json文件中的引用正确,然后将模型加载到< a-scene> 上。我通过在已注册的
组件中放置脚本来做到这一点:


2. upload Your model with the texture to clara.io, convert it to a json(threejs) model, and make sure the references in the json file are correct, then load the model on the <a-scene>. I did it by placing a script in a registered component:

var objectLoader = new THREE.ObjectLoader();
            objectLoader.load("untitled-scene.json", function ( obj ) {
                sceneEl.object3D.add( obj );
                obj.scale.set(10,1,010);
                obj.rotation.set(0,179,0);
                obj.position.set(0,0,10);
            } );

如果问题仍然存在,请提供有关您的代码的更多信息。

注意:我经常收到.tga纹理,请确保它是.png或.jpg,如果您不使用tga加载程序,如kevinngo解释此处。但是,如果是tga问题,则头部会变成黑色,如链接中所述。

If the issue still happens, please provide more information about Your code.
NOTE: i often received .tga textures, make sure its a .png or .jpg, .tga's won't work if You won't use a tga loader as kevinngo explained here. Nonetheless if it's a tga issue, the head would be black as noted in the link.

这篇关于从Maya导出时,DAE文件的图像纹理在Aframe中不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆