You are hereForums / Papervision3D / Question and Answer / Collada interactivity
Collada interactivity
Question about getting a Collada file to recognize mouse clicks:
I've created a PV3D2 scene with a Plane and a Collada object, both of which use MovieAssetMaterials. The Plane's interactivity (OBJECT_CLICK) works great, as expected and demonstrated in various web tutorials. However, the Collada object, (which uses a MaterialsList containing the MovieAssetMaterial, rather than applying a single material) doesn't seem to recognize the mouse click, even though it's implemented pretty much the same way as the Plane (other than the MaterialsList). The materials for both objects appear properly, so they appear to implemented correctly. And yes, I did set the 'interactive' property of each material to 'true'.
Any ideas why the Collada object isn't recognizing the mouse click would be greatly appreciated. I'd be happy to provide the source if that'll help.
Thanks - sites like this are a great help to those of us trying to learn PV3D, since as far as I can tell, no books are available yet.
Todd
Tags
Here's the Code
Submitted by tjuro on Wed, 07/23/2008 - 15:32.
- reply
Collada interactivity
Submitted by anon on Sun, 07/27/2008 - 16:04.
You should see this:
http://www.nabble.com/InteractiveScene3DEvent-and-dae-models-td15850889....
"You need to attach the event to a child of the DAE object, not to the DAE object directly. It is a bit quirky getting down to the name of the child - you need to attach a Event.COMPLETE to your DAE, and within it try trace myDAE.childrenList() to get the name of the first object in your DAE, then myDAE.getChildByName("name of the first object in your DAE").childrenList() and so on until you reach the innermost object."
2 things must be done
1. dome_material.interactive = true; - this you have
2. dome.getChildByName("name of the first object in your DAE")addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, onPress);
- reply
Thank You!
Submitted by anon on Tue, 08/05/2008 - 10:38.
This is great info - Thanks! I'll try it tonight. I really appreciat the detailed reply.
- reply