Plotting 3D sine wave

Software: Away3D 4.x

Rajneesh, Jr. Member
Posted: 21 January 2014 09:38 AM   Total Posts: 34

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 (0v.length+= 3{
   
    v[i] 
+= Math.sin(v[i+1]*phase)*amp;
   
}
      
   CompactSubGeometry
(planeMesh.geometry.subGeometries[0]).updateData(v);
  

Can anybody help me out there?

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X