Collada InteractiveScene3DEvent

View: New views
6 Messages — Rating Filter:   Alert me  

Collada InteractiveScene3DEvent

by AngelicD :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey guys,

Another problem I'm having is trying to get object interactiong to work with my colladas. I got it to work with plane but not collada.

I enable interactive in the view...

view = new Viewport3D(this.width, this.height, false, true);

and for my collada i set the material to be interactive.

var mat:BitmapFileMaterial = new BitmapFileMaterial(visual.uri);
_geometry = new Collada(uri, new MaterialsList({all: mat }));
mat.interactive = true;

But it doens't work for colladas.

For my plane which works i do the following...

_defaultShape = new Plane(resource.material, 1, 1, 9, 9);
_defaultShape.material.oneSide = false;
_defaultShape.material.interactive = true;

Thanks

Re: Collada InteractiveScene3DEvent

by gary.mun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi AngelicD,

I can answer this (I think).

I found that you must apply the interactive flags to each child objects in
the collada scene for it to function.

Same with the listeners as well.

Regards
Gary Mun

-----Original Message-----
From: papervision3d-bounces@...
[mailto:papervision3d-bounces@...] On Behalf Of AngelicD
Sent: Friday, August 01, 2008 3:58 AM
To: papervision3D@...
Subject: [Papervision3D] Collada InteractiveScene3DEvent


Hey guys,

Another problem I'm having is trying to get object interactiong to work with
my colladas. I got it to work with plane but not collada.

I enable interactive in the view...

view = new Viewport3D(this.width, this.height, false, true);

and for my collada i set the material to be interactive.

var mat:BitmapFileMaterial = new BitmapFileMaterial(visual.uri);
_geometry = new Collada(uri, new MaterialsList({all: mat }));
mat.interactive = true;

But it doens't work for colladas.

For my plane which works i do the following...

_defaultShape = new Plane(resource.material, 1, 1, 9, 9);
_defaultShape.material.oneSide = false;
_defaultShape.material.interactive = true;

Thanks
--
View this message in context:
http://www.nabble.com/Collada-InteractiveScene3DEvent-tp18760172p18760172.ht
ml
Sent from the Papervision3D mailing list archive at Nabble.com.


_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.138 / Virus Database: 270.5.7/1580 - Release Date: 7/29/2008
5:26 PM


_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

Re: Collada InteractiveScene3DEvent

by tmyers :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


you need to get a ref of child object in your collada and attach listener here instead of collada container

