[osg-users] Need Help

Mr.lv eerfcfc555 at sina.com
Wed Dec 6 18:44:40 PST 2017


I meet a question , how can i get exactly  pointArray of osgUtil::PolytopeIntersector::Intersection? osg::ref_ptr<osgUtil::PolytopeIntersector> picker = new osgUtil::PolytopeIntersector(osgUtil::Intersector::WINDOW, mx - w, my - h, mx + w, my + h);
 osgUtil::IntersectionVisitor iv(picker);
 getViewer()->getCamera()->accept(iv);
 if (picker->containsIntersections())
 {
  osgUtil::PolytopeIntersector::Intersection intersection = picker->getFirstIntersection();
  osg::Drawable* dr = intersection.drawable;
  osg::Vec3Array* vArray = (osg::Vec3Array*)dr->asGeometry()->getVertexArray();
  osg::Geode* geode = createLineByLocal(vArray);
  if (!geode)return;
  osg::Node* node = getWorldNode(geode);
  if (!node)return;
  add2TempLyr(node);}
what i got was wrong ,  who can helo me? thank you very much!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20171207/a67b03da/attachment.html>


More information about the osg-users mailing list