بهترین راه collada interactive material in papervision3d 2.1
اینم بهترین لینکی که به من کمک کرد :
http://www.packtpub.com/article/papervision3d-external-models-part2
البته برای اینتر اکتیو کردن متریالها ی یک شی collada 1.4 با DAE parser و تنظیم اون در بلندر و ایمپورت کردن در papervision 2.1 و فلش CS4 ...
حالا به راحتی می تونم به child های کولادام دستورات Mouse Event یا رویداد های کیبورد رو بدم .
به این عبارت خیلی خیلی خیلی توجه کنید :
Next, we define a listener waiting for clicks on an object nested inside the model. This needs to be set for every child object you want to be clickable. Therefore, we use model.getChildByName and search for a nested object. You can set the second parameter recursive to true, in order to search for a nested object inside a nested object. In fact, the model is a child object of the DAE class that was used to load it
.
PHP:
model.getChildByName("Cube_001", true).addEventListener
(InteractiveScene3DEvent.OBJECT_CLICK, click);
The name Cube_001 was automatically defined inside the modeling tool. You can also see this name when Papervision3D parses the object and traces its name in the output window.
INFO: DisplayObject3D: Cube_001
To see this you can publish the previous project that also loads the cube created in Blender.
و اینم یکی از بهترین راه ا برای true کردن interactive تمام متریالهای یک کولادا هست :
PHP:
private function setInteractiveMaterials(targetObject:DisplayObject3D, value:Boolean):void
{
for each(var mat:MaterialObject3D in targetObject.materials.materialsByName)
{
mat.interactive = value;
}
}
و این یکی از بهترین راهها برای دسترسی به children های یک کولادا و دادن EventListener خاص به تمامی فرزندان یک مدل collada هست :
PHP:
private function addColladaEvents(displayObject:DisplayObject3D, eventType:String, listener:Function):void
{
displayObject.addEventListener(eventType, listener);
for each(var child:DisplayObject3D in displayObject.children)
{
this.addColladaEvents(child,eventType, listener);
}
}
دست همگی درد نکنه واقعا خسته نباشید ...

هم متکلم وحده بودیم هم مع الغیر ... هم جای خودمون بودیم هم جای مخاطب ...

بای...