被削在Three.js自动完成?自动完成、Three、js

2023-09-08 10:45:15 作者:先生,可否借你的手一牵

所以,我正在阅读有关限幅这的维基百科文章。看来pretty的必不可少的任何和所有的比赛,所以,我必须这样做,或者它被Three.js,甚至WebGL的自动完成?谢谢!

So, I was reading about clipping in this Wikipedia article. It seems pretty essential to any and all games, so, do I have to do it, or is it done automatically by Three.js, or even WebGL? Thanks!

推荐答案

您可以通过在不久的和值远剪切平面到相机的对象:

You can pass values for the near and far clipping planes to your camera object:

var camera = new THREE.PerspectiveCamera( fov, aspect, near, far );

远近可以包含例如值近= 0.1 远= 10000 因此对象之间说谎这些值将被渲染。

near and far can contain values for example near = 0.1 and far = 10000 so an object which lies between these values will be rendered.

编辑:

近及远,再present为你的世界的裁剪平面。在成千上万的对象和纹理的场景被抽一次,它会被征税的CPU和GPU的尝试,并显示一切。更糟的是,这将是浪费画出的东西,你甚至看不到。近裁剪面通常比较贴近用户,而远剪裁平面是在远处的某个地方。由于物体穿过远平面,他们自发地出现或消失。有些游戏采用雾使物体的出现和消失更现实。

near and far, represent the clipping planes for your world. In a scene with thousands of objects and textures being drawn at once, it would be taxing on the CPU and GPU to try and show everything. Even worse, it would be wasteful to draw the things you cant even see. The near clipping plane is usually relatively close to the user, whereas the far clipping plane is somewhere off in the distance. As objects cross the far plane, they spontaneously appear or disappear. Some games use fog to make the appearance and disappearance of objects more realistic.