PV3d Plane Face Mouse Example @author jessefreeman FlashBum forked:4favorite:2lines:36license : MIT License modified : 2009-07-25 06:01:57 Embed Tweet package { import org.papervision3d.materials.ColorMaterial; import org.papervision3d.objects.primitives.Plane; import org.papervision3d.view.BasicView; import flash.events.Event; /** * @author jessefreeman */ public class FlashTest extends BasicView { private var plane : Plane; public function FlashTest() { super( ); create3dObject( ); startRendering( ); } private function create3dObject() : void { var mat : ColorMaterial = new ColorMaterial( 0xff0000, 1, true ); plane = new Plane( mat ); scene.addChild( plane ); } /** * This rotates the plane to "face" the mouse. */ protected function updateMouseRotation() : void { var tmpWidth : Number = 400; var tempHeight : Number = 400; var rotY : Number = (mouseX - (stage.stageWidth * .5)) / (tmpWidth * .5) * (-20); var rotX : Number = (mouseY - (stage.stageHeight * .5)) / (tempHeight * .5) * (-20); plane.rotationX = plane.rotationX + (rotX - plane.rotationX) * .5; plane.rotationY = plane.rotationY + (rotY - plane.rotationY) * .5; } override protected function onRenderTick(event:Event = null):void { updateMouseRotation(); super.onRenderTick(event); } } } Code Fullscreen Preview Fullscreen color.style... Albert 3dPlane Mouse MouseMovement Movement PV3d rotationX rotationY Event Number sort new page view favorite forked pv49 forked from: PV3d Plane Face M.. ruancaiman forked:1 favorite:0lines:58 (diff:32) pv82 forked from: PV3d Plane Face M.. rbulmer forked:0 favorite:0lines:36 (diff:4) pv101 forked from: PV3d Plane Face M.. likablemedia forked:0 favorite:0lines:36 (diff:1) pv2453 forked from: PV3d Plane Face M.. LawrieCape forked:2 favorite:4lines:36 (diff:18) tag: Map Mouse MouseMovement plane pv3d