PDA

View Full Version : Boolean operations...



Fisher
11-12-2000, 02:49 PM
Hi where,
I'm interesting where to get info/samples about boolean operations over 3D objects;
something like glStencilFunc but at object level

Dodger
11-13-2000, 05:36 AM
Well, for adding two objects (logical OR) just turn on depth buffer and draw both objects. For subtracting object A from B, you could do the following:

-Draw B's front faces, setting stencil where drawn
-Draw A's back faces where stencil is set

without depth buffer test.
For a logical AND

-Draw front of A into stencil
-Draw front of B into stencil, increasing
-Draw front faces of A and then B to color buffer where stencil >1, with depth buffer and depth test on

Or something like that http://www.opengl.org/discussion_boards/ubb/wink.gif
There's a Demo for CSG operations somewhere, but I forget where to find it.

Hope that helped http://www.opengl.org/discussion_boards/ubb/smile.gif

Fisher
11-13-2000, 01:22 PM
No,no,no. I mean not pixel - level operations (that stancil does), but operations with "real" object crossing. I need to SAVE the result of crossing in a file. Thanx anyway http://www.opengl.org/discussion_boards/ubb/smile.gif

Kilam Malik
11-13-2000, 10:05 PM
I posted an answer before:
http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/000999.html


Kilam.

Nicolas Lelong
11-14-2000, 05:13 AM
You can also take a look at www.flipcode.com (http://www.flipcode.com) as there's a new article from Paul Nettle that explains stuff about this.