为什么在ThreeJs中看不见两个脸? [英] Why do two faces appear invisible in ThreeJs?

查看:128
本文介绍了为什么在ThreeJs中看不见两个脸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Blender中有一个对象.因为我想使用ThreeJS进行一些UV展开(请参见

I've an object in Blender. Because I want to do some UV-unwrapping using ThreeJS (see here) I determined that I need merge two of the sides to correctly unwrap.

因此,在将.blend导出为.obj对象之前,我选择了Tris to Quads face选项为两侧创建一个正方形面,而不是由两个三角形组成.这是Blender中的样子:

So before exporting the .blend as a .obj object I selected the Tris to Quads face option to create a square face for the two sides as opposed to it being made up of two triangles. Here's what it looked like in Blender:

但是当我将.obj.mtl文件导入ThreeJs时,我得到了:

But when I import the .obj and .mtl file into ThreeJs I get this:

这是我不更新要添加到新对象中的材质的问题吗? 出现白色的手柄使我认为是这种情况.如果是这样,我该如何解决呢?

Is this a problem to do with me not updating the material being added to the new object? The handles appearing white makes me think this is the case. If so how can I go about fixing it?

推荐答案

当我看到类似的内容时,通常要做的第一件事就是将材质设置为side: THREE.DoubleSide.如果有帮助,则该问题与法线方向有关(因此,该面实际上在那儿,但是因为它背对着您而未渲染).

When I see something like this, the first thing I usually do is to set the material to side: THREE.DoubleSide. If that helps, the problem has to do with the normal-directions (so the face is actually there but isn't rendered because it is facing away from you).

要解决此问题,您应该尝试以下操作:

To fix this, you should try the following:

  • 在Blender中,您可以在右侧菜单中启用法线方向的显示(在网格显示"部分中选择面法线").
  • 您现在应该查看是否有任何法线指向内/指向错误的方向.
  • 有一个自动修复程序可以很好地用于正确构造的网格:
    • 选择对象并切换到编辑模式(< Tab>)
    • 选择所有顶点(快捷方式& ltA>)
    • 通过菜单网格">法线">重新计算外部"(快捷键< Ctrl> +< N>).
    • In blender you can enable displaying of normal-directions in the right-hand menu (select "Face normals in section "Mesh Display").
    • You should now see if any of the normals are pointing inwards/in the wrong direction.
    • There is an automatic fix that works well for properly constructed meshes:
      • select object and switch into edit-mode (<Tab>)
      • select all vertices (shortcut &ltA>)
      • via menu "Mesh" > "Normals" > "Recalculate Outside" (shortcut <Ctrl>+<N>).

      这篇关于为什么在ThreeJs中看不见两个脸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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