Three.js: ColladaLoader2 problem with geometries of type triangles.

Created on 20 Oct 2017  路  4Comments  路  Source: mrdoob/three.js

Description of the problem

We are trying to upgrade from Colladloader to Colladaloader2, but it seems like all the models that have their geometries type = triangles do not appear in the scene.

Are triangles not supported yet in the new loader?

For example this mesh used to work with the old loader, now nothing appears.

Thanks.

Three.js version
  • [x] Dev
  • [ ] r87
  • [ ] ...
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Bug

All 4 comments

Triangles as primitive type should basically be supported by the loader. I will debug your file over the weekend.

I found the problem. Have a look at this part of your collada file:

<node>
  <matrix>1 0 0 133.1126 0 1 0 181.0321 0 0 1 -4.96994e-5 0 0 0 1</matrix>
  <instance_geometry url="#geom-Box005">
    <bind_material>
      <technique_common>
        <instance_material symbol="_4_-_Default_1" target="#_4_-_Default-material"/>
      </technique_common>
    </bind_material>
  </instance_geometry>
</node>

The actual problem is that the first node tag does not have an id attribute. Currently the loader expects an id attribute and can't process files without this information because it utilizes the id for identifying (organizing) nodes.

@mrdoob This is the problematic part of the loader. Do you have an idea how we can handle nodes without id attribute? Could the loader generate/add this missing information in some way?

I just implemented a possible solution. The loader can now handle the problematic file.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings