View Extent

Hi, Im trying to get the view extent of the camera to only add geometries that are inside it or intersected.

The attribute scene.getCamera().frustum doesnt update when I move the camera.

Is there a way to get it?


You can use:

var cullingVolume = scene.getCamera().frustum.computeCullingVolume(position direction, up);

where position is the eye position and direction, up are the orientation. Those parameters are required because you may want the culling volume in eye, world or model space. The function returns a CullingVolume object that has an array of the culling planes or, if you have a bounding sphere for the geometry, you can call cullingVolume.getVisibility(boundingSphere) to determine whether it is inside, outside, or intersecting.

Thank you very much.