The construction of a plane. Roll your mouse over the movie below
Here is the document class used:
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import away3d.containers.*;
import away3d.core.base.*;
import away3d.primitives.*;
import away3d.core.math.*;
public class PlaneDemo extends Sprite
{
private var plane:Object3D;
private var view:View3D;
public function PlaneDemo()
{
// create a 3D-viewport
// our movie is 700 x 700
view = new View3D({x:350, y:350});
// add viewport to the stage
addChild(view);
// create a plane
plane = new Plane({material:"yellow#", name:"plane", y:-100, width:1000, height:1000, pushback:true});
// add the plane to the scene
view.scene.addChild(plane);
// point camera at the plane
view.camera.position = new Number3D(1000, 1000, 1000);
view.camera.lookAt(plane.position);
// create motion
addEventListener(Event.ENTER_FRAME, Timeline);
}
private function Timeline(e:Event):void
{
plane.rotationY = mouseX / 2;
plane.rotationX = mouseY / 2;
// re render
view.render();
}
}
}
Thanks for publish =D