Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Project Idea: videocam as a game-input device (Real Studio games Mailinglist archive)

Back to the thread list
Previous thread: I'm stuck and need a tow
Next thread: Project Camelot release


Re: explosions   -   Jeff Quan
  Project Idea: videocam as a game-input device   -   Joseph J. Strout
   Re: Project Idea: videocam as a game-input device   -   Toon Van Acker
   Re: Project Idea: videocam as a game-input device   -   Christian Schmitz
   Re: Project Idea: videocam as a game-input device   -   Joseph J. Strout
   Re: Project Idea: videocam as a game-input device   -   Frank C.

Project Idea: videocam as a game-input device
Date: 04.01.04 17:00 (Sun, 4 Jan 2004 10:00:09 -0600)
From: Joseph J. Strout
Background: There is a new gizmo for the PS2 called "Eye Toy". It's
a little webcam-quality digital camera that's used as a game-input
device for specially-written games. A Google search for "Eye Toy"
will bring up a bunch of sites with more info, but basically it works
like this: the view from the camera is shown on the screen, as a
background, behind computer-drawn elements. At the start of the
game, an outline of a head and upper torso is drawn, and you're
instructed to position yourself so that you roughly fit this outline.
Then the game begins. Little bad guys jump in from the sides of the
screen, and you basically swat them by waving your hands in the air.
It's a lot more fun than it sounds -- I got to try one at an
electronics store yesterday, so I'd suggest you check it out the same
way.

How it works: it appears to be simply watching for motion, that is,
significant changes in the camera's view. There's nothing special
about the camera and no special background is required. Just grab
the video stream, display it as the background, and for anyplace that
you need to detect motion (e.g. the area behind a bad guy), just
measure the difference between one frame and the next. If the
difference is significant enough, assume that the user has waved a
hand or some such, and send the bad guy flying.

Proposal: make a game like this in RB, using whatever video camera
the user already has connected. On the Mac, at least, video cameras
are becoming pretty common because of iChat AV; and these cameras are
already positioned to frame the user's head. If the user just rolls
his chair back a bit, he'll be perfectly positioned to play an
EyeToy-style game. Yes, this is still a pretty small market, but
there is zero competition in it at the moment, since as far as I know
no such game exists for the Mac (and perhaps not for Windows either,
though I'm less certain of that).

Approach: first you'll need a way to quickly grab frames from the
camera. That will probably take a plug-in. Then, you can make the
frame into a 3D object with Object3D.AddShapeFromPicture. Probably a
256x256 picture would be fine, scaled up to the size of the screen;
and fade it out a bit too (by tweaking the view lighting), so that
it's visible but doesn't dominate the display -- the user needs to
clearly see the overlays, which is where the real action is. For
those, use 3D sprites created in the same way, but with
.NullShader=true, so they appear on screen exactly as they were drawn
by the artist. (Alternatively, you could use a SpriteSurface, or
perhaps even a Canvas -- since you're going to be redrawing the
background on every frame, these will probably all produce about the
same performance.)

Then you need a way to detect the amount of difference in a region of
the video input. This will require some experimentation, but I think
you could just do it this way: iterate over a fraction of the pixels
in the region (i.e. step by 8 or so in both X and Y); measure the
difference in red, green, and blue between the current pixel value
and the last one; and sum these differences. When the sum crosses a
certain threshold, assume the user has moved an appendage to that
region, and make the game respond appropriately.

Cheers,
- Joe

Re: Project Idea: videocam as a game-input device
Date: 04.01.04 18:27 (Sun, 4 Jan 2004 18:27:51 +0100)
From: Toon Van Acker
> Yes, this is still a pretty small market, but there is zero
> competition in it at the moment, since as far as I know no such game
> exists for the Mac (and perhaps not for Windows either, though I'm
> less certain of that).

What about Freeverse's ToySight (http://toysight.com/)?

---
Toon Van Acker <<email address removed>>
<http://homepage.mac.com/barthold.van.acker/realbasic/>

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Project Idea: videocam as a game-input device
Date: 04.01.04 19:22 (Sun, 4 Jan 2004 19:22:28 +0100)
From: Christian Schmitz
Joseph J. Strout <<email address removed>> wrote:

> Background: There is a new gizmo for the PS2 called "Eye Toy".

I saw my brother playing such a game on his iMac with my iSight...

mfg
Christian

Re: Project Idea: videocam as a game-input device
Date: 04.01.04 20:08 (Sun, 4 Jan 2004 13:08:15 -0600)
From: Joseph J. Strout
At 6:27 PM +0100 1/4/04, Toon Van Acker wrote:

>>Yes, this is still a pretty small market, but there is zero
>>competition in it at the moment, since as far as I know no such
>>game exists for the Mac (and perhaps not for Windows either, though
>>I'm less certain of that).
>
>What about Freeverse's ToySight (http://toysight.com/)?

Heh. Well, shows what I know. Thanks for the link! I wonder if
those games are made in RB...

Cheers,
- Joe

Re: Project Idea: videocam as a game-input device
Date: 04.01.04 22:52 (Sun, 4 Jan 2004 16:52:11 -0500)
From: Frank C.
On 4-Jan-04, at 2:08 PM, Joseph J. Strout wrote:

> At 6:27 PM +0100 1/4/04, Toon Van Acker wrote:
>
>>> Yes, this is still a pretty small market, but there is zero
>>> competition in it at the moment, since as far as I know no such game
>>> exists for the Mac (and perhaps not for Windows either, though I'm
>>> less certain of that).
>>
>> What about Freeverse's ToySight (http://toysight.com/)?
>
> Heh. Well, shows what I know. Thanks for the link! I wonder if
> those games are made in RB...

The ToySight developer <http://www.strangeflavour.com/> had a dev diary
up on iDevGames before the server went belly up - IIRC they wrote an
OpenGL sprite engine from scratch in Codewarrior.

I suspect they have a significant lead in the market at the moment (on
the Mac at least) but there's probably room for more games using
similar tech. I'm just not sure how much longevity these types of games
have once the novelty wears off.

Frank.

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>