Calculate Point$3$D weights used in weighted Point$3$D average for mesh morphing

11 Views Asked by At

I'm trying to build a script with which i can do mesh morphing. My idea is to use a mesh and markerpoints on this mesh. Then by moving the markerpoints to deform the mesh. I've tried to this by using a formula to calculate weighted average. But I'm stuck at calculating the proper weights for all the markerpoints. My idea is to calculate foreach meshpoint a set of weights foreach markerpoint. Move the markerpoints and calculate the new position for the meshpoint. I wanted to do this based on the distance from meshpoint to markerpoint, where closer points have more weight. I can find the math to do this for 2 markerpoints. 3 or more points are giving me the problem. Can of you help me with this? Maybe point me in the right direction?

Thanks in advance Reinder