ThreeJS disable rendering of faces behind the Camera

匿名 (未验证) 提交于 2019-12-03 02:38:01

问题:

I am Writing a Panorama Viewer. The Image is Displayed in a Sphere with a variable amount of faces. I want it only to render the faces in the camera direction (for better performance).

Does ThreeJS do this automatically or can I declare specific faces of a mash that do not get rendered?

like mash.faces[5].rendered = false; or so.

回答1:

This process is called viewing frustum culling and ThreeJS takes care of this.

ThreeJS also takes care of font and/or backface culling depending on your material settings. Meaning that only the visible side of the faces are rendered.

Here in the documentation you can find the ThreeJS Frustum.

And if the frustumCulled property on THREE.Object3D manages frustum culling and is by default set to true.



回答2:

If rolling your own vertices, edges, indices, a triangle with vertices stored in counterclockwise order is said to be front facing by default :



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!