防止贴花显示在网格内部 [英] Prevent decal from showing on inside of mesh

查看:26
本文介绍了防止贴花显示在网格内部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看这里的示例:http://threejs.org/examples/#webgl_decals

I'm looking at the example here: http://threejs.org/examples/#webgl_decals

如果我在嘴唇上拍摄贴花,调整轨道控制最小距离,然后进入网格内部,我可以看到网格内部的贴花.有没有办法防止这种情况?我试图将贴花用于其他不希望在两侧都显示贴花的地方.由于 THREE.DoubleSide 不是默认设置,我不确定这是如何发生的.

If I shoot a decal on the lips, adjust the orbital controls minimum distance, and go inside the mesh, I can see the decal on the inside of the mesh. Is there a way to prevent this? I'm trying to use the decal for something else where it is not desireable to have the decal show on both sides. Since THREE.DoubleSide is not the default, I'm not sure how this is happening.

推荐答案

创建材质时,只需使用 THREE.DoubleSide、THREE.FrontSide(默认)或三.BackSide.查看材料对象了解更多信息...

When you create your material, simply set which side (or both) you want the decal to appear on using THREE.DoubleSide, THREE.FrontSide (default) or THREE.BackSide. Look at the material object for more info...

var decalMaterial = new THREE.MeshPhongMaterial( {
    map: decalNormal,
    transparent: true,
    depthTest: true,
    depthWrite: false,
    polygonOffset: true,
    polygonOffsetFactor: - 4,
    side: THREE.DoubleSide
});

这篇关于防止贴花显示在网格内部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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