You are hereForums / Papervision3D / Question and Answer / Collada Interactivity
Collada Interactivity
I'm trying to get mouse over events from a collada; ideally from the materials.
I'm using MovieMaterials, with interactivity set to true for the materials as well as the BasicView.
The collada file loads properly, and the MovieMaterials display ok. Getting mouse events from movie materials applied to primitives worked fine, but apparently doesn't work with Colladas?
This is the short version:
mc0 = new Material0(); //class name of library MC in flash IDE mc0.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver); material0 = new MovieMaterial(mc0, true, true, true); material0.doubleSided = true; material0.interactive = true; material0.animated = true; var materialsList:MaterialsList = new MaterialsList(); materialsList.addMaterial(material0, "material0"); ball = new Collada("buckyBall.dae", materialsList, .1); scene.addChild(ball); function onMouseOver(event:MouseEvent):void { trace("you rolled:"+event.target.name+"currentTarget:"+event.currentTarget.name); } [... render scene ...]
Tags
Solved
Submitted by dpm909 on Tue, 07/22/2008 - 18:12.
The problem was using BasicView. I had it set to interactive=true, but by removing BasicView and putting in the scenes3D, camera, renderer, etc., it worked.
- reply
No need to stop using
Submitted by tmyers on Wed, 08/20/2008 - 19:00.
No need to stop using BasicView...in your constructor you could just go...
public class MyClass extends BasicView {
public function MyClass(){
super(640,480, true, true);
}
}
... :)
- reply