Hi Maxime,

Maxime BOUCHER schrieb:
[...]
Peter Hrenka wrote:
You call the method accept(osg::NodeVisitor&) of your model (which is a osg::Node).
See the example osgkeyboardmouse.



My bad, I should have seen it.

We certainly need an osgpolytopeintersector example...
Meanwhile "grep" is your friend.


Peter Hrenka wrote:
This exercise is about polygons not polytopes!



Yes, I meant "testing this way for each primitive".

Well... I fail to see an analogy here.
The point of Polytopes is that they are convex which makes
all kinds of tests very easy. If you want to modell something
non-convex (something like Constructive Solid Geometry) then PolytopeIntersector will not help you as it is.


Peter Hrenka wrote:
As for the PolytopeIntersector: It will give you all points,
lines, triangles and quads which truly intersect the polytope volume,
given by the primitive index.



Sorry, I'm not sure I really understand.
It is possible to get the intersected triangle instead of just a list of 
intersections coordinates?

The struct PolytopeIntersector::Intersection contains a int-member "primitiveIndex" which probably is what you want.
There is code to output the primitiveIndex in the osgkeyboardmouse example.

You can access the first intersection with PolytopeIntersector::getFirstIntersection() or the set of all Intersections with PolytopeIntersector::getIntersections().


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

Reply via email to