0

I have two meshes Mesh1 and Mesh2. Mesh1 does not necessarily have the same amount of vertices or faces as Mesh2.

What is the best way to "transition" between these two meshes smoothly?

Obviously, I could do a linear interpolation of some sort. But there are some problems beyond this that I need to solve. One problem that I'm facing is the "not necessarily have the same amount of vertices or faces" part. Maybe I need to bypass this restriction by taking one of my faces in one of the meshes and subdividing it until there's the same amount of faces in both meshes (would this adjust the result in a weird way, like an "explosion" in the subdivided part?)

However, the main problem is choosing which faces on Mesh1 correspond to Mesh2. Is there any algorithm that can accomplish this?

Tyrcnex
  • 196
  • 12
  • maybe with a spherical coordinate system which has its origin in the COM or geometric center of the mesh and then pair the faces with similar coordinates – bb1950328 Jan 05 '23 at 13:24
  • @bb1950328 How would I find these "similar coordinates"? – Tyrcnex Jan 05 '23 at 15:17
  • go through all face combinations with two nested for loops. get the two angles of both faces. Find the [angle difference](https://stackoverflow.com/questions/1878907/how-can-i-find-the-smallest-difference-between-two-angles-around-a-point) for both angles and compute the "diagonal" using pythagoras. save all combinations with their resulting "diagonals" in a list or something similar. sort this list and match the pairs from the smallest distance to the largest distance. this probably can be optimized quite a bit if you care about performance – bb1950328 Jan 05 '23 at 17:35
  • @bb1950328 I think this would be quite taxing on my Desmos graph. – Tyrcnex Jan 07 '23 at 06:22
  • Ooh, I found something called a blendshape. I wonder if there's an algorithm for this? – Tyrcnex Jan 07 '23 at 06:25
  • 1
    I did not find an algorithm for blendshape. But I found these papers/slides [1](https://www.cs.ubc.ca/~sheffa/dgp/ppts/morphing.pdf) [2](http://multires.caltech.edu/pubs/morphing.pdf) [3](https://ep.liu.se/ecp/034/011/ecp083411.pdf) and this answer [4](https://computergraphics.stackexchange.com/questions/12680/3d-head-mesh-morphing-from-one-mesh-into-another-using-coding). in these documents you should find enough ideas to solve your problem. – bb1950328 Jan 07 '23 at 10:31
  • @bb1950328 These seem useful, thanks! – Tyrcnex Jan 07 '23 at 10:58

0 Answers0