At 8:21 AM -0800 2/14/06, Jeff Quan wrote:
I'll look into this too (and shout for help if need be!). My only
goal in this test is to get the morphing working and solve my
backfaces triangle problem -- I haven't optimized anything yet. As a
teaser, this demo app might show up in my talk at REALworld if I can
clear out enough of the bugs to make it presentable :)
Sounds great! I took a moment to play with it some more this
morning, and came up with this:
// Calculate the percentage to morph based on elapsed time and
// the frames/sec of the animation in question.
percent = (FPS - timeLeft) / FPS
Dim startList As VectorList = start.VertexPositions
Dim goalList As VectorList = goal.VertexPositions
// Calculate difference vector between start and goal.
Dim target As VectorList = mObjTrimesh.VertexPositions
target.SetToDifference( goalList, startList )
// Calculate how far to move along difference vector.
target.MultiplyAllBy percent
// Add it back to original positions to get final move.
target.AddList startList
This works fine, *if* I remember that you can't use something you're
already morphing as either the "start" or "goal" pose. Well, you
could, but the result is probably not going to be what you wanted!
The simplest rule is to have one trimesh that you morph, and a set of
"target" poses that you never muck with, so that you can always
interpolate between them; if have a mesh that is both a target and is
being morphed, it gets a lot more complicated to keep track of what's
going on.
Your demo was using mObjTrimesh(0) as both the mesh to morph, and as
one of the poses. I just changed this so that it uses only meshes 1
through 8 as target poses, and then it seemed to work fine.
Note that this problem should occur regardless of whether you're
updating the vectors all at once, or one at a time -- I'm not sure
why your original code didn't show the problem.
Best,
- Joe
--
Joseph J. Strout
joe at strout dot net
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|