Carving objects against each other


i am writing an editor and now i want to be able to carve objects against each other. My editor supports boxes, spheres, cylinders and pipes. So i would like to have an algorithm that is object-independent and just takes two sets of polygones, carves them and creates new objects (It should not create boxes, … but only polygon sets that form new objects. However the polygones have to be convex.)

I know this is a very complex algorithm but maybe someone of you knows a tutorial or something similiar, where i can find some information about this topic.

Thanks in advance.

I think you are talking about CSG (constructive solid geometry) to which case there are many algorithms. You may want to just look up bsp and csg. The idea is to build a bsp for each model, then you merge the two models. Depending on the operations union/difference/etc you will discard certian cut polygons. Just take a look through google you should find alot on this subject.

Neil Witcomb

Wow, thanks. CSG seems to be the right keyword, i found a lot of entrys in google and one seems to be really, really good.