Mouse Interaction in Papervision 2.0

Events in Papervision are InteractiveScene3DEvents. You can add event listeners for InteractiveScene3DEvents to any DisplayObject3D or to the InteractiveSceneManager of Viewport3D.

The interactive-property of a DisplayObject3D´s material must be true to make the object interactive. The interactive property of your viewport must also be true. If you want to add an event listener to your viewport, you have to add it to the viewport´s InteractiveSceneManager.

//Create interactive Viewport3D
var viewport:Viewport3D = new Viewport3D();
viewport.interactive = true;
viewport.interactiveSceneManager.addEventListener(InteractiveScene3DEvent, 
     handleViewportEvent);
 
//Create interactive ColorMaterial
var material:ColorMaterial = new ColorMaterial(0xCCCCCC);
material.interactive = true;
plane = new Plane(material, 100, 100);
plane.addEventListener(InteractiveScene3DEvent, handlePlaneEvent);
This entry was posted in ActionScript 3 and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">