I feel like I have a good grasp of controlling the camera settings, but I am a little stuck on one thing. I am working out the math to “simulate” depth of field calculations for a given lens; by simulate, I was going to use the near and far frustrum planes as the bounds of the depth of focus. It all seems pretty fine until I get ready to set those planes (after calculating them based on the current aperature, etc.)
I don’t see any relevant set method other than
(in Rhino.Display.RhinoViewPort)
//
// Summary:
// Sets optimal clipping planes to view objects in a world coordinate 3d bounding
// box.
//
// Parameters:
// box:
// The bounding box
public void SetClippingPlanes(BoundingBox box);
This might be workable, but the fact that it is a world box makes me think its not so easy. If I could give it a box aligned to the camera, great. If its world and the camera is tilted, seems like a lot of extra maths. I have the planes calculated.
Assuming this is the only way…anybody have a tip on the math? Seems you need to make a world aligned bounding box with max diagonal that has endpoints on near/far planes.