ClipNode is positional state (like lights). It just needs to be somewhere in
your scene graph, and it it in effect at *any* part of your scene graph that
enables GL_CLIP_PLANEn. So the placement of ClipNode relative to the cow is
irrelevant.
Don't know about Javier's "CappingEffect"; I'd just use a Camera node to
post-render a fullscreen quad with appropriate stencil settings. It'll only show
up on the capped area if done correctly. Be sure to specify a normal that
matches your clip plane for correct lighting.
-Paul
On 8/1/2011 2:15 PM, Cory Riddell wrote:
Javier,
Thanks so much for the link. I haven't seen this thread before.
I'm looking at your code and I'm not exactly sure how the CappingEffect
node fits into the scene graph.
Say I want to cut the cow in half and cap it. I am going to need a
ClipNode / ClipPlane and the CappingEffect node, correct? Do I then have
to have a topmost group node, with CappingEffect and ClipNode children
then have the cow scene be a child to both of those nodes?
Cory
On 7/26/2011 6:44 AM, Javier Taibo wrote:
Hi Cory,
Sorry I came a bit late to this thread, but just in case you sill
find it useful, I sent some code to the list about a year ago, that
implements the stencil technique described in the red book. It is in
this message:
http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2010-September/044664.html
Regards,
On Wed, Jul 20, 2011 at 5:48 PM, Cory Riddell<c...@codeware.com> 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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org