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 2010-6-10

Get Adobe Flash player
by Nekopuni 10 Jun 2010
    Embed
/**
 * Copyright Nekopuni ( http://wonderfl.net/user/Nekopuni )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/gpx8
 */

package {
    import flash.display.*;
    import flash.events.*;
    import flash.filters.*;
   
    import org.papervision3d.view.*;
    import org.papervision3d.lights.*;
    import org.papervision3d.materials.shadematerials.*;
    import org.papervision3d.objects.primitives.*;
    import org.papervision3d.objects.DisplayObject3D;
    
    public class Main extends BasicView {
        public function Main() {
        	camera.x				=0;
        	camera.y				=200;
        	
        	
        	var light:PointLight3D = new PointLight3D();
        	var material:FlatShadeMaterial = new FlatShadeMaterial(light, 0x3399FF);
        	
        	var n:int = 20;
        	var RANGE:int = 500;
        	
        	var container:DisplayObject3D = new DisplayObject3D();
        	scene.addChild(container);
        	
        	for(var i:int = 0; i<n; i++){
        		var sphere:Sphere = new Sphere(material,50,8,8);
        		var rot:int = 360*i/n;
        		
        		sphere.x = RANGE*Math.sin(rot*Math.PI/180);
        		sphere.z = RANGE*Math.cos(rot*Math.PI/180);
        		sphere.y = 0;
        		container.addChild(sphere);
        	}//for
        	startRendering();     
        	addEventListener(Event.ENTER_FRAME, function(e:Event):void{        		container.yaw(-1);        }); 
        	  		
        }//Main
     }//BasicView
}//package