flash on 2009-12-29
♥0 |
Line 37 |
Modified 2009-12-29 03:36:48 |
MIT License
archived:2017-03-20 14:48:45
ActionScript3 source code
/**
* Copyright h_ike ( http://wonderfl.net/user/h_ike )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/6sUV
*/
package {
import flash.accessibility.Accessibility;
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import org.papervision3d.view.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
[SWF(backgroundColor=0)]
public class FlashTest extends BasicView {
private var sphere:Sphere;
public function FlashTest() {
// write as3 code here..
var bmd:BitmapData = new BitmapData(800,800,false,0x00cccc);
var material:BitmapMaterial = new BitmapMaterial(bmd,true);
var xi:int = 0, yi:int = 0;
for(xi=0;xi<bmd.width;xi++){
for(yi=0;yi<bmd.height;yi+=20){
bmd.setPixel(xi,yi,0xffffff);
}
}
for(yi=0;yi<bmd.height;yi++){
for(xi=0;xi<bmd.width;xi+=20){
bmd.setPixel(xi,yi,0xffffff);
}
}
sphere = new Sphere(material,400,20,20);
scene.addChild(sphere);
startRendering();
addEventListener(Event.ENTER_FRAME,loop);
}
private function loop(e:Event):void{
sphere.yaw(-1);
sphere.roll(-.5);
}
}
}