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