简体   繁体   English

p5.j​​s 3D对象上的怪异纹理行为

[英]p5.js weird texture behavior on 3D objects

In a nutshell, what I'm trying to achieve is some basic texture mapping on a box() object. 简而言之,我要实现的是在box()对象上进行一些基本的纹理映射。 The texture itself is a square, b&w image. 纹理本身是一个方形的黑白图像。

I load the texture by loadImage(), call it through texture(), and map it on the cube. 我通过loadImage()加载纹理,通过texture()调用它,并将其映射到多维数据集。 It seems to be working overall and the code runs without any issues but for some reason -I'm not completely sure how one would call it in this environment- I'm getting some kind of a back-face culling effect dynamically depending on the angle I'm looking at it from(see attached pic). 它似乎可以正常工作,并且代码可以正常运行,但是由于某些原因-我不确定在这种环境下如何称呼它-我正在动态地获得某种背面剔除效果,具体取决于我从那里看它的角度(见附图)。

What might be the reason for that, and how could I get rid of this undesired effect? 这可能是什么原因,我如何摆脱这种不良影响?

ps:I'm using the built-in orbitControl() to navigate in the scene. ps:我正在使用内置的orbitControl()在场景中导航。 Maybe that's what's causing the problem? 也许这就是导致问题的原因? Can't be sure, help appreciated. 不能确定,帮助表示赞赏。

2d grid of 3d box() objects with some texture oddity on the top surface 3d box()对象的2d网格在顶部表面具有某些纹理奇数

I managed to fix it as soon as I assigned a texture() to every different unit in the scene. 我为场景中的每个不同单元分配了texture()后,便设法对其进行了修复。 fixed result 固定结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM