Infil

11-18-2008, 01:43 PM

In my application, I have a base point, which can be thought of as being close to the middle of a rectangle, and a normal direction. I want to travel from this base point along the normal, and then look back down on the surface... but I want to travel up far enough to guarantee that I can see 4 distinct points (ie, the corners of this "rectangle"). While it's common that the 4 points will "mostly" be in the 4 cardinal directions, some variation can occur, and the 4 points are definitely not planar.

How can I choose a distance to travel up this normal so that I can create a viewing frustum which contains all 4 of these points? I don't want to go up too far, either, because I need to do some color/depth picking and I don't want to lose too much accuracy, so the "minimum" distance (or something close to it) is needed here. Is there a way I can pick an arbitrary distance, test if all 4 points are viewable, and if not, move up a bit more (or calculate exactly how much more I need to move up to make a missing point visible)? Or is there a faster method? Thanks for any help!

How can I choose a distance to travel up this normal so that I can create a viewing frustum which contains all 4 of these points? I don't want to go up too far, either, because I need to do some color/depth picking and I don't want to lose too much accuracy, so the "minimum" distance (or something close to it) is needed here. Is there a way I can pick an arbitrary distance, test if all 4 points are viewable, and if not, move up a bit more (or calculate exactly how much more I need to move up to make a missing point visible)? Or is there a faster method? Thanks for any help!