Using stencil for capping is an old trick and works well. I don't know of any
example code for it, and it's been years, more than a decade, since I've done it
myself. Your only other option would be some type of CSG approach, which would
be computationally expensive, especially if the clip plane is dynamic.
-Paul
On 7/20/2011 9:48 AM, Cory Riddell wrote:
I've been thinking about using a ClipNode to cut my model in two to
expose the inside details like a cutaway drawing. Just sticking a
ClipNode at the root of my model graph does remove half of it, but the
model ends up looking hollow rather than solid. I want to cap the open
side. For example, if a sphere is cut in two, I would cap the open side
with a circle.
A bit of searching for how to do this with OpenGL turned up this page
(http://glbook.gamedev.net/moglgp/advclip.asp) that caps the open side
using the stencil buffer. Does the technique outlined in the article
look like a reasonable OSG-friendly approach? Any advice or pointers to
other examples? Grepping the example code turns up a bunch of stencil
code, but I'm still a little lost (OpenGL newbie).
Thanks,
Cory
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org