简体   繁体   中英

Collada Loader in Three.js does not load a scene of a few objects

I'm quite new in Three.js, but the question is not trivial.

I have a Collada scene in DAE format, which in fact contains links to another DAE-files. It looks like this inside of this "parent" file:

<library_visual_scenes>
<visual_scene id="TheScene" name="TheScene">
  <node id="DesignTransform1" name="DesignTransform1" type="NODE">
    <matrix>0.87811053 0.46947187 0.0922935 19.499561 -0.46690002
  0.88294739 -0.04907337 98.835884 -0.10452887 0 0.99452192 0.28129196 
  0 0 0 1</matrix>
    <instance_node url="./first_dae/first_dae.dae"/>
  </node>
  <node id="DesignTransform2" name="DesignTransform2" type="NODE">
    <instance_node url="./second_dae/second_dae.dae"/>
  </node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#TheScene"/>
</scene>

This scene can be opened with desktop software without any problems. But when I try to load this Collada with Three.js Collada Loader it displays nothing. The same code works nice for ordinary Collada files, which do not have links to another DAE-files.

The loader looks like this:

var mesh;
var loader = new THREE.ColladaLoader();
loader.options.convertUpAxis = true;
loader.options.centerGeometry = true;
loader.load("parent_dae.dae", function (result) {
mesh = result.scene;
scene.add(mesh);
render();
});

The question is: "Does Three.js Collada Loader supports such DAE files, containing links to another DAE-files? If it does, what could be wrong with my code?"

I've opened an issue with three.js and got the answer, that Three currently does not support such files. The question is closed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM