Hi Oliver,
Mmmm isn't IntersectVisitor Depreciated, not sure what version that was?
Try IntersectionVisitor instead?
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/Intersecti
ons

Maybe Robert can advise :) ?


Martin.





-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Olivier
Martinaud
Sent: 17 May 2010 18:09
To: [email protected]
Subject: Re: [osg-users] problem with osgUtil::IntersectVisitor and
osg::LineSegment

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

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

Reply via email to