Manual frustum culling with three.js

前端 未结 1 661
自闭症患者
自闭症患者 2021-01-21 12:39

I\'m working on a voxel game with three.js. For this, I need to generate as many chunk as required to fill the screen. Currently, I\'m loading a circle of radius 20 around the p

1条回答
  •  花落未央
    2021-01-21 12:50

    var frustum = new THREE.Frustum();
    frustum.setFromMatrix( new THREE.Matrix4().multiply( camera.projectionMatrix, camera.matrixWorldInverse ) );
    
    for (var i=0; i

    only objects that are within camera frustum will be rendered

    documented here

    hope this helps you?

    0 讨论(0)
提交回复
热议问题