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

Papervision3d 練習2011-1-21

Get Adobe Flash player
by KiKiKi 21 Jan 2011

    Tags

    3D
    Embed
/**
 * Copyright KiKiKi ( http://wonderfl.net/user/KiKiKi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/5E2H
 */

// forked from KiKiKi_KiKi's Papervision3d 練習2011-1-12
package {
    //Papervision3d 練習 21.01.2011
    import flash.display.Sprite;
    import flash.events.Event;
    import org.papervision3d.materials.*;
    import org.papervision3d.objects.primitives.*;
    import org.papervision3d.view.*;
    
    public class Main extends BasicView {
        
        private var sphere:Sphere;
        
        public function Main() {
            //create material
            var material:WireframeMaterial = new WireframeMaterial(0x0000FF);
            
            //3d Object
            sphere = new Sphere(material, 300, 10, 10);
            
            //addChild 3d scene
            scene.addChild(sphere);
            
            //Rendering
            startRendering();
            
            this.addEventListener(Event.ENTER_FRAME, loop);
        }
        
        private function loop(evt:Event):void {
            sphere.rotationY += 1;
            sphere.rotationZ += 1;
        }
        
    }
}