Sign in to follow this  
JMab

CSG\Brush\BSP lack of understanding

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this