Jump to content
  • Advertisement
Sign in to follow this  
JMab

CSG\Brush\BSP lack of understanding

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

Apologies in advance if this question is monumentally stupid. I'm building a CSG editor (for fun), and have got this so far: I can create a Brush from a primitive type (only have Box so far). Each Brush contains the following: 1) Polygons with untransformed vertices 2) World transformation matrix 3) Solid BSP tree, containing polygons with transformed vertices The Solid BSP trees of the Brushes can be combined in the usual ways (Union, Intersection, Difference), to produce a new Solid BSP tree containing the result of the CSG operation. My question is this: How do I logically persist my data? The Brushes are easy to use - whenever scale, rotate or translate a Brush, I rebuild it's Solid BSP tree, transforming the tree's vertices to the new world transformation. Obviously a Solid BSP tree that is a result of a CSG operation cannot go back into the form of a Brush (as I define it), a Brush being a world transformation and a set of untransformed polygons. Should I persist the Solid BSP trees seperately, and just uses Brushes in-memory, with their only purpose being to create Solid BSP trees? Sorry if my question is confusing, I've never used any CSG editors, but I only have a thin understanding of the terminology.

Share this post


Link to post
Share on other sites
Advertisement
I realised I should have posted the above in the graphics thread, oh well.

I think I've got it figured out - the brushes are discarded as soon as a CSG operation is done, right? Then you're left with a final, compiled BSP that you save to disk, as a static, solid object.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!