Is it possible to create a THREE.Box3 from a THREE.Fustum

Hi.

First let me thank you for your answer and support.

: )

I would preffer to use Frustum planes because I wanted to combine those planes with 6 clippling planes matching with the 6 Scene BoundingBox faces.

I am using very complex scenes and using instancing and I wanted to implement my frustum method in order to increase performance when rendering. The idea is that objects clipped by defined clipping planes or not in the current frustum camera will not be added to the scene by modifying maxInstancedCount in my InstancedBufferGeometry objects.

Another problem I have is that my Scene scale ( Biggest Object / Smallest Object )is very big and it is giving me lot of nightmares. I tried to use logarithmic depth buffer in my WEBGLRenderer but it is not accurate. You can see the issue at:

So I decided to dynamic change|update near and far planes of my camera depending on the frustum combined with my Clipping Planes. Currently in my render loop I am doing this:

// In my global Var Section (outside of render loop)
var sceneBox = is the combined Box3() of all instances (once is computed never changes anymore)
var sceneBoxCenter = sceneBox.getCenter(new THREE.Vector3()) (once is computed never changes anymore)

 function render() {
if (sceneBox != undefined) {
	d1 = sceneBox.distanceToPoint(camera.position);
	d2 = sceneBoxCenter.distanceTo(camera.position);
	camera.far = 2 * d2 - d1;
	camera.near = camera.far / 10000; // Trying multiple values I think is the maximum difference set by far/near without distorsion (but not sure)
	if (aCamera.far < sceneBoxSize) {
		aCamera.far = sceneBoxSize;
		aCamera.near = aCamera.far / 10000;
	}
}
....

 }

But I am not happy at all with this solution. This was the reason to use the box intersection taken from Clipping Planes and Camera Frustum.

At the end, I think I have decided using the points extracted from my camera as Mugen suggested me.

I was just goint to close this topic.

My only concern was to add a really Line3 object methods and not just a Line3Segment. I thought it could be usefull. I dont understand why infinite Line object was not included in THREEJS objects in the same way Plane was. Current Line3 object in my opinion has some lacks.

Anyway, I am not an expert and probably adding|extending infinite Line3 object is not a need at all.

: )

Many thanks for your suppport.

At the end, I will follow Mugen’s and your recommendation and use camera extracted values.

Best regards