HI Arthur, Projective textures such as done in the OverlayNode knows nothing about depth so can't do what you require as is. The best you could do is just decide yourself what whole objects have the texturing on them by enabling/disable the texture modes for them, or excluding them from the OverlayNode subgraph.
>From the sound of it what you are after is very specific to your needs and you'll need to pursue another technique, this might involve projective texturing, but since you have a very specific usage you'll need some quite custom. Robert. On Mon, May 3, 2010 at 9:02 PM, Arthur Palosz <[email protected]> wrote: > Hi, > > I am trying to use an overlay node to highlight certain areas of a model. > I have it working to the point that the correct spots on the model are > indeed highlighted, but unfortunately the highlight passes through the top > of the model and shows up on the opposite side of the model as well and > everything in between. > > For example, I would want to draw a few circles on the top of a three story > builing. These circles would also show up on the 1st floor, 2nd floor, the > ceilings, etc. How do I stop the overlay node on the first face that it hits? > > > > osg::Group* subgraph = new osg::Group(); > > { > //create a bunch of geodes and attach them to the subgraph > } > > osgSim::OverlayNode* overlayNode = new > osgSim::OverlayNode(osgSim::OverlayNode::OverlayTechnique::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY); > overlayNode->getOrCreateStateSet()->setTextureAttribute(1, new > osg::TexEnv(osg::TexEnv::Mode::DECAL)); > > overlayNode->setContinuousUpdate(true); > overlayNode->setOverlaySubgraph(subgraph); > overlayNode->setOverlayBaseHeight(-1.5); > > overlayNode->addChild(targetModel->modelTransform); > scene->removeChild(targetModel->modelTransform); > scene->addChild(overlayNode); > > > ... > > Thank you! > > Cheers, > Arthur > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=27521#27521 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

