Re: [osg-users] IntersectVisitor does not recognize Nodes on different Projection

2009-11-30 Thread Peter Hrenka

Hi Thorsten,

Thorsten Werner schrieb:

Hi,

OK. Thank you. Got it working now. Changed setProjectionMatrixOrtho2D into 
setProjectionMatrixOrtho. Next problem that i have is that the Buttons in my 
SceneGraph consist of several geometries and the Button is a Geode but its not 
recognized as Geode. Only as several Geometries. I dont know how to solve this. 
After going through the API i found Geode-setNodeMask. Could this help maybe? 
Ive no idea what a nodemask is though...


If you are looking for the Geode you can use the nodePath field of
the Intersection result which contains the complete path leading to
the hit geometry.

NodeMasks are basically bitmasks that can be used in the context of
intersection testing. You can set them using Node::setNodeMask()
and search for Nodes matching a NodeMask using
osgUtil::IntersectionVisitor::setTraversalMask().
But even using this method you still have to look in the NodePath to 
find your geode...



Thank you!

Cheers,
Thorsten


Cheers,

Peter
--
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech

Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] IntersectVisitor does not recognize Nodes on different Projection

2009-11-27 Thread Thorsten Werner
Hi,

OK. Thank you. Got it working now. Changed setProjectionMatrixOrtho2D into 
setProjectionMatrixOrtho. Next problem that i have is that the Buttons in my 
SceneGraph consist of several geometries and the Button is a Geode but its not 
recognized as Geode. Only as several Geometries. I dont know how to solve this. 
After going through the API i found Geode-setNodeMask. Could this help maybe? 
Ive no idea what a nodemask is though...

Thank you!

Cheers,
Thorsten

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] IntersectVisitor does not recognize Nodes on different Projection

2009-11-26 Thread Peter Hrenka

Hi Thorsten,

Thorsten Werner schrieb:

Hi,

I've got a loaded model which is a child of the root.
the second child of the root node is a ortho2d projection, which i use for the 
GUI. Now i've taken the example osgkeyboardmouse from the osg site and my 
problem is that it only catches intersections with the loaded model. Not with 
the Goedes which are at the Ortho2D ProjectionMatrix.

double w(.05), h(.05);
osgUtil::PolytopeIntersector* picker =
new osgUtil::PolytopeIntersector(
osgUtil::Intersector::PROJECTION,
x-w, y-h, x+w, y+h);
osgUtil::IntersectionVisitor iv(picker);
viewer-getCamera()-accept(iv);

this is how i configured the Visitor. I've tried to change the Intersector into a osg::Intersector::WINDOW. ut then absolutely nothing happens anymore. 


What kind of primitives are you trying to pick?
For Triangles/Quads it is more efficient to use the 
LineSegementIntersector (which is the default when you start

osgkeyboardmouse, you can toggle using 'p'). The osgpick example
always uses the LineSegementIntersector.

Assuming you want to use PolytopeIntersector, I have to say
that it not work well when Projections are involved.
To fix that properly we might need a completely different
approach.
As a workaround you could try to call PolytopeIntersector
on your (unprojected) HUD-Node directly and see if it helps.



Thanks in advance.

Cheers,
Thorsten


Cheers

Peter
--
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech

Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] IntersectVisitor does not recognize Nodes on different Projection

2009-11-25 Thread Thorsten Werner
Hi,

Thanks for the tip but i dont see the difference which makes it work and mine 
not. Ive changed some parts of my code but i in my opinion it should work.

Any further help is highly anticipated. 

Thank you!

Cheers,
Thorsten

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




Attachments: 
http://forum.openscenegraph.org//files/tgeventhandler_168.hpp
http://forum.openscenegraph.org//files/thyrgon_624.cpp


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] IntersectVisitor does not recognize Nodes on different Projection

2009-11-24 Thread Thorsten Werner
Hi,

I've got a loaded model which is a child of the root.
the second child of the root node is a ortho2d projection, which i use for the 
GUI. Now i've taken the example osgkeyboardmouse from the osg site and my 
problem is that it only catches intersections with the loaded model. Not with 
the Goedes which are at the Ortho2D ProjectionMatrix.

double w(.05), h(.05);
osgUtil::PolytopeIntersector* picker =
new osgUtil::PolytopeIntersector(
osgUtil::Intersector::PROJECTION,
x-w, y-h, x+w, y+h);
osgUtil::IntersectionVisitor iv(picker);
viewer-getCamera()-accept(iv);

this is how i configured the Visitor. I've tried to change the Intersector into 
a osg::Intersector::WINDOW. ut then absolutely nothing happens anymore. 

Thanks in advance.

Cheers,
Thorsten

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org