|
osgIntersect is a lib and a set of templates that allows you to make all intersections you want between a custom geometric object (line, triangle, triangle soup, cynlinder, polytope, ...) and a (sub) scene-graph.
It has one part for general intersection, and one other for picking (using the general intersections).
For now, you can intersect/pick with line (as the core osg intersect/picker) AND POLYTOPE. With that last, you can pick rectangle areas on the screen, including Points, Lines and Triangles (the osg core picker can only pick triangles).
IMPORTANT2005-07-14 : I leave my 3d job to something very different, and I'll have not much time to maintain this package... So, IT MAY NOT COMPILE ON CURRENT OSG CVS . It worked on 0.9.8, and I guess on 0.9.9 too... but, with luck, it can still work on current cvs though... For trouble, bugfix, ... contact me at zebarbuc at free.fr . I'm looking for someone that could take the lead of this package at my place...Download CVSYou can grab it here: cvs -d :pserver:cvsguest@openscenegraph.org:/cvs/osgintersect co osgintersect It uses 'qmake' for build system (as simple as typing 'qmake && make' to compile...). Please, submit your patches to me ( zebarbuc at free.fr ), with same convention as for osg: the whole modified files.Features:
Known limitations:
The example:There is an example that show how simple it is to use it (~ same api than actual picking system). The example also contain code that highlight the picked geometries (in blue, the nearest point of the geometry in the picking volume, and in red, the picked geometries). Pick by clicking while pressing a 'shift' key (drag the mouse to draw a rectangle). Then (release the shift key), the picking volume will be drawn, as well as intersected geometries. You can then move around to see the picking volume and the picked geometries. In the example, picking is really fast, but as we create new geometries to show what is picked, it seems slow. It is NOT the intersection time, but the geometries generation that take the most time (geom generation is not optimised at all). Have a look at the following screenshots, and have a try by yourself! It shows what I had when I had picked a rectangle, and then, moved the camera: we see the camera position when I picked, and the rectangle projection with hited geometries.![]() ![]() |