Hi, everyone. I have a class called Point that is derived from MatrixTransform. An instance of this class always has a Geode child, which has a Drawable, which is a ShapeDrawable. For better understanding of things, I'll use a simple shape for a drawable, let's say a sphere. Let's suppose I have an instance of my Point class, which is attached to the viewer, being displayed on the screen
I use a PickHandler class that is as follows: bool PickHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) { osgViewer::Viewer* viewer = dynamic_cast<osgViewer::Viewer*>( &aa ); osgUtil::LineSegmentIntersector::Intersections intersections; if(!viewer) { return false; } switch(ea.getEventType()) { case(osgGA::GUIEventAdapter::PUSH): { if(Intersecao(viewer, ea)) { ... } // I'LL TALK ABOUT THESE BRACKETS FURTHER AHEAD } } } bool PickHandler::Intersecao(osgViewer::Viewer* viewer, const osgGA::GUIEventAdapter& ea, osg::Util::LineSegmentIntersector::Intersections intersections) { return (viewer->computeIntersections(ea.getX(),ea.getY (),intersections)); } So, I guess my question is: what do I write inside those brackets that I marked above to traverse till the drawable and change its color? What I really need here is some language learning, not only theoretical, OK? In other words: if you could write a little bit of source code to clarify what you are saying, that'd be great. Thanks, everyone. If you manage to explain how it's done to the newbie you're talking to, I'd be grateful. Renan M Z Mendes
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org