Public Group

# Can anyone teach me how to test the bounding box

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

## 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 on other sites
What is it that you don't understand?

##### 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 on other sites
Quote:
 Original post by kbundyThe 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 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.)

1. 1
2. 2
Rutin
15
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633270
• Total Posts
3011158
• ### Who's Online (See full list)

There are no registered users currently online

×