Dears,
My name is Bruno and I´m a student in Computer Science´s Undergraduate´s Course in Brazil. I will conclude my course at this semester and, as requested by my University, I need to present a formal work to that. I´m actually working on deformable meshes using Unity (fantastic software!), doing something similar to the “Mii System Creator”, like on Wii console.
My work is doing well in some way, “morphing” the mesh using parameters like height, pounds, strenght but I´m having serious troubles with deformable meshes (aka mesh´s vertex list) in Unity. Let´s me explain in steps:
- I created a script that receives the mesh (M) and a controller point (P) wich I change its position by translation on Y-axis;
- The script detects a raycast from P to M and define a vertex point (V) in M;
- So, I determine the distance (D) between V and each other vertex in M, in order to translate (by any factor) just vertex with a threshold on D.
The steps 1 to 3 are well done! The mesh M associated with the controller point P change its form (here is the deformable thing) like P translation, using some kind of equation (we are using linear transformation, but we intend to use something more robust like gaussian or Bezier - this is not a problem).
My “big trouble” appears on the 3rd step. As our algorithm works with parameters (first at all we are using just the position of P), we calculate the vertex changing on M using V and P translation. BUT, the mesh deforming is accumulating the vertex translations. We tried to save the original mesh and apply the deformable function over it, but for some reason, still accumulating the vertex translations. It´ll be better wether we just pass the deformable factor and the mesh change its shape.
I hope someone here could explain how to fix that.
Best regards!
Bruno