Tuesday 21 October 2008

CSG Ahoy!

The last attempt I had at writing a CSG library began to bore me a bit, so thats the main reason I put off PsybrusEd, besides my port to DirectX.

CSG has always been something I've glanced at thinking "Too... much... maths...", so I've always ran away screaming if I ever had to begin to touch on it in code. Tim, a friend of mine used to boggle my mind talking about B-Reps and CSG quite a bit, and various other brain melting topics along the lines of collision detection. Ah that old friend, collision detection, I wish I strangled you underwater and left you in that watery grave - you wouldn't have snuck back up on me again on a night of bordom! Was a nice thing that the only weapons required to defend myself were a nice vector class, a plane class, and a few more years experience in maths and programming.

Tonight, I decided to pick up my old CSG library - its a touch slow due to the abuse of STL internally to save on memory management, and exceptions all over the place - but luckily, it was commented well enough to read through and understand even given that its been a good few months since I started it. Anyways, the point I gave up on - intersect was flaky, and there was no subtract. A couple of hours later - success! I finally for both working, and began to tie it into PsybrusEd, as well as write editor states to keep everything tidy. Anyways, a few small shots of the editor in action, starting to take shape. First 3 images are in sequence, the final one is just a large area with multiple subtractions from it.












No comments: