Solved Retrieving camera view volume

Hello guys,
I am working with cameras to do some computation I need to retrieve its current view volume. I call view volume, the visible scene's "cone" from the camera pov.
See picture below (this cone is visible when the option "Show Cone" in camera object is switched on):

  1. Does it exist a function returning this volume no matter what kind of camera is used?

  2. While I can compute it for perspective camera, I couldn't guess the right parameters to compute it for parallel camera.

struct frustum{
 Float farVal, nearVal, right, left, top, bottom;

cam = GetCamera()) {
Float near = 0;
Float far = 1000;
Float focusLength= getParam(CAMERAOBJECT_TARGETDISTANCE, DA_REAL, cam).DReal;
			near = getParam(CAMERAOBJECT_NEAR_CLIPPING, DA_REAL, cam).DReal;
			far = getParam(CAMERAOBJECT_FAR_CLIPPING, DA_REAL, cam).DReal;
		auto fov_vertical = getParam(CAMERAOBJECT_FOV_VERTICAL, DA_REAL, cam).DReal;

		auto widthHalf = focusLength * maxon::Tan(fov / 2.0)/100.0;
		auto heightHalf = focusLength * maxon::Tan(fov_vertical / 2.0) / 100.0;
		f.farVal = far;
		f.nearVal = near;
		f.right = widthHalf;
		f.left = -f.right; = heightHalf;
		f.bottom =;
		return 0;

Any help is welcome.
Thank you in advance


  1. Not that I know of

  2. In a parallel camera, the view frustrum is a rectangular box/"cube". The dimensions depend on the render setting dimensions and the camera's zoom value. For some reason the neutral zoom is 1.024, not 1, so: if your render settings define an image of 1000x500 pixels, and the camera zoom is 1.024, then an object with the dimensions 1000x500 units parallel to the camera's view plane will appear as filling the image.
    (Obviously, in parallel projection the distance of the object does not matter.)
    A zoom of 0.512 will show the object as half size (500x250 pixels, plusminus whatever the antialias settings screw up), a zoom of 2.048 will show the object as double size, etc. As the geometric frustrum is simple, the calculations for the volume (up to the focus distance) are trivial.


Note: I did this on R23, so if the later versions changed the neutral zoom, I wouldn't know.

@cairyn Thank you!