DAE files image texture doesn't show up in Aframe when exported from Maya

≡放荡痞女 提交于 2019-12-17 14:24:21

问题


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.

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

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

UPDATE:

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


回答1:


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>

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. 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);
            } );

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.




回答2:


When I export my model from Cinema 4D to collada 1.5 it comes out without textures, but when I export collada 1.4 it is textured in a-frame!

Maybe this helped!



来源:https://stackoverflow.com/questions/44451617/dae-files-image-texture-doesnt-show-up-in-aframe-when-exported-from-maya

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!