Question by
dou0er · Aug 11, 2017 at 06:49 AM ·
meshmesh vertices
3D mesh vertices ,face was torn,why?
hi gus,i am try to make a music visualizer,i use a sphere to as a response to audio source.
public void DeformMesh(Mesh mesh, float inRadius) {
_vertices = mesh.vertices;
_normals = mesh.normals;
float _fSqrRadius = inRadius * inRadius;
for (int i = 0; i < mesh.vertices.Length; i++) {
if(AudioManager.spectrum[i] >= 0.01) {
Vector3 temp = _normals[i] * AudioManager.spectrum[i] * musicStrenth;
if (Vector3.Distance(Vector3.zero,temp) >= inRadius) {
_vertices[i] = Vector3.Slerp(_originalVertices[i], temp, Time.deltaTime);
}
}
}
mesh.vertices = _vertices;
mesh.RecalculateBounds();
}
but,Unfortunately, the result is
The face was torn, and I did not know why it was.
I wish someone can help me,Thanks.
image.png
(105.3 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612132244im_/https://answers.unity.com/themes/thub/images/avi.jpg)