CSG or Brep with opengl

I’m new to OpenGl programming.Is it possible to do CSG (constructive solid geometry)
or Brep with opengl
or is a additional library required. Do you know a library.
I program on windows with delphi.

thanks

Sonja Funk

Not really…

OpenGL only does drawing, not geometry management. If you want to generate geometry using CSG operations, it won’t help you.

There are some tricks with the stencil buffer which will allow you to draw objects in such a way that it looks as if you’re doing CSG. If this is what you’re after, I think there are descriptions of the technique in recent SIGGRAPH notes.

Hope this helps.

Ive been poking around finding info on BSP trees and CSG. I found this small piece of code in the proccess.
http://toolbox.sgi.com/TasteOfDT/src/exampleCode/opengl/GLUT/progs/advanced/csg.c

It uses the stencil buffer to simulate CSG as Mike mentioned. “Looks” great but it doesnt modify the geometry.

you can do CSG by making use of the stencil buffer.
but this way, as mike said, CSG operations are not performed into the geometry, but at rendering time.

there is an example of CSG simulation, and the link to that example is on this board.

Dolo//\ightY