[Papervision3D] event on face cube
lijko at lijko.org
lijko at lijko.org
Mon Sep 17 04:36:11 PDT 2007
so, no idea ???
Bertrand KEMPF a écrit :
> /Hello,
>
> i come back with my boring cube:
>
>
> so, at this moment, i know how to use InteractiveSceneManager for simple
> object as cone, or cylinder with just one material object as:/
>
>
> _mc = new InteractiveSprite();
> _mc.name = "_mc";
> _mc.graphics.beginFill(0x66dd99, 1);
> _mc.graphics.drawRect(0, 0, CUBE_SIZE,CUBE_SIZE);
> _mc.graphics.endFill();
>
> _materialFront = new InteractiveMovieMaterial(_mc);
> _materialFront.name = "_materialFront";
> _materialFront.doubleSided = true;
>
>
> _materialFront.movie.addEventListener(MouseEvent.CLICK,
> handleClick);
>
> _cylinder = new Cylinder(_materialFront);
>
>
> /no, problem, the event is correctly dispatched (i got a trace "click",
> hey hey, i'm a genius;-)
>
>
> but when i try to do the same thing with an cube, with a materialList,
> nothing:/
>
>
> _mc = new InteractiveSprite();
> _mc.name = "_mc";
> _mc.graphics.beginFill(0x66dd99, 1);
> _mc.graphics.drawRect(0, 0, CUBE_SIZE,CUBE_SIZE);
> _mc.graphics.endFill();
>
> _materialFront = new InteractiveMovieMaterial(_mc);
> _materialFront.name = "_materialFront";
> _materialFront.doubleSided = true;
>
> _ml = new MaterialsList();
> _ml.addMaterial(_materialFront, 'front');
> _ml.addMaterial(new InteractiveColorMaterial(0x00ff00, 100), 'left');
> _ml.addMaterial(new InteractiveColorMaterial(0x0066ff, 100), 'right');
> _ml.addMaterial(new InteractiveColorMaterial(0xff00ff, 100), 'bottom');
> _ml.addMaterial(new InteractiveColorMaterial(0x00ffff, 100), 'back');
> _ml.addMaterial(new InteractiveColorMaterial(0xffff00, 100), 'top');
>
> _materialFront.movie.addEventListener(MouseEvent.CLICK, handleClick);
>
> _cube = new Cube(_ml, CUBE_SIZE, CUBE_SIZE, CUBE_SIZE, 10, 10, 10);
>
>
> so, why??????
>
>
> thanks for read me;-)
>
>
>
>
>
> lijko at lijko.org a écrit :
>
>> Hello,
>>
>> i think i've done all as good (no good since it doesn't work;-) but i'm
>> glued with my code
>>
>> you can see the whole class:
>>
>> http://lijko.nexenservices.com/IceCube.as
>>
>>
>> thx
>>
>>
>>
>>
>> John Grden a écrit :
>>
>>
>>> when you set faceLevelMode true, that allows the virtual mouse to
>>> dispatch pure MouseEvents from your movieclips.
>>>
>>> is that your question?
>>>
>>> So, you'd be listening to your movie clip for MouseEvent.CLICK or
>>> whichever event you're after
>>>
>>> On 9/11/07, *Bertrand KEMPF* <lijko at lijko.org
>>> <mailto:lijko at lijko.org>> wrote:
>>>
>>> ok, done, but now, how could i do the event of my "_mc" ????
>>>
>>>
>>>
>>>
>>> John Grden a écrit :
>>> > if you don't have faceLevelMode turned on, you won't get those
>>> events
>>> >
>>> > scene.interactiveSceneManager.faceLevelMode = true;
>>> >
>>> > On 9/11/07, *Bertrand KEMPF * <lijko at lijko.org
>>> <mailto:lijko at lijko.org>
>>> > <mailto:lijko at lijko.org <mailto:lijko at lijko.org>>> wrote:
>>> >
>>> > i think my code for make the cube, and the syntax
>>> > (Interactive....), is
>>> > good, but the problem is to target to the "_mc", part of
>>> material
>>> > of the
>>> > cube, and to use its events.....
>>> >
>>> > ayo at binitie.com <mailto:ayo at binitie.com>
>>> <mailto:ayo at binitie.com <mailto:ayo at binitie.com>> a écrit :
>>> > > Hey John,
>>> > > I've tried using the MovieMaterial using a version of
>>> Bertrand's
>>> > code. Nada
>>> > > -a-
>>> > >
>>> > > Original Message:
>>> > > -----------------
>>> > > From: John Grden neoriley at gmail.com
>>> <mailto:neoriley at gmail.com> <mailto: neoriley at gmail.com
>>> <mailto:neoriley at gmail.com>>
>>> > > Date: Tue, 11 Sep 2007 08:02:57 -0500
>>> > > To: papervision3d at osflash.org
>>> <mailto:papervision3d at osflash.org> <mailto:
>>> papervision3d at osflash.org <mailto:papervision3d at osflash.org>>
>>> > > Subject: Re: [Papervision3D] event on face cube
>>> > >
>>> > >
>>> > > if you would, can you try a Movie material or bitmap material
>>> > and run the
>>> > > same test for me?
>>> > >
>>> > > On 9/11/07, Bertrand KEMPF <lijko at lijko.org
>>> <mailto:lijko at lijko.org>
>>> > <mailto:lijko at lijko.org <mailto:lijko at lijko.org>>> wrote:
>>> > >
>>> > >> Hello, thanks for answer, so, but it doesn't work. And
>>> anyway,
>>> > my order
>>> > >> is to use each face of the cube, not the cube itself, for
>>> dispatch
>>> > >> event. I already use interactiveSceneManager.
>>> > >>
>>> > >> my constructor :
>>> > >>
>>> > >>
>>> > >> public function IceCube() {
>>> > >> //container + scene
>>> > >>
>>> > >> _container = new InteractiveSprite();
>>> > >> addChild(_container);
>>> > >> _container.x = stage.stageWidth/2;
>>> > >> _container.y = stage.stageHeight /2;
>>> > >> _container.name = "_container";
>>> > >>
>>> > >> _scene = new InteractiveScene3D(_container);
>>> > >> _ism = _scene.interactiveSceneManager;
>>> > >> _ism.setInteractivityDefaults();
>>> > >>
>>> > >> //le clip
>>> > >> _mc = new Sprite();
>>> > >> _mc.name = "_mc";
>>> > >> _mc.graphics.beginFill( 0x663366, 50);
>>> > >> _mc.graphics.drawRect(0, 0, 200, 200);
>>> > >> _mc.graphics.endFill();
>>> > >>
>>> > >> //list of materials + cube
>>> > >>
>>> > >> _materialFront = new
>>> InteractiveMovieMaterial(_mc);
>>> > >> _materialFront.name = "materialFront";
>>> > >> _materialFront.updateBitmap();
>>> > >>
>>> > >> _ml = new MaterialsList();
>>> > >> _ml.addMaterial(_materialFront, 'front');
>>> > >> _ml.addMaterial(new
>>> > InteractiveColorMaterial(0x00ff00, 100),
>>> > >> 'left');
>>> > >> _ml.addMaterial(new
>>> > InteractiveColorMaterial(0x0066ff, 100),
>>> > >> 'right');
>>> > >> _ml.addMaterial(new
>>> > InteractiveColorMaterial(0xff00ff, 100),
>>> > >> 'bottom');
>>> > >> _ml.addMaterial(new
>>> > InteractiveColorMaterial(0x00ffff, 100),
>>> > >> 'back');
>>> > >> _ml.addMaterial(new
>>> > InteractiveColorMaterial(0xffff00, 100),
>>> > >> 'top');
>>> > >>
>>> > >> _cube3D = new Cube(_ml, 500, 500, 500, 10,
>>> 10, 10);
>>> > >>
>>> > >> _scene.addChild(_cube3D);
>>> > >>
>>> > >> //camera
>>> > >> _camera = new Camera3D();
>>> > >>
>>> > >> //render
>>> > >> _scene.renderCamera(_camera);
>>> > >> }
>>> > >>
>>> > >> John Grden a écrit :
>>> > >>
>>> > >>> ahh, the problem is, InteractiveColorMaterial won't be
>>> able to
>>> > >>> dispatchEvents - materials for that matter don't
>>> dispatchEvents.
>>> > >>>
>>> > >>> addyour listener to the InteractiveSceneManager:
>>> > >>>
>>> > >>> var IS3D:InteractiveScene3D = new
>>> InteractiveScene3D(container);
>>> > >>>
>>> > >>> IS3D.addEventListener(InteractiveScene3DEvent.CLICK,
>>> handleClick);
>>> > >>>
>>> > >>> Let me know if that helps,
>>> > >>>
>>> > >>> John
>>> > >>>
>>> > >>> On 9/11/07, *Bertrand KEMPF* < lijko at lijko.org
>>> <mailto:lijko at lijko.org>
>>> > <mailto:lijko at lijko.org <mailto:lijko at lijko.org>>
>>> > >>> <mailto:lijko at lijko.org <mailto:lijko at lijko.org>
>>> <mailto:lijko at lijko.org <mailto:lijko at lijko.org>>>> wrote:
>>> > >>>
>>> > >>> Hi,
>>> > >>>
>>> > >>> thanks a lot for your answer, i apologize for my
>>> english,
>>> > but if i
>>> > >>> follow you, i'm just to take time for wait?
>>> > >>>
>>> > >>> thanks anyway
>>> > >>>
>>> > >>> ayo at binitie.com <mailto:ayo at binitie.com>
>>> <mailto:ayo at binitie.com <mailto:ayo at binitie.com>>
>>> > <mailto:ayo at binitie.com <mailto:ayo at binitie.com>
>>> <mailto:ayo at binitie.com <mailto:ayo at binitie.com>>> a écrit :
>>> > >>> > Hi
>>> > >>> > I'll give this a and respond. It will not be
>>> immediate
>>> > if you
>>> > >>> do not mind
>>> > >>> > [a /]
>>> > >>> > Original Message:
>>> > >>> > -----------------
>>> > >>> > From: lijko lijko at lijko.org
>>> <mailto:lijko at lijko.org> <mailto:lijko at lijko.org
>>> <mailto:lijko at lijko.org>>
>>> > <mailto:lijko at lijko.org <mailto:lijko at lijko.org> <mailto:
>>> lijko at lijko.org <mailto:lijko at lijko.org>>>
>>> > >>> > Date: Tue, 11 Sep 2007 01:56:36 -0700 (PDT)
>>> > >>> > To: papervision3D at osflash.org
>>> <mailto:papervision3D at osflash.org>
>>> > <mailto: papervision3D at osflash.org
>>> <mailto:papervision3D at osflash.org>>
>>> > <mailto:papervision3D at osflash.org
>>> <mailto:papervision3D at osflash.org> <mailto:
>>> papervision3D at osflash.org <mailto:papervision3D at osflash.org>>>
>>> > >>> > Subject: [Papervision3D] event on face cube
>>> > >>> >
>>> > >>> >
>>> > >>> >
>>> > >>> > Hello,
>>> > >>> >
>>> > >>> > i've already post a topic about cube's face
>>> > interactivity. So,
>>> > >>> nobody
>>> > >>> > answers ;-)
>>> > >>> >
>>> > >>> > i post my code, and really, i don't see where's
>>> the problem
>>> > >>> >
>>> > >>> >
>>> > >>> > //le clip
>>> > >>> > _mc = new Sprite();
>>> > >>> > _mc.name = "_mc";
>>> > >>> > _mc.graphics.beginFill(
>>> 0x663366,
>>> > 50);
>>> > >>> > _mc.graphics.drawRect(0, 0,
>>> 200, 200);
>>> > >>> > _mc.graphics.endFill();
>>> > >>> >
>>> > >>> > //le cube
>>> > >>> >
>>> > >>> > _materialFront = new
>>> > >>> InteractiveMovieMaterial(_mc);
>>> > >>> > _materialFront.name =
>>> > "materialFront";
>>> > >>> >
>>> > >>> > _ml = new MaterialsList();
>>> > >>> > _ml.addMaterial(_materialFront,
>>> > 'front');
>>> > >>> > _ml.addMaterial(new
>>> > >>> InteractiveColorMaterial(0x00ff00, 100), 'left');
>>> > >>> > _ml.addMaterial(new
>>> > >>> InteractiveColorMaterial(0x0066ff, 100), 'right');
>>> > >>> > _ml.addMaterial(new
>>> > >>> InteractiveColorMaterial(0xff00ff, 100), 'bottom');
>>> > >>> > _ml.addMaterial(new
>>> > >>> InteractiveColorMaterial(0x00ffff, 100), 'back');
>>> > >>> > _ml.addMaterial(new
>>> > >>> InteractiveColorMaterial(0xffff00, 100), 'top');
>>> > >>> >
>>> > >>> > _cube3D = new Cube(_ml,
>>> CUBE_SIZE,
>>> > >>> CUBE_SIZE, CUBE_SIZE, 10, 10, 10);
>>> > >>> >
>>> > >>> >
>>> > >>> >
>>> > >>>
>>> > _cube3D.materials.getMaterialByName("front").addEventListener(
>>> > >>>
>>> > >> MouseEvent.MOU
>>> > >>
>>> > >>> > SE_OVER,
>>> > >>> > handleMainOver);
>>> > >>> >
>>> > >>> > _scene.addChild(_cube3D);
>>> > >>> >
>>> > >>> >
>>> > >>> >
>>> > >>> >
>>> > >>> >
>>> > >>> > thanks a lot if somebody could say what is
>>> wrong......
>>> > >>> >
>>> > >>> >
>>> > >>> >
>>> > >>> >
>>> > >>>
>>> > >>> _______________________________________________
>>> > >>> Papervision3D mailing list
>>> > >>> Papervision3D at osflash.org
>>> <mailto:Papervision3D at osflash.org>
>>> > <mailto: Papervision3D at osflash.org
>>> <mailto:Papervision3D at osflash.org>>
>>> > <mailto:Papervision3D at osflash.org
>>> <mailto:Papervision3D at osflash.org>
>>> <mailto:Papervision3D at osflash.org
>>> <mailto:Papervision3D at osflash.org>>>
>>> > >>>
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>>
>>> > >>> --
>>> > >>> [ JPG ]
>>> > >>>
>>> >
>>> ------------------------------------------------------------------------
>>> >
>>> > >>>
>>> > >>> _______________________________________________
>>> > >>> Papervision3D mailing list
>>> > >>> Papervision3D at osflash.org
>>> <mailto:Papervision3D at osflash.org>
>>> <mailto:Papervision3D at osflash.org <mailto:Papervision3D at osflash.org>>
>>> > >>>
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>> <http://osflash.org/mailman/listinfo/papervision3d_osflash.org>
>>> > >>>
>>> > >>>
>>> > >> _______________________________________________
>>> > >> Papervision3D mailing list
>>> > >> Papervision3D at osflash.org
>>> <mailto:Papervision3D at osflash.org>
>>> <mailto:Papervision3D at osflash.org <mailto:Papervision3D at osflash.org>>
>>> > >>
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>> <http://osflash.org/mailman/listinfo/papervision3d_osflash.org>
>>> > <http://osflash.org/mailman/listinfo/papervision3d_osflash.org>
>>> > >>
>>> > >>
>>> > >
>>> > >
>>> > >
>>> > >
>>> >
>>> > _______________________________________________
>>> > Papervision3D mailing list
>>> > Papervision3D at osflash.org <mailto:Papervision3D at osflash.org>
>>> <mailto:Papervision3D at osflash.org <mailto:Papervision3D at osflash.org>>
>>> >
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>> <http://osflash.org/mailman/listinfo/papervision3d_osflash.org>
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > [ JPG ]
>>> >
>>> ------------------------------------------------------------------------
>>> >
>>> > _______________________________________________
>>> > Papervision3D mailing list
>>> > Papervision3D at osflash.org <mailto:Papervision3D at osflash.org>
>>> > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>> <http://osflash.org/mailman/listinfo/papervision3d_osflash.org>
>>> >
>>>
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org <mailto:Papervision3D at osflash.org>
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>>
>>>
>>>
>>> --
>>> [ JPG ]
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>>>
>>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>
>>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
More information about the Papervision3D
mailing list