In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

flash on 2009-12-26

Get Adobe Flash player
by albatrus_jp 26 Dec 2009
    Embed
/**
 * Copyright albatrus_jp ( http://wonderfl.net/user/albatrus_jp )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/5WT6
 */

package {
	import flash.events.*;
	import flash.utils.*;
	import org.papervision3d.core.geom.renderables.*;
	import org.papervision3d.materials.*;
	import org.papervision3d.objects.primitives.*;
	import org.papervision3d.view.*;
	
	public class Vecter3D extends BasicView{
		
		private var plane:Plane;
		private var time:int = 0;
		public function Vecter3D():void{
			
			var material:WireframeMaterial = new WireframeMaterial(0x00ffff);
			
			plane = new Plane(material,2000,500,40,10);
			plane.rotationX = 90;
			scene.addChild(plane);
			
			
			camera.y = 500; 
			
			startRendering();
			addEventListener(Event.ENTER_FRAME,loop);
		}
		
		private function loop(e:Event):void{
			
			var max:int = plane.geometry.vertices.length;
			for(var i:int = 0; i<max; i++){
				
				var rot:Number = i / max* 360;
				rot += time;
				
				var vertex:Vertex3D = plane.geometry.vertices[i];
				
				vertex.z = 200* Math.sin(rot* Math.PI/180);
			}
			
			time +=4;
			
			
		} 
	}
}