« Return to Thread: InteractiveScene3DEvent and dae models
Hi Mark,
had the same problem. 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. my code looked like this:
var plane:DAE = new DAE();
plane.load("plane.dae", materialsList);
plane.scale = 100;
default_scene.addChild(plane);
plane.addEventListener(Event.COMPLETE, daeCompleteHandler);
function daeCompleteHandler( event:Event ):void
{ plane.getChildByName("COLLADA_root").getChildByName("Plane").getChildByName("6").addEventListener( InteractiveScene3DEvent.OBJECT_OVER, onOver );
}mlp1 wrote:Hi
I'm trying to set an interactive material on an imported max model, all the examples i've seen use papervision primitives, do interactive materials work on dae imports?
I have set the viewport as interactive
var viewport:Viewport3D = new Viewport3D(0, 0, true, true);
Here's how im setting the materials;
controlMat01 = new BitmapAssetMaterial("rewind_jpg"); controlMat01.interactive = true; controlMat01.name = "rewind_button"; mats.addMaterial(controlMat01, "vid_control01");
Here's my button code and event called after the dae loads
private function setModel(e:Event):void { trace("setModel called"); var vidButton01 :DisplayObject3D = dae.getChildByName( "vid_button01" ); vidButton01.addEventListener( InteractiveScene3DEvent.OBJECT_PRESS, onObjPress); trace("vidButton01.x "+vidButton01.x);}function onObjPress( e:InteractiveScene3DEvent ):void { trace("press on " + e.face3d.material.name);
}
But it don't work... any ideas.
Cheers Mark
_________________________________________________________________
Get Hotmail on your mobile, text MSN to 63463!
http://mobile.uk.msn.com/pc/mail.aspx
_______________________________________________
Papervision3D mailing list
Papervision3D@osflash.org
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
« Return to Thread: InteractiveScene3DEvent and dae models
| Free embeddable forum powered by Nabble | Forum Help |