CSG\Brush\BSP lack of understanding

Started by
0 comments, last by JMab 16 years, 2 months ago
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.
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.

This topic is closed to new replies.

Advertisement