Hi I tried to plot SineWave using following but not getting the desired result( I have attached the image of final output),
private function updateWave():void
{
var vertices:Vector.<Number> = planeMesh.geometry.subGeometries[0].vertexData;
var v:Vector.<Number> = vertices.slice(0);
var i:int;
var phase:Number = 4;
var amp:Number = 40;
// manipulate the Z component of each vertex (this is dependant on what you want to do!)
for (i = 0; i < v.length; i += 3) {
v[i] += Math.sin(v[i+1]*phase)*amp;
}
CompactSubGeometry(planeMesh.geometry.subGeometries[0]).updateData(v);
}
Can anybody help me out there?