3D Objects Interacting with each other

13 views
Skip to first unread message

jbyrne2007

unread,
Jun 24, 2009, 8:33:00 AM6/24/09
to FLARToolKit userz
Hello!

Does anyone know or think it is possible for 3D objects in Flash AR To
interact with each other? An example of what im asking would be if you
had 2 markers one marker is the 3D arrow other marker is a 3D button
when 3D arrow touches 3D button it would trigger an animation event.
Would this be down to coding in AS or how both models were set to
animate.

Anyone seen work of this? or currently doing work on this? Im aware of
toxins work on AR interaction but thats through the user interacting
using a mouse i wish to use 3d models interacting with each other.

Thanks,
Jamie!

dieGopen.com

unread,
Jun 24, 2009, 8:41:50 AM6/24/09
to flartool...@googlegroups.com
Hi Jamie,

Grab this. 
It worked to me (I used it with FLARToolKit. not FLARManager)

private function hitter():void
{
if(carHolder.hitTestObject(_ball))
{
trace("hitted!");
}
}


hope you likes it
Diego


jbyrne2007

unread,
Jun 24, 2009, 8:44:40 AM6/24/09
to FLARToolKit userz
I use Flartoolkit as well al try this now.

jbyrne2007

unread,
Jun 24, 2009, 8:50:28 AM6/24/09
to FLARToolKit userz
what is the code to trigger the funger hitter?

jbyrne2007

unread,
Jun 24, 2009, 8:54:09 AM6/24/09
to FLARToolKit userz
Function*** LOL! Sorry no idea why i put funger.

dieGopen.com

unread,
Jun 24, 2009, 9:02:33 AM6/24/09
to flartool...@googlegroups.com
hitter();
Every time I'm pressing the forward button, it will trigger that funct.

PS: funger? WTF!  lol

Diego

jbyrne2007

unread,
Jun 24, 2009, 9:24:09 AM6/24/09
to FLARToolKit userz
Surely your using an event though right?

stage.addEventListener(KeyboardEvent.KEY_UP, hitter);

dieGopen.com

unread,
Jun 24, 2009, 9:43:14 AM6/24/09
to flartool...@googlegroups.com
For example into your _onInit event:
this.stage.addEventListener(KeyboardEvent.KEY_DOWN, this.keyDownHandler);

..And then into your keyboard function..:
private function keyDownHandler(event : KeyboardEvent):void
{
switch (event.keyCode)
{
case Keyboard.UP:
trace("UP");
carHolder.moveForward(10);
upkeydown = true;
hitter();
break;

}

I haven't shown you that part before because I thought you wanted to use the hitter for other things, sorry.


PS: Wow! it sounds like I do know something! Good day to my self esteem :)

jbyrne2007

unread,
Jun 25, 2009, 6:15:58 AM6/25/09
to FLARToolKit userz
Your example shows the 3D object interacting when you push down your
keyboard key. I want them to interact when they come into contact with
each other.

The following did not work for me:


this.stage.addEventListener(hitTestObject, hitter)

dieGopen.com

unread,
Jun 25, 2009, 6:26:50 AM6/25/09
to flartool...@googlegroups.com
They interact when they collide. The key pressing is just the way to
make them move to get them in touch.
If you need them to move "on their own" you could use some
onEnterFrame function or a physics engine and check for a collision in
every frame. Correct me if I'm wrong.

salut

jbyrne2007

unread,
Jun 25, 2009, 6:35:03 AM6/25/09
to FLARToolKit userz
I intend to move them by moving the marker with my hands and then when
the 3D objects collide they animate. I tried the ENTER_FRAME. No
success :( Al keep at it

jbyrne2007

unread,
Jun 25, 2009, 7:44:55 AM6/25/09
to FLARToolKit userz

ENTER_Frame works a treat, constantly goes to the function. But when
it comes to

if(arrowa.hitTestObject(container))

Just skips over it as if there not hitting.

dieGopen.com

unread,
Jun 25, 2009, 7:48:37 AM6/25/09
to flartool...@googlegroups.com
mm.. I should take a look at the code to try to help you.. if you want to post it, you're welcome :)


jbyrne2007

unread,
Jun 25, 2009, 7:50:05 AM6/25/09
to FLARToolKit userz
Would you mind if i emailed it to you?

dieGopen.com

unread,
Jun 25, 2009, 12:10:51 PM6/25/09
to flartool...@googlegroups.com
send it :) 
But I wont promise anything by now 'couse I'm little into dead lines

Shachar Oz

unread,
Jun 25, 2009, 4:23:37 PM6/25/09
to FLARToolKit userz
hey guys,
here's an example of another one who did it.
http://www.youtube.com/watch?v=9AUhEPLb9WQ
i would love if you could publish the final explanation of how you
managed it.
good luck

Javier Patiño

unread,
Jun 25, 2009, 4:26:49 PM6/25/09
to flartool...@googlegroups.com
yeah but that's not Flartoolkit... is based in only artoolkit...not in flash

2009/6/25 Shachar Oz <shach...@gmail.com>



--
Javier Patiño
CEO
SUITE CREATIVA LTDA
Reply all
Reply to author
Forward
0 new messages