Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-08-02 Thread Alessandro Terenzi
I'm trying the Javier's "CappingEffect" example and it seems to work fine...but only when I look at the scene from one side...if I move the camera to the opposite side I still see the cappings that are drawn over my geometry (they should be hidden instead)...please refer to the attachments to se

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-08-01 Thread Paul Martz
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

[osg-users] using ClipNode to cut a model in two, then cap the open side

2011-08-01 Thread Sergey Kurdakov
Hi just an example of what can be done with ogs in this respect http://forum.openscenegraph.org/viewtopic.php?t=8512 ( also some hints ) Regards Sergey ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listin

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-08-01 Thread Cory Riddell
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, corr

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-26 Thread Javier Taibo
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.

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Paul Martz
On 7/20/2011 3:16 PM, Chris 'Xenon' Hanson wrote: I think everyone should own the Red Book, period (and Orange book while you're at it). But I think Distilled and SuperBible are much better for learning. Can I hire you as my PR man? :-) -- -Paul Martz Skew Matrix Software

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Paul Martz
On 7/20/2011 2:42 PM, Cory Riddell wrote: I'm curious, why didn't you suggest your own book? _OpenGL Distilled_ was intended for people that already knew 3D graphics concepts and just wanted an introduction to the OpenGL API. I assumed the reader already knew what a stencil buffer was, for ex

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Chris 'Xenon' Hanson
On 7/20/2011 2:42 PM, Cory Riddell wrote: > I'm curious, why didn't you suggest your own book? Modesty? I'll recommend Paul's book for LEARNING. The Red Book is fine, for reference. But having a Toyota Service manual doesn't help you understand how to drive a Camry. > Because it isn't fo

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Cory Riddell
On 7/20/2011 3:34 PM, Paul Martz wrote: > :-) There are a lot of people that try to write OSG code without > knowing what's going on under the hood. I strongly recommend the > OpenGL red book: > > http://www.amazon.com/OpenGL-Programming-Guide-Official-Learning/dp/0321552628/ref=sr_1_1?s=books&ie=U

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Paul Martz
On 7/20/2011 12:27 PM, Cory Riddell wrote: Paul, thanks for the opinion. I think I'm getting close to the limits of what I can do with OSG without knowing a thing about OpenGL (and I'm pretty stoked about how much I was able to accomplish without really knowing what I'm doing). Time to buckle do

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Cory Riddell
Hi Robert, The osgreflect example is the one I was using as a guide along with the article I linked to in my first post. I didn't get it working, but I have an inkling of how it should work. I really need to step back though and learn some fundamentals first. Cory On 7/20/2011 3:14 PM, Robert O

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Robert Osfield
Hi Cory, Have a look at the osgreflect example to see how you can set up stencil buffer usage in the OSG. Robert. On Wed, Jul 20, 2011 at 7:27 PM, Cory Riddell wrote: > Paul, thanks for the opinion. I think I'm getting close to the limits of > what I can do with OSG without knowing a thing abou

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Cory Riddell
Paul, thanks for the opinion. I think I'm getting close to the limits of what I can do with OSG without knowing a thing about OpenGL (and I'm pretty stoked about how much I was able to accomplish without really knowing what I'm doing). Time to buckle down and learn some (modern) OpenGL. I'm going

Re: [osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Paul Martz
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

[osg-users] using ClipNode to cut a model in two, then cap the open side

2011-07-20 Thread Cory Riddell
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