Okay, I did some reading and I think this should be fairly easy!  What we need 
is 'combinatorial compatibility' between the two targets (i.e. a 1 to 1 mapping 
between vertices and edges).  The book by Gomes et al. describes several ways 
to achieve this but the simplest one that doesn't require user interaction runs 
something like this:

         Project vertices onto common geometry with a known distance metric 
(unit sphere is a good 'catch-all' here).

         For each vertex in one target (either one), find the polygon in the 
other target that contains it (using the projected geometry) and add this new 
vertex, subdividing the polygon appropriately.

         Repeat for the other target.


Now, for every vertex in target A, there is a new vertex created in target B 
for it to map to (and vice-versa).  As a result, each target has the same 
number of vertices (the sum of the vertices in the original targets) and we 
know which one goes with witch.  To avoid any unnecessary vertex duplications, 
I envision a preliminary step where we search for matching vertices in the two 
targets before we start adding any (ones that project to the same point on the 
sphere, or nearly the same point).

Anyways, I think I'm going to implement the above with a spherical projection 
and see what I get.  I have no experience with OSG so I will probably do this 
outside of OSG for now and just save the adjusted target geometry to load into 
OSG for animation.  If someone more comfortable with the OSG code base wanted 
to work it into the MorphGeometry class that would be super (and probably more 
efficient than if I tried to do it).

I'll post whatever I come up with.

Cheers!
Seth[/list]

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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to