control a game with FlarttolKit

58 views
Skip to first unread message

LOUHICHI DHIA EL HAK

unread,
Feb 18, 2010, 4:48:43 PM2/18/10
to flartool...@googlegroups.com
Hi,
i have some global questions about FlartoolKit.
i have an idea to develop a car game for my final project study and i want to control the game with Flartoolkit, for example if i turn the marker to the right the car will turn to the right and the same for the left, is it possible to do that with FlartoolKit?
the other question is that i want to know if FlartoolKit can track natural markers (example: a hand) ?

 
cheers,
Dhia EL Hak Louhichi 


eric socolofsky

unread,
Feb 18, 2010, 4:49:52 PM2/18/10
to flartool...@googlegroups.com
example please, makc?

LOUHICHI DHIA EL HAK

unread,
Feb 18, 2010, 5:10:32 PM2/18/10
to flartool...@googlegroups.com
example for what?sorry i didn't understand you!
 
Cordialement
Louhichi Dhia El Hak



De : eric socolofsky <er...@transmote.com>
À : flartool...@googlegroups.com
Envoyé le : Jeu 18 Février 2010, 22 h 49 min 52 s
Objet : Re: [FLARToolKit-userz:2560] control a game with FlarttolKit

zerofractal

unread,
Feb 18, 2010, 10:15:24 PM2/18/10
to FLARToolKit userz
Of course its possible. We have made a couple of experiments, one
which acts as a virtual steering wheel and another to control a
skateboard game (WIP).

Look at this:
http://www.screencast.com/users/alejandro.gonzalez/folders/Jing/media/790b6e7b-7bb5-4432-a1c7-bd0535dbeb0d

On Feb 18, 5:10 pm, LOUHICHI DHIA EL HAK <dha...@yahoo.fr> wrote:
> example for what?sorry i didn't understand you!
>  Cordialement
> Louhichi Dhia El Hak
>
> ________________________________

> De : eric socolofsky <e...@transmote.com>

Makc

unread,
Feb 19, 2010, 2:17:24 AM2/19/10
to flartool...@googlegroups.com
On Fri, Feb 19, 2010 at 12:10 AM, LOUHICHI DHIA EL HAK <dha...@yahoo.fr> wrote:
> example for what?sorry i didn't understand you!
>

I believe he means
http://makc3d.wordpress.com/2009/12/23/unity3d-and-flartoolkit-steering-wheel-test/

The basic code goes like this:

private function calculateTilt (square:FLARSquare, direction:int):Number {
// assuming user holds the marker correctly, we can average lines
var i:int, j:int, rise:Number = 0, run:Number = 0, line:FLARLinear;
for (i = 0; i < 4; i++) {
j = (4 + i - direction) % 4;
line = FLARLinear (square.line [j]);
var drun:Number = (i % 2 == 0) ? line.run : -line.rise;
var drise:Number = (i % 2 == 0) ? line.rise : line.run;
if (drun < 0) {
drun *= -1;
drise *= -1;
}
rise += drise;
run += drun;
}
return Math.atan2 (rise, run) * 2 / Math.PI;
}

Shachar Oz

unread,
Feb 19, 2010, 9:16:57 AM2/19/10
to FLARToolKit userz
hi,
interaction based on a marker is my field of interest.
of course you can use the marker as a game controller and not only as
a container of 3d staff. it doesnt have to be that boring... :)
the variables that can help you doing that are: the marker's XYZ
position (that can help in measuring where the marker is in the
screen),
the hit-test with other objects on the stage (that you can use for
example to catch or shoot staff),
the rotation on all axis of the marker (which can be used in a
steering wheel like you said).

for more ideas write more.
shachar

On Feb 19, 9:17 am, Makc <makc.the.gr...@gmail.com> wrote:
> On Fri, Feb 19, 2010 at 12:10 AM, LOUHICHI DHIA EL HAK <dha...@yahoo.fr> wrote:
>
> > example for what?sorry i didn't understand you!
>

> I believe he meanshttp://makc3d.wordpress.com/2009/12/23/unity3d-and-flartoolkit-steeri...

Sébast Ducharme

unread,
Mar 3, 2010, 4:38:22 PM3/3/10
to FLARToolKit userz
Hi,
I have a question related to the topic.

I'm trying to do a look a like asteroid game.

I want to control a plane by the marker and try to dodge some ball
that i create in papervision.

the problem is that when i move the marker all the ball are moving
to. So ...how can i move the marker and not the hole scene :S

*Sorry for my lame english.

Thank you for your time.

Sebast.

Daniel Ferenc Szak

unread,
Mar 4, 2010, 2:01:10 AM3/4/10
to flartool...@googlegroups.com
If You put everything in the same scene - it will be controlled by the marker.
I imagine that You have to have two scenes...one for Your "plane" and another for the "balls" You have to dodge.
Then You put the "plane" in the markerNode, and the "balls" into another scene which You attach directly to the stage's displayList.
Obviously, doing so You'll have to find an alternate way of controlling collision detection (try screen coordinates?).

cheers,
daniel.
Reply all
Reply to author
Forward
0 new messages