i am doing mesh deformation in unity by hitting tool and on collision mesh has deformed to opposite to the direction of the force , now my deformation is working fine but i am getting problem is that , i have no exact idea on run time that either the mesh is deformed to the proper shape or not , how i get to know that , one method i had already tried was that , i put the same shape in the mesh and get that shapes vertices distance on collision hit.point and then calculate how much vertices are collided from the whole list of all vertices , but this method is not so effective , because on some points the inner shape have more detail and on some points it have less , when it collide on the detailed vertices then its progression jumped to the half of the total , like if i gave bottle as inner shape , and the bottles hap have 400 vertices and other entire bottle have 600 , total are 1000 , when it will collide to the bottles cap it gives 40% progress completed , but the bottle is just shown 5 or 10 % sorry for the english side , im not native english speaker , dont i have delivered my exact point or not , i need help ,
By definition geometric shape is a set of positions in space conforming to specific equation or set of equations. So check your mesh vertices to conform the equation for your shape and see how far it is form the required shape.
@palex-nx i did not get the exact idea , can you please elaborate it , how i can i achieve it , in need progression also , like its 2 percent competed , or 10 % or 90 % and when it deform to the exact shape then it will have 100% and level completed ,
i had tried it using mesh bounds but this method wasn`t usefull
please guide me what equations i should use , as you said geometry shape it can be usefull but i need progression too , which can not achieve through this method
from texture, you can get pixels into array https://docs.unity3d.com/ScriptReference/Texture2D.GetPixels32.html
if both textures are same size, the correct answer “mask texture”
and the current player made shape as texture,
then loop over the pixels, check if mask pixel is, for example, black,
then check the same pixel from the player texture, if it has wood color (or not transparent),
then you get counter values for correct and wrong pixels.
maybe other option would be to compare vertex positions,
view from orthographic 2d side view,
from correct answer mesh: check each vertex, if they overlap the player mesh behind.