Skip to main content
GameDev.net gamedev.net
🔒 Locked

frustum & box - intersection volume

Started by Kitt3n Jun 28, 2006 at 7:16 AM 0 replies 1.5k views
Original Post
Kitt3n
Kitt3n
Hi, To not reinvent the wheel again, I'm looking for an algorithm which will determine the intersection volume from a pyramid (=view frustum) and a bounding box.. Found lots of info on determining of they collide, but not on the resulting volume which they share... Any links anyone?
visit my website at www.kalmiya.com
Android_s
Android_s
You could calculate the effective radius for the bounding box and then use that to determine if the box is wihtinn or outside the view frustum.

Ok, so you have a box. First you get the vectors X, Y and Z which is "Width, Height and Thickness". Then you need the Normal of the view frustum plane you want to test against, call it N. The formula would look like this:

Reff = (|X.N|+|Y.N|+|Z.N|) / 2

Then you test against your plane P, and the center of the box Q. Calculate the radius for every plane and if for any plane P.Q <= -Reff then the box is outside. (hope i got it right)


I got this from the book Mathematics for 3D game programming & computer games ISBN:1-58450-277-0 which is a book i can really recommend. =)


----------------------------------------------------------------------------------------------------------------------"Ask not what humanity can do for you, ask what you can do for humanity." - By: Richard D. Colbert Jr.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.