• Advertisement
Sign in to follow this  

Can anyone teach me how to test the bounding box

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can anyone teach me how to test detect whether the Axis aligned bounding box overlaped with the view Frustum? I got a website but I am not quite understand... plz help http://www.lighthouse3d.com/opengl/viewfrustum/index.php?gatest3

Share this post


Link to post
Share on other sites
Advertisement
What is it that you don't understand?

Please be more specific

Share this post


Link to post
Share on other sites

The way to find the positive vertex in the bounding box and the negative vertex. and the one showing the code:

p = (xmin,ymin,zmin)
if (normal.x >= 0)
p.x = xmax;
if (normal.y >=0))
p.y = ymax;
if (normal.z >= 0)
p.z = zmax:

n = (xmax,ymax,zmax)
if (normal.x >= 0)
n.x = xmin;
if (normal.y >=0))
n.y = ymin;
if (normal.z >= 0)
n.z = zmin:

Share this post


Link to post
Share on other sites
Quote:
Original post by kbundy

The way to find the positive vertex in the bounding box and the negative vertex. and the one showing the code:

p = (xmin,ymin,zmin)
if (normal.x >= 0)
p.x = xmax;
if (normal.y >=0))
p.y = ymax;
if (normal.z >= 0)
p.z = zmax:

n = (xmax,ymax,zmax)
if (normal.x >= 0)
n.x = xmin;
if (normal.y >=0))
n.y = ymin;
if (normal.z >= 0)
n.z = zmin:
You may still need to be more specific; what exactly is it you want to know?

As for the above code, it computes the corners of an axis-aligned bounding box which project maximally and minimally onto the plane normal, e.g.:
*------p
| | --
| | /|
| | /
n------*/
/
/
(normal)
This is one way to go about testing an AABB against a plane, which is what the AABB-frustum test requires.

Share this post


Link to post
Share on other sites


I don't actually understand how the code (the one say b.getVertexP(pl.normalize())) find the positive and negative corner points in the bounding box.

How does it calculate it in order to find those pos and neg points? (I am not sure is it specific enough, sorry about it coz I am not quite understand in that part so i am hardly able to ask it clearly.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement