Search code examples
flashactionscript-3actionscript3dpapervision3d

Having trouble with Interactive Plane


I am having some trouble getting an interactive, animated plane created from a MovieClip in the Library to show any kind of animation or receive any mouse events.

Specifically, I am having issues with the different states of Button instances in the MovieClip.

Here's the basic code that I am testing with:

    private function init3D():void
    {
        viewport = new Viewport3D(1024, 768, false, true);
        addChild(viewport);

        camera = new Camera3D();
        camera.z = -500;
        camera.zoom = 1;
        camera.focus = 500;
        camera.target = DisplayObject3D.ZERO;

        scene = new Scene3D();
        renderer = new BasicRenderEngine();

        stage.addEventListener(Event.ENTER_FRAME, loop);
    }

    public function addChild3D(link:String):Plane
    {
        //var demoPlane:DemoPlane = new DemoPlane(link);
        //return scene.addChild(demoPlane.getPlane());

        var material:MovieAssetMaterial = new MovieAssetMaterial(link, false, true, false, false);
        material.interactive = true;
        //material.smooth = true;
        material.animated = true;

        var plane_mc:Plane = new Plane(material, 0, 0, 10, 10);
        scene.addChild(plane_mc);

    }

    private function loop(evt:Event):void
    {
        renderer.renderScene(scene, camera, viewport);
    }

Solution

  • Update VirtualMouse class with patch to handle SimpleButton

    http://code.google.com/p/papervision3d/issues/detail?id=169