EDIT, i have kindof figured out what is happening, when i change the object scale to (.1,1,1), the vertex positions for x are being changed flat. so i am losing the morph settings for that axis. i have to take the object scale into account in the vertex morph settings and it should be the same in all axes.
I thought that because I was using global positioning with transform.TransformPoint then the vertex is will morph relative to global position, but that’s wrong.
Here is a picture and the code:
![alt text][1]
private var org = Vector3.zero;
var scale = 1;
private var vtxArray : Vector3[];
var radius = 200;
function Start () {
var mesh : Mesh = GetComponent(MeshFilter).mesh;
if (vtxArray == null)
vtxArray = mesh.vertices;
var vertices = new Vector3[vtxArray.Length];
for (var i=0;i<vertices.Length;i++)
{
var vertex = vtxArray*;*
vtxArray = transform.TransformPoint(vtxArray*);*
vertex.y += Mathf.Sin(vtxArray.z*.1 + vtxArray_.x*.1) * scale;
vertex.x += Mathf.Sin(vtxArray.y*.1 + vtxArray.z*.2) * scale;
vertex.z += Mathf.Sin(vtxArray.x*.1 + vtxArray.y*.1) * scale;_
_ vertices = vertex;
* }
mesh.vertices = vertices;
mesh.RecalculateNormals();*_
* DestroyImmediate(collider);*
gameObject.AddComponent(“MeshCollider”);
}
_*[1]: http://i46.tinypic.com/mn16on.jpg*_