【问题标题】:Three.js - collada model not loading when specifying a textureThree.js - 指定纹理时未加载 collada 模型
【发布时间】:2012-10-06 01:33:06
【问题描述】:

我尝试使用 three.js collada 加载器加载转换后的 collada 模型(obj -> collada [在最大打开时没有问题,包括工作 uvs])。使用开源 3d 模型转换器 assimp 转换模型。

我注意到的一件事是转换后的 collada 模型在孩子里面有孩子,但我听说这没问题。但是,如果我将材质更改为具有纹理的材质,则会收到错误消息:“TypeError: uv2i is undefined”。

只要我不使用模型加载的纹理。 https://dl.dropbox.com/u/2705276/bachelorShowcases/001/webGL_museum_wire.html

指定纹理时未加载模型: https://dl.dropbox.com/u/2705276/bachelorShowcases/001/webGL_museum.html

这是一个错误还是我做错了什么?

function load( model ){

loader.load( 'https://dl.dropbox.com/u/2705276/bachelorShowcases/001/xerox404_webglCONV.dae', createScene1 );

}

function createScene1( geometry ) {

dae = geometry.scene;
mesh = dae.children[0].children[0];
mesh.material = new THREE.MeshPhongMaterial({map:THREE.ImageUtils.loadTexture('https://dl.dropbox.com/u/2705276/bachelorShowcases/001/xeroxD.png')});

}

【问题讨论】:

  • 查看器/导航器已加载,但我在您的预览链接中看不到任何内容。
  • 是的,这就是问题所在。如果我没有指定对象加载的纹理。这是一个仅使用线框着色器的测试:dl.dropbox.com/u/2705276/bachelorShowcases/001/…

标签: three.js collada


【解决方案1】:

如果你检查控制台,你会看到这个错误:

webGL_museum.html:461
Uncaught TypeError: Cannot read property 'u' of undefined three.js:17814

这基本上意味着您的模型没有 UV。为了在模型中使用纹理,它需要有 UV。

【讨论】:

  • 您好Doob先生,感谢您的回复。奇怪的是:如果我采用完全相同的模型并在 3ds Max 中打开它,我可以毫无问题地对其应用纹理。使用 unwrap uvw 修饰符,我可以看到我生成的 uvs。
猜你喜欢
  • 2012-08-18
  • 2014-03-10
  • 1970-01-01
  • 2015-08-31
  • 2015-12-04
  • 1970-01-01
  • 2018-09-02
  • 2015-05-30
  • 2014-12-10
相关资源
最近更新 更多