APOCALYX is a...

free Game Engine based on OpenGL (MAIL) (SITE) (FORUM) (BLOG)

Sunday, August 3, 2008

Video Capture

As usually happens, a webcam is placed at the top of the screen of my notebook. I was disappointed by the fact that APOCALYX could render nice scenes on the screen, but couldn't take advantage of the webcam. For example, one could think of embedding the real world that surrounds the player in the virtual world of the game.
To perform a step forward in that direction, today I wrote some functions to manage the Video Capture facilities of the operative system in the Lua scripts of the engine. The result is shown in the screenshot below.

As you can see, the Lua script executed by the engine is doing its job showing a live portrait of myself in the small window at the bottom-right of the screen. That is nothing extraordinary, but along this way a few new interesting features are going to become possible.
First of all, the captured images could be drawn on textures and applied to the objects of the game, both as single frames or as live videos. This is the main use of this feature, of course.
Another possible application, that I'm very interested in, ragards head motion capture. To know the direction from which the player watches the screen may improve the 3D realism of the scene. An additional transformation of the in-game camera, according to the player head movements, greatly helps the brain to interpret correctly the depth of the scene.
A famous movie of a similar approach, realized with the help of the Wii sensors, explains how this principle works.


Of course, head tracking through a webcam requires algorithms that the engine does not include yet, but this could be a good accasion to let your webcam actively partecipate to your games as an additional and uncommon game peripheral.

2 comments:

ezani said...

Leo, since you are a physicist -- why don't you incorporate a virtual reality helmet, a VR gloves and VR shoes into Apocalyx. I've seen a URL of the VR glove recently - very impressive. It works on Max.

Unknown said...

> since you are a physicist --
> why don't you incorporate a
> virtual reality helmet, a VR
> gloves and VR shoes into...

Well, now there is only a limited support for a joystick, so VR helmet and gloves are not affordable yet, because too expensive and complex. However, one day or other... :)