Original Post
Could someone give me an easy example of a BSP-Tree that only sorts in a back-front order and doesnt check overlaps or other details. Just the core.
void ParseBSPTree(strNode *p_Node)
{
// If left is null, right is null too and this is a leaf
if (p_Node->left == NULL )
{
RenderPolygons(p_Node->polygonset);
return;
}
// Branch according to placement of viewpoint in relation to partition
if ( ViewpointInFrontOfPartition(p_Node->partition))
{
ParseBSPTree(p_Node->left);
ParseBSPTree(p_Node->right);
}
else
{
ParseBSPTree(p_Node->right);
ParseBSPTree(p_Node->left);
}
}
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more