MATLAB: 3D Mesh morphing

3d mesh morphing

I have two 3D meshes(460 by 3 )and I want to do simple morphing between them and save the morphing as an avi. file.
Does anyone have an idea ?
Thank you

Best Answer

Before morphing, you first have to establish dense point correspondences between the two surfaces. You can address this problem in multiple ways. Here is one approach:
First, you have to make sure that the surfaces are registered within a common frame of reference. In other words you have to find a global rigid (or similarity if scale is not important) transformation that will maximally align the two surfaces. You could use one of the implementations of ICP (iterative closest point) algorithm from FEX for this purpose. For example: http://www.mathworks.com/matlabcentral/fileexchange/24301-finite-iterative-closest-point
Second, you need to find pointwise correspondences between the surfaces (S1 and S2). This means that given a point on S1, you can find its counterpart on S2. The simplest approach would be to select the points based on spatial proximity. After you selected a set of corresponding points {x1_i} and {x2_i}, you can use thin plate splines (TPS) to find a smooth displacement field, D(), such that D(x1_i)=x2_i. One of many TPS implementations from FEX: http://www.mathworks.com/matlabcentral/fileexchange/22227-thin-plate-splines
Third, you can now map all vertices from S1 to S2 using D() from step 2.
Finally, you can now morph S1 into S2 using S(t)=(1-t)*S1+t*S2, where t is a scalar on the interval [0,1]. Note S(t=0)=S1 and S(t=1)=S2.