Camera placement sphere for an always fully visible object

Posted by BengtR on Game Development See other posts from Game Development or by BengtR
Published on 2012-05-21T14:20:05Z Indexed on 2012/06/22 3:25 UTC
Read the original article Hit count: 192

Filed under:
|
|
|

Given an object:

  • With the bounds [x, y, z, width, height, depth]
  • And an orthographic projection [left, right, bottom, top, near, far]

I want to determine the radius of a sphere which allows me to randomly place my camera on so that:

  1. The object is fully visible from all positions on this sphere
  2. The sphere radius is the smallest possible value while still satisfying 1.

Assume the object is centered around the origin.
How can I find this radius?

I'm currently using sqrt(width^2 + height^2 + depth^2) but I'm not sure that's the correct value, as it doesn't take the camera into account.

Thanks for any advice.


I'm sorry for confusing a few things here. My comments below should clarify what I'm trying to do actually.

© Game Development or respective owner

Related posts about math

Related posts about camera