LINEAR INTREPOLATION
ok for animating faces you can sync words with the animation like so
frame one could be a closed mouth
frame 2 could be the model of the head with the mouth modelled to say O
so the models themsleves dont contain animation the code morphs them
so you can tell it wich mesh to morph to each letter at speed "float interp"
the same can be applied to the terrain to make it LOD smoothly rather than pop
ill read some mesh buffer stuff and ill write irrlicht code for it
Code: Select all
/* interpolate vertices */
v_curr[0] = pframe1->scale[0] * pvert1->v[0] + pframe1->translate[0];
v_curr[1] = pframe1->scale[1] * pvert1->v[1] + pframe1->translate[1];
v_curr[2] = pframe1->scale[2] * pvert1->v[2] + pframe1->translate[2];
/*next*/
v_next[0] = pframe2->scale[0] * pvert2->v[0] + pframe2->translate[0];
v_next[1] = pframe2->scale[1] * pvert2->v[1] + pframe2->translate[1];
v_next[2] = pframe2->scale[2] * pvert2->v[2] + pframe2->translate[2];
/*final result*/
v[0] = v_curr[0] + interp * (v_next[0] - v_curr[0]);
v[1] = v_curr[1] + interp * (v_next[1] - v_curr[1]);
v[2] = v_curr[2] + interp * (v_next[2] - v_curr[2]);