myDAEObject.getChildByName("object_name", true).addEventListener(InteractiveScene3DEvent...




gary.mun wrote:
Hi AngelicD,

I can answer this (I think).

I found that you must apply the interactive flags to each child objects in
the collada scene for it to function.

Same with the listeners as well.

Regards
Gary Mun

-----Original Message-----
From: papervision3d-bounces@osflash.org
[mailto:papervision3d-bounces@osflash.org] On Behalf Of AngelicD
Sent: Friday, August 01, 2008 3:58 AM
To: papervision3D@osflash.org
Subject: [Papervision3D] Collada InteractiveScene3DEvent


Hey guys,

Another problem I'm having is trying to get object interactiong to work with
my colladas. I got it to work with plane but not collada.

I enable interactive in the view...

view = new Viewport3D(this.width, this.height, false, true);

and for my collada i set the material to be interactive.

var mat:BitmapFileMaterial = new BitmapFileMaterial(visual.uri);
_geometry = new Collada(uri, new MaterialsList({all: mat }));
mat.interactive = true;

But it doens't work for colladas.

For my plane which works i do the following...

_defaultShape = new Plane(resource.material, 1, 1, 9, 9);
_defaultShape.material.oneSide = false;
_defaultShape.material.interactive = true;

Thanks
--
View this message in context:
http://www.nabble.com/Collada-InteractiveScene3DEvent-tp18760172p18760172.ht
ml
Sent from the Papervision3D mailing list archive at Nabble.com.


_______________________________________________
Papervision3D mailing list
Papervision3D@osflash.org
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.138 / Virus Database: 270.5.7/1580 - Release Date: 7/29/2008
5:26 PM


_______________________________________________
Papervision3D mailing list
Papervision3D@osflash.org
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

Re: Collada InteractiveScene3DEvent

by AngelicD :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK, but I need to do it more generically, meaning I will never know the child's name of a dae before hand, cause it can be any random dae that may be loaded, is there a way to do it without getChildByName?

Also i just noticed that for at least a plane, which is what i have events working with, if you set the plane.useOwnContainer = true property sot that you may apply alpha, the events stop working! Any ideas how I can have this so that my plane can have alpha and also have listeners?

Thanks

tmyers wrote:
you need to get a ref of child object in your collada and attach listener here instead of collada container

myDAEObject.getChildByName("object_name", true).addEventListener(InteractiveScene3DEvent...

Re: Collada InteractiveScene3DEvent

by Ashley Davison :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I have been wondering about this. I have scenes working well with the getChildByName, but I have the situation now where I won't know the identifier. Been working on some workarounds in order to initiate interactivity on a  collada more generically, but nothing really robust. Anyone got any ideas?
 
http//:www.ipodhoodie.co.uk


--- On Thu, 31/7/08, AngelicD <raul.companioni@...> wrote:

> From: AngelicD <raul.companioni@...>
> Subject: Re: [Papervision3D] Collada InteractiveScene3DEvent
> To: papervision3D@...
> Date: Thursday, 31 July, 2008, 8:59 PM
> OK, but I need to do it more generically, meaning I will
> never know the
> child's name of a dae before hand, cause it can be any
> random dae that may
> be loaded, is there a way to do it without getChildByName?
>
> Also i just noticed that for at least a plane, which is
> what i have events
> working with, if you set the plane.useOwnContainer = true
> property sot that
> you may apply alpha, the events stop working! Any ideas how
> I can have this
> so that my plane can have alpha and also have listeners?
>
> Thanks
>
>
> tmyers wrote:
> >
> >
> > you need to get a ref of child object in your collada
> and attach listener
> > here instead of collada container
> >
> > myDAEObject.getChildByName("object_name",
> > true).addEventListener(InteractiveScene3DEvent...
> >
>
> --
> View this message in context:
> http://www.nabble.com/Collada-InteractiveScene3DEvent-tp18760172p18762328.html
> Sent from the Papervision3D mailing list archive at
> Nabble.com.
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D@...
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org


      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html

_______________________________________________
Papervision3D mailing list
Papervision3D@...
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

Re: Collada InteractiveScene3DEvent

by AngelicD :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Don't know if this will help you bu this is what I did for my case... Basically i have my own addEventListener function in my "shape" object that checks to see if the collada has been loaded yet or not, if it has it will attach the listeners if not it will add an event for when it has loaded to attach the listeners. So basically i'm doing what was suggest earlier to loop through all the objects in the collada and attach the listeners.

public function addEventListener(type:String, listener:Function):void
                {
                        if(_geometryLoaded)
                        {
                                for each( var child : DisplayObject3D in _geometry.children )
                                {
                                        addEventListenerToChildren(child, type, listener);
                                }
                        }
                        else
                        {
                                _geometry.addEventListener(FileLoadEvent.LOAD_COMPLETE, attachEvents);
                        }
                }
               
                public function attachEvents(event:flash.events.Event):void
                {
                        _geometryLoaded = true;
                       
                        var event1:vizible.viewer.Event = null;
                       
                        for(var i:int = 0; i < cell._events.length; i++)
                        {
                                event1 = cell._events.getItemByIndex(i) as vizible.viewer.Event;
                                addEventListener(event1.type, event1.listener);
                        }
                }
               
                public function addEventListenerToChildren(child:DisplayObject3D, type:String, listener:Function):void
                {
                        child.addEventListener(type, listener);
                       
                        for each( var child1 : DisplayObject3D in child.children )
                        {
                                addEventListenerToChildren(child1, type, listener);
                        }
                }


I still need to figure out why enabling useOwnContainer = true stops events from working!
Ashley Davison wrote:
I have been wondering about this. I have scenes working well with the getChildByName, but I have the situation now where I won't know the identifier. Been working on some workarounds in order to initiate interactivity on a  collada more generically, but nothing really robust. Anyone got any ideas?