All About Constructive Solid Geometry
Miscellaneous Forums/General Discussion/All About Constructive Solid Geometry
I posted a paper describing constructive solid geometry, and why it is so useful in real-time rendering simulations:
http://www.leadwerks.com/files/csg.pdf
Most exciting. However, I don't understand the math - sniff.
very nice, thanks. but where are the cons of CSG?
i would feel like i am reading a biased article if there are no cons mentioned somewhere.
Maybe there are no cons. If there always has to be cons, there can never be things that are right.
There are no cons, except perhaps that you have to follow the rules. CSG can be converted to, and is rendered as triangle meshes, but as long as it follows the rules, it allows a lot of fast math routines.
It bothers me that many people still view 3D World Studio as an easy-to-use triangle mesh editor. CSG is what the big-name engines use, and I am trying to bring it to more developers.
Why doesn't Blitz3D have precise frustum culling? Because it doesn't use CSG. I'm working on a free library that will allow more developers to use these fast math routines everywhere in their engines, and am in discussions with two pretty well-known engine teams.
That was a great read, cheers.
Interesting read, thanks. Can you tell us more about the library?
It gets even more exciting.
Just a shame that so much of the community always seem to completey fail to get excited by what he does.
James, the library would just be a wrapper for my engine's CSG solids. If you saw any of my recent engine demos, I had some pretty interesting portal occlusion and other things.
There are commands for the following:
Control of CSG solids:
Create a solid, add faces, add vertices.
Generate texture mapping coordinates.
Move, rotate, and scale solids.
Retrieve information on solids like the plane equation for each face.
Retrieve the vertex array, indice array, texcoordarray, etc., for rendering the objects yourself.
CSG Maths:
PointInSolid() - tell if a point is in the solid's volume.
RayIntersectsSolid() - much faster than triangle intersections.
SolidsIntersect() - solid object intersection, fast enough for real-time.
SliceSolid() - slice a solid along a plane and produce two resulting solids.
ExtrudeSolid() - project a solid out from a point, or along a vector; fast enough for realtime.
All these routines are already written and tested; they form the basis of my 3D engine. I may take it even further and open up my portal occlusion system.
Most AAA developers are moving away from BSP/CSG routines (aside from using it to define the rough shell of interior spaces) and moving more towards hardware occlusion query systems. BSP still has it's place but it's quickly becoming obsolete as new techniques are introduced.
For guys using Blitz3D though, yeah, it's still very useful.
Edit - personal attack removed by admin.
Great read.
For anyone who's just developed a taste for CSG please read [a http://www.delphi3d.net/articles/viewarticle.php?article=csg.htm"]this link[/a] before attempting to knock up your own code. It describes how merging BSP trees can achieve CSG operations. A far more elegent solution than brute force math.
Alternatively just get leadwerks lib :).
from conclusion:
Without constrictive solid geometry,
good read though :).
I want realtime csg operators that clean up their polygonal fragmentation mess over time. I think that's the big con. :)
You keep subtracting enough, around a solid, and you've multiplied the amount of child solids. :/
I've always wanted to write an engine where you can dynamically dig and fill in a progressive mesh, I have done so already, however it's no where near efficient, and used cubes instead of a "smoother surface". BSP and CSG are two very different topics of discussion, but they happen to work good together (A disputed topic!). However, realtime CSG would get away from the use of BSP, and still has not entirely been done yet before on a dynamic progressive level.
Great tutorial too, Josh. :)
Nice, thanks for sharing!
Halo/Leadwerks has definitely grown up, lets give him a smidge of credit. Every now and again he says something arrogant but for the most part he keeps it respectful.
Most AAA developers are moving away from BSP/CSG routines (aside from using it to define the rough shell of interior spaces) and moving more towards hardware occlusion query systems. BSP still has it's place but it's quickly becoming obsolete as new techniques are introduced.
That's right, Unreal is moving away from BSP/CSG now, replacing it with 3d modelled static meshes, which are much easier and more versatile.
We use BSP for the level shells but not much else at this point. However, as I said, for Blitz3D projects and such BSP is definitely still viable.
(hopefully the admins won't find anything objectionable in this post - here's hoping!)
I understand most of it. just curious whats the var Bd in the paper for ? point B distance? also the next set of math you got one var d, is that also distance? and how to did you aquire the contents if it is distance?
im trying to make my own CSG lib, convex seems to be easiet to
check, concave is a um, stinky lil piece o geometry im wrestling with.
Nvm i figured it out. I figured which direction a face is facing from the origin, but how do i find out if the face is pointing outward or toward the center without using linepick?
duh, nvm again figured that out in like 10 mins. just simply check whether the index of the next corner in a clockwise direction of the triangle is higher or lower than the first corner.
So nvm completely. i totally understand the CSG maths now lol.