Moving a bounding box

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Asterisk Man
Posts: 62
Joined: Wed Jun 09, 2004 5:51 am

Moving a bounding box

Post by Asterisk Man »

I'm having some troubles setting the translation of a bounding box for view frustum culling (as in I can't see a single thing being drawn). Here's the code:

[code]
bool isQuadVisible(SViewFrustrum *cam, QuadNode *node)
{

aabbox3d<f32> pointBox(node->vertices[4]->Pos);
pointBox.addInternalPoint(node->vertices[0]->Pos);
pointBox.addInternalPoint(node->vertices[1]->Pos);
pointBox.addInternalPoint(node->vertices[2]->Pos);
pointBox.addInternalPoint(node->vertices[3]->Pos);

matrix4 trans(AbsoluteTransformation);
trans.transformBox(pointBox);

for(s32 i = 0; i < 6; i++)
{
if(pointBox.classifyPlaneRelation(cam->planes[i]) != ISREL3D_BACK)
continue;
return false;
}

return true;

}
[/code]


What i'm trying to do is to build a bounding box made out of the node's vertices, translate the box to its position in the world, and check if it's within the view frustum. Help anyone?
RoCKdaFrogg
Posts: 3
Joined: Wed Jun 29, 2005 6:10 pm
Contact:

Post by RoCKdaFrogg »

see the thread transformBox broken in Bug Reports forum. might help.
Post Reply