Original Post
Could someone please give me a website or a peace of code that explains the somplest form of BSP-Tree in detail(usage: back-to-front rendering).
Thanks.
void RenderBSPLevel(CBSPTreeNode *p_Node) // a class, actually C++!
{
// If left pointer is NULL, this node contains a polygon set to be rendered (right pointer would be NULL, too)
if ( p_Node->lpLeft == NULL )
{
RenderNodePolygons(p_Node->polygonset);
return;
}
// This is a branch. Test partition.
if (ViewpointOnFrontSideOfPartition(p_Node->partition))
{
RenderBSPLevel(p_Node->lpLeft);
RenderBSPLevel(p_Node->lpRight);
}
else
{
RenderBSPLevel(p_Node->lpRight);
RenderBSPLevel(p_Node->lpLeft);
}
}
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