.obj 和 .json 格式都缺少对象面three.js [英] Missing object faces on both .obj and .json formats three.js

查看:29
本文介绍了.obj 和 .json 格式都缺少对象面three.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的几周里,我在加载我在 Blender 中创建的模型时遇到了问题.起初,我尝试使用 .obj 和 .mtl 文件,但即使在 material.side 设置为 THREE.DoubleSide 时,它们也呈现缺失面.我将 .obj 文件转换为 .json 文件并以这种方式呈现它们,但问题仍然存在.

Over the past few weeks, I've been having issues with loading models I've created in Blender. At first, I tried using .obj and .mtl files, but they were rendered with missing faces, even when material.side was set to THREE.DoubleSide. I converted the .obj files to .json files and rendered them that way, but the issue persisted.

您可以准确地看到丢失的面孔的位置.当我上传到 Clara.io 时,模型会按照我想要的方式呈现:

You can see exactly where the missing faces are. When I upload to Clara.io, the model is rendered exactly how I want it to be:

过去,我对模型进行了三角测量以解决此问题,但最终会扭曲模型.是否有任何已知的修复方法不会扭曲我的模型?

In the past, I've triangulated the models to fix this issue, but it ended up distorting the models. Is there any known fix that won't distort my models?

作为参考,这是我用来加载对象的(简单)代码:

For reference, here's the (simple) code I'm using to load the object:

var jloader = new THREE.JSONLoader();
jloader.load(
  'models/capsule/capsule.json',
  function ( geometry, materials ) {
      var material = new THREE.MultiMaterial( materials );
      var object = new THREE.Mesh( geometry, material );
      scene.add(object);
  }
);

推荐答案

缺失的面可能是多边形而不是三角形或正方形.改变它们,你会很高兴.

The missing faces might be polygon instead of triangles or squares. Change them and you will be good to go.

这篇关于.obj 和 .json 格式都缺少对象面three.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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