Hi,
I build an event handler for picking and everything work fine, we do
something like that
bool KEYBOARD_EVENT_HANDLER::handle(const osgGA::GUIEventAdapter&
ea,osgGA::GUIActionAdapter& aa)
{
   switch(ea.getEventType())
   {
       case(osgGA::GUIEventAdapter::PUSH):
       {
           osgProducer::Viewer* viewer =
dynamic_cast<osgProducer::Viewer*>(&aa);
           float x = ea.getX(); // x,y screen
           float y = ea.getY();
           osgUtil::IntersectVisitor::HitList benny;
           if (viewer->computeIntersections(x,y,benny))
           {
               .
               .
               .
               osg::Vec3 v1,v2;
               viewer->computeNearFarPoints(x,y,0,v1,v2);
               .
               .
               .
           }
       }
   }
}
Now, I need to use GUI for my program so I use QT4, and I use Robert
example.
the problem is that the dynamic_cast return me NULL...
so I try to find intersection without the viewer, I study
osgUtil::IntersectVisitor, but there is a problem I don't know how to
convert me screen point(the one that I get from the osgGA::GUIEventAdapter).
another problem that I need to find the world coordinate of a given point in
the screen and a given z value until know I use the computeNearFarPoints
function to calculate it.

what I can do?
there is a way to work with viewer after all?
there is another way to find intersection?
there is replacement to those function that I can use?


thanks
NB
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to