Hi, I just want to add that i'm currently trying to read depth buffer in an "osg::Image" object thanks to this topic: "render depth buffer to image for one time" (sorry i can't post link) However, even if it doesn't work for now, i hope this will soon work.
I have seen the kdtree solution to speed the polytope compute algorithm (not test yet). I also tried to store only the nearest point in polytope while I add them in the Intersections typedef (change for std::list instead of std::set in osg solution). the method i customized is void PolytopeIntersector::intersect(osgUtil::IntersectionVisitor& iv, osg::Drawable* drawable) What I made gave me one of the nearest point, but not the one i'm looking for-> I must didn't get something important... Now I use the original PolypeIntersector, but here is what i made. Maybe, if someone can tell me what's wrong, my problem will be solved... Custom Polytope intersector Code: typedef std::list<Intersection> Intersections; inline void insertIntersection(Intersection& intersection) { getIntersections().push_back(intersection); } inline Intersections& getIntersections() { return _parent ? _parent->_intersections : _intersections; } inline Intersection getFirstIntersection() { Intersections& intersections = getIntersections(); return intersections.empty() ? Intersection() : (intersections.back()); } and intersect method: Code: ... if(hit < getFirstIntersection() || !containsIntersections()) { insertIntersection(hit); } I'm sure this problem has already been solved, and i ask for clue in order to not test all possible solutions ;) Thank you for your help! Cheers, Jeremie ;) ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46257#46257 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org