Hi Sawl, The easiest way to do picking is to use the LineSegmenetIntersector/IntersectionVistor as illustrated in the osgpick example. For models with large number of triangles you can generate KdTree's from the Geometry which vastly speeds up the intersection testing. See the include/osg/KdTree header for info on KdTree.
Robert. On 30 August 2012 09:03, wh_xiexing <wh_xiex...@sina.com> wrote: > Dear friends: > > in openGL programming . there is a method to pick the object from > the scene. rendering the scene in the back buffer, every object with an > unique color . > than , rendering second time in a normal way. when the user move mouse in > the screen . read the pixel value under the mouse point . then find the > color in > an prepared hashmap. comparing the color , we can known which object is > selected. > i am wondering whether the osg can archieve the same goal ? > because i want to implement an edit function with osg . i have a mountain > model composite of hundreds of > thousands of triangles . and my goal is putting high resolution digital > image on the model, and fusion the image and model into a model with texture > . now , the problem i face is > that using the mouse to find the same points in the model and in the > digital image. > > can some one give me an advice. > > ________________________________ > Shawl > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org