collada模型看起来很奇怪(three.js) [英] The collada model looks strange (three.js)

查看:151
本文介绍了collada模型看起来很奇怪(three.js)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

collada模型在three.js中看起来很奇怪。截图:

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

我从google sketchup仓库下载了该模型。 [链接]

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

我不知道是什么问题,因为我是three.js的新手。我应该调用一个函数来修复它吗?

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

提前致谢,

推荐答案

我认为这种情况正在发生,因为背面没有被渲染。 COLLADA无法指定面部是否应该是双面的。 Google地球使用此方法导出此信息:

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使用名为 doubleSided 表示面部是否是双面的,但ColladaLoader.js不会查找< extra> 标签来设置属性。你应该提交一个包含three.js的bug来添加对它的支持。

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.

编辑:这似乎是在dev分支上修复的。以下是我加载此模型的内容:

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.

这篇关于collada模型看起来很奇怪(three.js)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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