Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RavNaz

BSPBuild function, recursion and stack overflow

This topic is 6306 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

I''m building a BSP engine. It works when assigning polygons to front nodes (which is about 7 in the default map), but when assigning back nodes (55) it generates a stack overflow. I know this is to do with the stack and recursion problems, but how do i fix it???

Share this post


Link to post
Share on other sites
Advertisement
Are you saying that your tree descends to a depth of 55? If so then you need to look at your heuristics for choosing split planes, and try and get a more balanced tree. Unless you have approx. 2^55 polys ;-)

Andy.

Share this post


Link to post
Share on other sites
Yeah, the depth is 55. But at the moment thats discounting the 55 spanning planes that still need to be split further, which means that it will probably balance out. I can work on the heuristic, but I need to get this stack overflow sorted.

Cheers

Share this post


Link to post
Share on other sites
Assuming that all your splitting functions are working perfectly, this sounds lie it could be an illegal geoemtry problem.

If you tree is a leaf tree especially a SOLID leaf tree then you have to be very carfeful and make sure you obey the geoemrty rules.

You should really perform CSG routines on you level so that all intersecting polygons are carved away because this leads to a compiler being cauight in an endless loop.

The fron of a face should NEVER be in solid space, its as simple as that. If it is, then you have illegal geometry and the compiler will loop endlessly trying to clasify a polygon that is bioth behind and infront of other polygons.

hth

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!