flash on 2010-3-23
/**
* Copyright hacker_pdf0c4e1 ( http://wonderfl.net/user/hacker_pdf0c4e1 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/lLY1
*/
package {
import flash.display.Sprite;
import flash.events.*;
import org.papervision3d.materials.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.objects.*;
import org.papervision3d.view.*;
public class FlashTest extends BasicView{
private var rott:Number=0;
private var wrap:DisplayObject3D;
public function FlashTest() {
wrap=new DisplayObject3D();
scene.addChild(wrap);
var material:WireframeMaterial=new WireframeMaterial(0x3399FF);
material.doubleSided=true;
var max:int=10;
for(var i:int=0; i<max; i++){
var obj:Plane =new Plane(material,200,200);
var rot:Number=360*(i/max);
obj.x=600*Math.sin(rot*Math.PI/180);
obj.y=600*Math.cos(rot*Math.PI/180);
obj.lookAt(DisplayObject3D.ZERO);
wrap.addChild(obj);
}
startRendering();
addEventListener(Event.ENTER_FRAME,loop);
}
private function loop(e:Event):void{
var targetRot:Number=(mouseX/stage.stageWidth)*360;
rott+=(targetRot-rott)*0.02;
camera.x=1000*Math.sin(rott*Math.PI/180);
camera.y=1000*Math.cos(rott*Math.PI/180);
}
}
}