Morphing test

So far, I hadn’t try to morph 3D objects to other 3D objects and I thought it’s something tricky to do. Today, I realized how simple and easy it is when I wrote this small test in a couple of hours:

If you carefully choose the 3D models to have the same number of polygons, and to meet a few topological requirements, then you only need to interpolate the values of the meshes’ vectors, normals (and materials, textures, whatever you need) and draw the intermediate mesh every time. As interpolation parameter you can choose the values of a positive function that varies from 0 to 1 and backwards (I used (sin(msecs/factor) + 1)/2) to have that continuously changing effect. And that’s all! Probably, the 2hrs were too much :D

The test is here: https://bitbucket.org/eleni-hikiko/morphing and it includes an obj with a scene with 3 meshes that meet the morphing requirements  (I only used the first two).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s