Hi Gianni, years ago whan I was working on a 3D editor I faced similar challenge. I solved it with selection buffer, where I had two representation of the model - one for fast rendering, when you obviously don't pick or manipulate, so your model with osg::PrimitiveSet::POINTS will represent this, and other for picking/editing - here a single vertex was a separate node and along with the selection buffer you can put id on each single vertex. Maybe there are some better ideas, but the approach I took worked very well. Just thoughts
Nick On Wed, Dec 3, 2014 at 1:41 PM, Gianni Ambrosio <g.ambrosio+...@gmail.com> wrote: > Hi All, > I have a surface where a user can pick points. As suggested I used a Geode > with Geometry built with osg::PrimitiveSet::POINTS and verteices. Then I > used PointSprite to show an image on each point (but I think this is not > really important). > > Now I need to drag points with the mouse. First of all I have to handle > the mouse move event to understand on which point the mouse is over. And > now the problem. Given the mouse is over one of the previously picked > points, how can I get which is the exact point of the Geometry from a > osgUtil::PolytopeIntersector? The Intersection object contains a nodePath > that at least refers to the Geometry node, not the single vertex/point. So > I guess I have to loop over the actual picked points coordinates (i.e. > geometry->getVertexArray()) and calculate the distance from the > intersection.localIntersectionPoint. Is that right or is there a better way > to implement it? > > Cheers, > Gianni > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=61962#61962 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org