Electro, Blender,
twaka, cavevars
(more
detail will be added to this page or the course wiki as the course
continues)
Current
Issues ...
-
there
is an electro users group at google:
http://groups.google.com/group/electro-users
Working
with Electro
The
main information resource for electro is
http://www.evl.uic.edu/rlk/electro/ You should grab the current
version of electro for your platform of choice. Most likely you will
want to recompile from the latest subversion source. Note that if you want
to build electro yourself you will need to grab a
bunch of libraries it depends on. This is pretty straight-forward but
with ODE you need to build with enable-release so it doesn't keep
giving warnings.
I
have created a small program in electro to give you a
starting point for your work. It lives in sample.tar.gz
This
code sets up a simple world that shows off various things you can do
with electro.

The application runs in with stereo visuals on the C-Wall. You can
navigate around the scene with the wand and change your perspective by
walking or moving your head.
You can see a representation of your hand where the wand is located.
The left wand button causes a new crate to drop. When touching the
fountain you can use the middle
wand button to turn the fountain on and off. That same middle
button can be used to pick up and throw a crate. The right wand button
shoots out a ball. You can also use the
wand to push the crates over.
The fountain gives off directional sound when its on and there are
sounds when a new crate or ball is created with the wand.
To run the
simple world on a linux / OS-X laptop/desktop computer:
1. go to the twaka/linux-mac directory in simple.tar.gz, edit the
makefile, and make to create the twaka executable
2. start twaka. You should see a window pop up with the twaka keyboard
commands. There is more info on twaka below.
3. copy your electro executable into the simple directory (not
necessary but convenient)
4. in another terminal window go to the simple directory and electro
simulator.lua simple.lua
5. give the twaka window focus and use the keyboard to interact with
the electro window
6. escape
quits electro, and q quits twaka
To run the
simple world on a windows laptop/desktop computer:
0. you should be able to double-click the twaka.exe executable in the
twaka/windows directory of sample.tar.gz otherwise there is a visual
studio 6 workspace to build it. You will likely need to tweak some
things to get it to work in .net. When twaka runs you
should see a window pop up with the twaka keyboard commands. There is more info on
twaka below.
1. copy
simulator.lua from the simple directory to electro-10XX/config
2. edit electro.bat file so that it looks like this:
rem
-----------------------------------------------------------------------
rem
This batch file acts as a drag-and-drop target for Electro Lua scripts.
%~d1
cd
"%~dp1"
rem"%~dp0electro.exe" -f %1
rem
-----------------------------------------------------------------------
rem
Configure with a default display config as follows:
rem
"%~dp0electro.exe"
-f "%~dp0\config\simulator.lua" -f %1
3. drag and drop simple.lua onto the electro.bat file
4. give the twaka window focus and use the keyboard to interact with
the electro window
5. escape quits electro, and q quits twaka
To run the
simple world on the C-Wall
computer:
1. make sure the tracker is working with /usr/local/CAVE/bin/cavevars -
if not see the cavevars section at the bottom if this pate
2. in one
terminal window ~aej/GOTRACKER
will take tracking data and place it into shared memory on the C-Wall
machine. You should see the numbers changing slightly
3. by default the simple code is set up for monoscopic viewing so for
stereo you need to uncomment the line
E.set_camera_stereo(camera,
E.stereo_mode_tile, -EYESEP, 0, 0, EYESEP, 0, 0)
4. in another terminal window go to your simple directory
~aej/electro/electro cwall.lua simple.lua
5. escape quits electro
Blender
You can use any modelling package you prefer as long as it can produce
a .obj file for Electro to read in. Blender has been popular lately.
Personally I like ac3d, which is less powerful but has a more 'normal'
interface than blender. One thing to note is that Electro can not deal
with scaled textures.
http://www.blender.org/
There is a good tutorial here:
http://www.idevgames.com/index.php/news/comments/blender_basics_free_classroom_tutorial_book/
twaka
VR
programming can be tricky because interaction in a VR environment is
very different from interaction on a typical computer, and VR
environements need to be experienced at 1:1 scale, so its best to test
the application in the VR environment where it will be deployed.
Unfortunately that's not very convenient, so most development will
likely take place on a laptop or desktop pc, but at
regular intervals you should test on the actual C-Wall hardware.
To make development
a bit easier I have written some tracker simulation code called twaka
that allows you to use the keyboard to simulate moving around, turning,
using the wand. This application runs separately from your electro
application on the same computer and feeds appropriate values into
shared memory for the electro application to read. twaka runs in OS-X
(10.4.10 for sure) , linux (SUSE 10.2 for sure), and windows (XP sp2
for sure)
cavevars
An
important program on the C-Wall is /usr/local/CAVE/bin/cavevars
It
is a simple application that displays the current state of the C-Wall
so you can check that the tracker is working, the wand is working, and
that the projectors are showing the correct eye view. Before doing any
work on the C-Wall its worth taking a couple minutes to run cavevars
and make sure everything is OK.
If
things are not OK, for example if you move the glasses or the wand and
the tracker values do not update, then you may need to restart the
tracker. You should shut down the laptop running the tracker, then turn
off the tracking system, wait a few seconds, turn on the tracker, then
turn on the laptop.
Note that if you
are only seeing scenery in your left eye and the sky in the right eye
then you need to set your electro code to run in stereo. In simple.lua
you would uncomment the line:
E.set_camera_stereo(camera,
E.stereo_mode_tile, -EYESEP, 0, 0, EYESEP, 0, 0)
last
revision 8/20/07