Hello Martin,

I'm using osg version 2.8.3 with visual C++ express, and my os is windows xp. I 
also tried the basic examples I could find on tutorials and on the osg website 
but I still have the same problem :(. I guess it comes from my configuration.
I used this tutorial to install osg : 
http://dwightdesign.com/2009/05/installing-openscenegraph-280/.
I used the prebuilt version of osg.

 Everything I tried on osg worked perfectly except for this function (I also 
tried polytope intersector, height above terrain... but I got the same error).

You're right it looks like the program is allocating all the memory to the 
hitlist (the size is over 4 billion). However it looks like the apply method 
works : I've fot a number of intersections but I just can't have access to the 
intersection points coordinates.

 The code is as follows. m_node points to a model I loaded. The model works 
fine (it's basically a set of (a lot of) points joined by panels).

osg::LineSegment *ls = new
osg::LineSegment(osg::Vec3d(-5,-5,-5),osg::Vec3d(5,5,5));
osgUtil::IntersectVisitor *iv = new osgUtil::IntersectVisitor();
iv->addLineSegment(ls);
iv->apply(*m_node);
std::cout << iv->getNumHits(ls) << " intersection points (hits)." <<
std::endl; //result = 6
osgUtil::IntersectVisitor::HitList& hitlist = iv->getHitList(ls);
std::cout << "size : " << hitlist.size() << std::endl;
//std::vector<osgUtil::Hit>::iterator itr = hitlist.begin();
hitlist[0].getWorldIntersectPoint(); //causes unhandled exception... 



Thanks for your help,

Olivier

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=27950#27950





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to