[osg-users] Need Help

michael kapelko kornerr at gmail.com
Thu Dec 7 01:58:14 PST 2017


Hi. What do you want to achieve?

On 7 December 2017 at 05:44, Mr.lv <eerfcfc555 at sina.com> wrote:
> 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!
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


More information about the osg-users mailing list