# On screen projection of a bounding box

This topic is 4544 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ciao, Is there a quick and robust algorithm to determine the projection on screen of a bounding box, taking into account all possible cases? In particular, I am interested in the case when the bbox crosses the camera's near plane, which prevents the simple projection of the bbox corners. I can only think of calculating the intersection between the bbox planes and the camera plane in this case but maybe there's a more clever way. Thanks! Stefano

##### Share on other sites
Quote:
 Original post by nooanIs there a quick and robust algorithm to determine the projection on screen of a bounding box, taking into account all possible cases? In particular, I am interested in the case when the bbox crosses the camera's near plane, which prevents the simple projection of the bbox corners. I can only think of calculating the intersection between the bbox planes and the camera plane in this case but maybe there's a more clever way.

http://jgt.akpeters.com/papers/SchmalstiegTobler99/

You can find a (tech report) copy here:

http://www.cg.tuwien.ac.at/research/publications/1999/Fuhr-1999-Conc/TR-186-2-99-05Paper.pdf

##### Share on other sites
Thanks Christer for that link, that tech report was actually already opened on my desktop ;-)
That paper does not deal with the case of a bounding box crossing the view plane. This could happen in extreme cases when the viewer is very close to the bounding box (even just a bit inside). I guess in this case the only solution is to simply calculate the intersections between the view plane and the bbox, project the remaining points lying in front of the view plane, and take the bounding rect of these.
Thanks anyway,

Stefano

##### Share on other sites
If you can't just project the corners then isn't the camera inside the box? In which case the box covers your entire view ...

##### Share on other sites
Quote:
 If you can't just project the corners then isn't the camera inside the box? In which case the box covers your entire view ...

Generally yes but there are some cases where this is not true. For example, the camera is underwater, but you can partially see outside because part of the view plane goes out of the water bounding box, despite the viewer being inside the box. Assuming that the box covers the entire screen might be a good approximation anyway.
Thanks again!

Stefano

##### Share on other sites
You could 'chop' the bounding box with the near view plane, which would result in a new convex polygon. (If your bounding box is camera-aligned, this step is really easy and always will produce a new box.)

1. 1
2. 2
Rutin
25
3. 3
4. 4
5. 5

• 11
• 10
• 13
• 20
• 14
• ### Forum Statistics

• Total Topics
632950
• Total Posts
3009378
• ### Who's Online (See full list)

There are no registered users currently online

×