防止贴花显示在网格内部

编程入门 行业动态 更新时间:2024-10-28 03:18:17
本文介绍了防止贴花显示在网格内部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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

I'm looking at the example here: http://threejs/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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 14:51:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1395674.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:贴花   网格

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!