The collada model looks strange (three.js)

喜欢而已 提交于 2019-12-10 11:18:02

问题


The collada model looks strange in three.js. A screenshot:

The code is very simple, nothing special:

loader.load( 'models/police_car.dae', function ( collada ) {
  dae = collada.scene;

  init();
});

I downloaded the model from google sketchup warehouse. [link]

I have no idea what is the problem, because I'm new in three.js. Should I call a function to fix it?

Thanks in advance,


回答1:


I think this is happening because the back faces are not being rendered. COLLADA has no way to specify whether a face should be double sided or not. Google Earth uses this method to export this information:

<extra>
  <technique profile="GOOGLEEARTH">
    <double_sided>1</double_sided>
  </technique>
</extra>

Three.js uses an attribute on an object called doubleSided to indicate if the face is double sided, but the ColladaLoader.js does not look for the <extra> tag to set the property. You should file a bug with three.js to add support for it.

EDIT: This appears to be fixed on the dev branch. Here's what I get loading this model:

You can clearly see the dashboard of the car inside through the partially-transparent window.



来源:https://stackoverflow.com/questions/11540925/the-collada-model-looks-strange-three-js

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