OpenSceneGraph/examples
Robert Osfield 30a06a033e From Peter Hrenka, (note from Robert Osfield, renamed GenericPrimitiveFunctor mention below to TemplatePrimitiveFunctor).
"Since we desperately needed a means for picking Lines
and Points I implemented (hopefully!) proper geometrical tests
for the PolytopeIntersector.

First of all I implemented a new "GenericPrimiteFunctor"
which is basically an extended copy TriangleFunctor which also
handles Points, Lines and Quads through suitable overloads of
operator(). I would have liked to call it "PrimitiveFunctor"
but that name was already used...
I used a template method to remove redundancy in the
drawElements method overloads. If you know of platforms where
this will not work I can change it to the style used
in TriangleFunctor.

In PolytopeIntersector.cpp I implemented a
"PolytopePrimitiveIntersector" which provides the needed
overloads for Points, Lines, Triangles and Quads to
the GenericPrimitiveFunctor. This is then used in the
intersect method of PolytopeIntersector.

Implementation summary:
- Points: Check distance to all planes
- Lines: Check distance of both ends against each plane.
  If both are outside -> line is out
  If both are in -> continue checking
  One is in, one is out -> compute intersection point (candidate)
  Then check all candidates against all other polytope
  planes. The remaining candidates are the proper
  intersection points of the line with the polytope.
- Triangles: Perform Line-Checks for all edges of the
  triangle as above. If there is an proper intersection
  -> done.
  In the case where there are more than 2 polytope
  plane to check against we have to check for the case
  where the triangle encloses the polytope.
  In that case the intersection lines of the polytope
  planes are computed and checked against the triangle.
- Quads: handled as two triangles.

This is implementation is certainly not the fastest.
There are certainly ways and strategies to improve it.


I also enabled the code for PolytopeIntersector
in osgkeyboardmouse and added keybindings to
switch the type of intersector ('p') and the picking
coordinate system ('c') on the fly. Since the
PolytopeIntersector does not have a canonical
ordering for its intersections (as opposed to
the LineSegementIntersector) I chaged the
implementation to toggle all hit geometries.


I tested the functionality with osgkeyboardmouse
and several models and it seems to work for
polygonal models. Special nodes such as billboards
do not work.


The next thing on my todo-list is to implement
a an improved Intersection-Structure for the
PolytopeIntersector. We need to know
which primitives where hit (and where).

"
2007-05-23 11:05:59 +00:00
..
osganimate Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgautotransform Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgbillboard Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgblendequation Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgcallback Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgcamera Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgcatch Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgcegui Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgclip Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgcluster Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgcopy Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgcubemap Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgdelaunay Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgdepthpartition Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgdepthshadow Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgdistortion Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgfadetext Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgforest Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgfxbrowser Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osggeodemo Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osggeometry Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgGLUTkeyboardmouse Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgGLUTsimple Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osghangglide Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osghud Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgimpostor Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgintersection Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgintrospection Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgkeyboard Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgkeyboardmouse From Peter Hrenka, (note from Robert Osfield, renamed GenericPrimitiveFunctor mention below to TemplatePrimitiveFunctor). 2007-05-23 11:05:59 +00:00
osglauncher Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osglight Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osglightpoint Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osglogicop Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osglogo Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgmanipulator Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgmotionblur Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgmovie Further work on dome correction 2007-05-08 15:32:35 +00:00
osgmultiplecameras Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgmultitexture Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgoccluder Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgpagedlod Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgparametric Moved VBO switching code into inline methods into osg::State to speed performance 2007-05-01 06:28:20 +00:00
osgparticle Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgparticleeffects Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgphotoalbum Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgpick Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgplanets Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgpoints Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgpointsprite Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgprecipitation Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgprerender Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgprerendercubemap Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgreflect Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgscalarbar Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgscribe Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgsequence Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgshaders Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgshaderterrain Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgshadow Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgshadowtexture Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgshape Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgsimple Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgsimpleviewerCocoa From Eric Wing, "Minor robustness fix to osgsimpleviewerCocoa." 2007-04-12 09:18:40 +00:00
osgsimpleviewerFLTK Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgsimpleviewerGLUT Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgsimpleviewerQT3 Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgsimpleviewerQT4 From Mathieu Marache, "I tried the latest developper release 1.9.4 and found that I hadn't 2007-05-15 11:31:09 +00:00
osgsimpleviewerSDL Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgsimpleviewerWX Reverting Luigi's addition of argv[1] as it breaks the build. 2007-05-21 13:15:26 +00:00
osgsimplifier Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgsimulation Made the near far ratio lower to allow one to be near the terrain before clipping 2007-05-19 13:38:38 +00:00
osgslice Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgspacewarp Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgspheresegment Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgspotlight Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgstereoimage Added support for View::setFustionDistance(..) 2007-05-17 19:58:57 +00:00
osgteapot Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgterrain Added TerrainNode::init() and s/getTreatBoundariesToValidDataAsDefaultValue flag. 2007-05-13 09:54:51 +00:00
osgtessellate Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgtext Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgtexture1D Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgtexture2D Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgtexture3D Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgtexturerectangle Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgunittests Added signOrZero template method, and to Matrix_implementation.cpp usage of this 2007-05-09 09:26:33 +00:00
osgvertexprogram Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgviewerMFC From Michael Hartman, "I have made a small change to the osgviewerMFC application that resolved most of my home computer issues. It seams that my home computer needed to have the pixel format set with PFD_DOUBLEBUFFER. 2007-05-19 12:27:53 +00:00
osgvolume Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
osgwindows Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
CMakeLists.txt From Michael Hartman, "I have gone in and created a CMakeList.txt file for osgviewerMFC application. 2007-05-17 11:04:57 +00:00