|
|
Well, I made a fairly complete and working implementation of "Level Editor CSG" algorithms (http://wh12.tu-dresden.de/~cgk/, Projects [1]). But I kind of figured it out all by myself, so there are not really any links or tutorials I can suggest you. However, I can answer or give hints to solutions on specific questions most probably.
[1] Please ignore the text of the old homepage, if you should go there :]
After reading though the original link you posted again, I noticed that I misread something and the article is actually okay (it even does handle the coplanar cases in a manner that looks kind of right) for a description of the atomic splitting operations. I do that in a similar way. There are some hints that are not meantioned there, but imo should be: a) You really should join polygons after CSGing. Keeping around the original polygons and using them if nothing was split is probably not a good idea, as you will usually have a lot of splits that can be removed and some that can't. For this task, just give each "source" polygon a unique id and replicate this among all split fragments. This way, all fragments with the same id can be joined. In my projects I allowed concave polygons. It makes some things easier and some quite a bit harder tho. b) Write your code in a way in which you can easily replace number formats of positions and normals (i.e. float32 by float64 or fixed point). Also, _never_ hardcode epsilons. Think a lot about how large epsilon values for specific tasks should be and where you should use additive and where modulative epsilon tests (i.e. |a/b-1| approx 0 instead of |a-b| approx 0) c) When CSGing, you _never_ need to generate new polygons, only split polygons which have been there previously. But it seems you have figured that out by yourself already :]
|