[osg-users] how to draw a Curved Surface?

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Tue Nov 24 01:19:59 PST 2015


Bean,
Sorry, but I'm not a human debugger.
It returns false because you are not hitting anything. It is up to you 
to analyze the parameters passed to the intersector. Usually one would 
use window coordinates from a pick event however.
You are not giving enough information here.

Cheers
Sebastian

> Hi Sebastian,
>                      I use the way about your method, but I get zero 
> point. I may use wrong. Here is the code:
>        const float x = v1.x();
> const float y = v1.y();
> const float look_offSet = 10.0f;
> osg::ref_ptr<osgUtil::PolytopeIntersector> polyIt = new 
> osgUtil::PolytopeIntersector(osgUtil::Intersector::PROJECTION, x - 
> look_offSet , y - look_offSet, x + look_offSet, y + look_offSet );
> polyIt->setDimensionMask(osgUtil::PolytopeIntersector::DimZero);    // 
> only pick points
>
> osgUtil::IntersectionVisitor iv(polyIt );
>
> m_OSG->getViewer()->getCamera()->accept(iv);
> osg::ref_ptr<osg::Vec3Array> v = new osg::Vec3Array;
>
> if (polyIt->containsIntersections())    //this is "false" Why???
> {
>                            .....
>          }
> cheers,
> Bean
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20151124/c9b4081d/attachment-0003.htm>


More information about the osg-users mailing list