Hi Emeric, although they are right in the book about colors being vertex attributes I think You can achieve the effect You are after by using osg::Material and adjusting the alpha and then use a proper Blending Function. Have a look at osghud example it has blended quad on top of the screen.
If You want to show/hide then probably the best is to use setNodeMask on Your osg::Geode containing the osg::Geometry Hope this helps Cheers, Nick On Fri, Jan 24, 2014 at 9:10 PM, Émeric MASCHINO <[email protected]>wrote: > Hi, > > In the OpenSceneGraph 3 Cookbook is explained how to highlight the > selected triangle face of a model. > This is performed by creating a new triangle Geode that overlaps the > selected triangle face. > As outlined in the book: "Maybe you are still looking for a way to > change the face's color to highlight it. Unfortunately it is > impossible to modify the face color in OpenGL because color is in fact > a vertex attribute. Shaders may help represent a specified face with a > different color or transparency, but it seems to make a mountain out > of a molehill in this recipe." > Now, this is what I'm looking for, so I need to make this mountain in > order to display the selected triangle face as a transparent surface. > Are there any pointers on how to achieve this with a shader as > anticipated in the book? Or is there yet another solution? > Rather than blending the selected triangle face, suppose that I want > to hide/show it, would I use the same technique than for blending it > or not? > > Thanks, > > Émeric > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

