Running in “simulator mode” means that your input is simulated and your display windows may have limited functionality. (By “simulated input”, we mean that input is provided through windows that take keyboard and mouse input and translate that into transformations in the virtual world.) Simulator viewports are limited primarily in that they cannot display stereo graphics. It is important to note that a simulator viewport is a special kind of VR Juggler viewport within a display window. Instead of basing its viewpoint on the head position of one of the users, the viewpoint is controlled by a separate camera that is just another positional device. Within a simulator viewport, VR Juggler draws certain objects to help visualize the environment. For example, the heads of users are represented as blue ellipsoids with gray eyes, and a wand (if present) is drawn as a green pointing device. Besides these common simulator objects, display surfaces can be drawn. These represent projection screens or HMD viewing projections and are drawn as translucent rectangles.
As mentioned, several simulator configuration files are provided with a VR Juggler distribution. These files provide a complete simulation of an immersive environment. Please note that this documentation reflects the state of the configuration files at the time the documentation was written. For more information about the configuration files and how to view or modify the configuration, refer to the VRJConfig Guide. (Using VRJConfig is the best way to find out how a specific configuration file is set up.) The configuration files of interest for simulator mode are as follows:
sim.base.jconf - The basic configuration
file needed by all applications when run in simulator mode. It
defines commonly used VR Juggler concepts that are beyond the scope
of this particular book. It also defines simulated head movement
using the keyboard. For now, it is sufficient to know that it is
required to run the sample applications in simulator mode.
This file also contains the basic simulator display configuration file needed by all applications when run in simulator mode. It defines the display windows where the rendering magic occurs. Two simulator display windows are configured by this file: a small one that is active by default and a larger one that is inactive initially.
sim.analog.wandmixin.jconf - A
“mix-in” configuration file that defines simulated
analog input using the keyboard. This is only required for
applications where analog input is used and needs to be simulated
when in simulator mode.
sim.analog.mixin.jconf - This version of
the analog simulator opens its own window. See the previous file
(sim.analog.wandmixin.jconf) for other
details.
sim.c6displays.mixin.jconf - A
“mix-in” configuration file that defines the surface
displays of VRAC's C6. This is not required for any application but
can be used to test opening multiple display windows (each
containing either a surface or a simulator viewport) before running
in a multi-screen VR system.
sim.digital.glove.mixin.jconf - A
“mix-in” configuration file that defines simulated
digital glove input using the keyboard. This is only required for
applications where digital glove input is used and needs to be
simulated when in simulator mode.
sim.glove.mixin.jconf - A
“mix-in” configuration file that defines simulated
gesture-based glove input using the keyboard. This is only required
for applications where gesture-based glove input is used and needs
to be simulated when in simulator mode.
sim.wand.mixin.jconf - A
“mix-in” configuration file that defines simulated wand
input using the mouse. This is only required for applications where
wand input is used and needs to be simulated when in simulator
mode.
standalone.jconf - A configuration file
that stands on its own and combines the functionality of
sim.base.jconf and
sim.wand.mixin.jconf. Note that it uses a
single display window for all input.
At the time of this writing, this configuration file only works with OpenGL, OpenSG, and Open Scene Graph applications on UNIX, Win32, and Mac OS X. It will not work with OpenGL Performer.
For the MPApp application, we need the base configuration file and the wand mix-in configuration file.
Now it is time to run the application—finally! Make sure that all your environment variables are set properly before trying to start the application. Once you are ready, specify the name of the application and all the configuration files it needs. An example of this is:
% MPApp sim.base.jconf sim.wand.mixin.jconf
You will notice that no paths are specified for finding the
configuration files. The full paths to the configuration files is not
necessary because the default search path will correctly find these
files in
$VJ_BASE_DIR/share/vrjuggler/data/configFiles.
Beginning users will typically want to reference the example
configuration files in that directory. As you get more comfortable
with VR Juggler and its configuration system, you may want to make
your own modified files and put them in the directory
$HOME/.vjconfig. The environment variable
VJ_CFG_PATH is useful in providing a search path for
finding your configuration files. (Refer to the section called “Optional Related Environment Variables” for more information on using
VJ_CFG_PATH). To simplify running applications, you may
want to make a shell script (or batch file as appropriate) that does
all the work of passing configuration files and common command-line
arguments.
As the application starts, you will see a status output printed
to the console (more or less depending on how you have
VPR_DEBUG_NFY_LEVEL,
VPR_DEBUG_ALLOW_CATEGORIES, and
VPR_DEBUG_DISALLOW_CATEGORIES set), and then one
moderately sized simulator display window will open on the left side
of your screen while three blank keyboard input windows open on the
right side of your screen. The display window will be titled
“SimWindow1”, and the keyboard input windows will be
titled “Head Keyboard”, “Sim View Cameras
Control” and “Wand Keyboard” (in order from the
top of the display to the bottom). Do not worry that the keyboard
windows are black—that is normal. The display window will have an
animated blue mesh, a cyan ellipsoid, and a green pointer. The mesh is
what you have come to see; the ellipsoid is the user's head; and the
pointer is the user's hand. In Figure 5.1, “MPApp running on a Linux desktop with multiple input
windows”, we show what this looks on a RedHat
Linux 7.2 desktop for comparison with what you are seeing. Note that
the head and wand are only rendered in the simulator windows. They are
present because head and wand input are being simulated, and it is
typically quite helpful to see the results of that simulated input. To
exit the application, press ESC in the window titled
“Head Window”.
With VR Juggler 1.1/2.0, it is possible to use a single window for graphics and for input. To use such a configuration, execute MPApp as follows:
% MPApp standalone.jconf
This time, only a single window opens, as shown in Figure 5.2, “MPApp running on a Linux desktop with one window”. It shows the same graphics as before, but now it is configured to take keyboard and mouse input. To exit, press ESC in the graphics window.
To run MPApp from within the Visual Studio IDE, the program
arguments must be set first. This is done by opening the properties
dialog for the project. In this dialog box, choose the
Debugging item. There will be an empty text
entry field under the heading Command
Arguments. Here, enter the full paths to the VR Juggler
configuration files that will be used to run the torus application.
To use the VJ_BASE_DIR environment variable (or any
other environment variable), makefile syntax must be used. In other
words, to load somefile.jconf, use
$(VJ_BASE_DIR)\share\vrjuggler\data\configFiles\somefile.jconf.
As was stated above, the full path need not be specified, so
referencing VJ_BASE_DIR in the path to the example
configuration files will not be necessary in most cases.. In Figure 5.3, “Setting Command Arguments”, we see
the use of standalone.jconf as the single
command argument to MPApp.
With the application already compiled, execute the MPApp
program by choosing the item from
the menu, shown below in Figure 5.4, “Execute MPApp.exe”.
Running a VR Juggler application on Mac OS X is slightly
different if VR Juggler was compiled against X11 for OS X. Before
starting the VR Juggler application, X11 must be running. This can
be accomplished by double-clicking on the X11 icon in the
Applications folder. By default, X11 will open a standard xterm when
it starts. In this xterm, the $DISPLAY environment
variable will be set correctly, and it is recommended that VR
Juggler applications be launched from this xterm. From this xterm,
set the necessary environment variables as described earlier in
the section called “Required Environment Variables”. Once this is done, the
application can be executed from the command line just as described
in the previous section.
MPApp is shown executing on a Mac OS X desktop in Figure 5.5, “MPApp running on Mac OS X using X11 with one window”. Note that in the dock, the X11 icon is activated and that the application menu is for an X11 application. This truly is an X11 application running on OS X.
So now you are probably wondering what you can do with this fancy application. Both of the preceding configurations use the same keyboard/mouse mappings; they vary only in which windows accept the keyboard and mouse input. Using the multi-window configuration, head movement is done with the keyboard in “Head Keyboard”; camera movement is done with the keyboard in “Sim View Cameras Control”; and wand movement is done with the keyboard and mouse in “Wand Keyboard”. Using the single-window configuration, all input is done with the keyboard and mouse in “Sim Window”. Note, however, that for the single-window configuration, the camera is attached to the user's head for an over-the-shoulder view, and hence, it does not move separately from the head. For information on how to verify these settings and to view the current configuration, refer to the VRJConfig Guide. The following list of tables provides all the keyboard and mouse controls for the simulator when using these particular configuration files. Note that it is possible to reconfigure the simulator to suit your preferences. This is provided mainly for those who just want something that works now.
Table 5.1. Moving the simulated head
| Transformation | Key Press |
|---|---|
| Move head backward | 2 on keypad |
| Move head left | 4 on keypad |
| Move head right | 6 on keypad |
| Move head forward | 8 on keypad |
| Move head down | 7 on keypad |
| Move head up | 9 on keypad |
| Turn head up | CTRL+2 on keypad |
| Turn head left | CTRL+4 on keypad |
| Turn head right | CTRL+6 on keypad |
| Turn head down | CTRL+8 on keypad |
| Rotate head clockwise | 1 on keypad |
| Rotate head counter-clockwise | 3 on keypad |
Table 5.2. Moving the simulated wand
| Transformation | Mouse Input/Key Press |
|---|---|
| Move wand backward | ALT+move mouse backward |
| Move wand forward | ALT+move mouse forward |
| Move wand left | CTRL+move mouse left |
| Move wand right | CTRL+move mouse right |
| Move wand up | CTRL+move mouse forward |
| Move wand down | CTRL+move mouse backward |
| Rotate wand left | SHIFT+move mouse left |
| Rotate wand right | SHIFT+move mouse right |
| Rotate wand up | SHIFT+move mouse backward |
| Rotate wand down | SHIFT+move mouse forward |
| Rotate wand clockwise | Right arrow |
| Rotate wand counter-clockwise | Left arrow |
| Wand button #1 | Left mouse button |
| Wand button #2 | Middle mouse button |
| Wand button #3 | Right mouse button |
| Wand button #4 | 4 |
| Wand button #5 | 5 |
| Wand button #6 | 6 |
Table 5.3. Moving the camera (multi-window configuration only)
| Transformation | Key Press |
|---|---|
| Move camera backward | 2 on keypad |
| Move camera left | 4 on keypad |
| Move camera right | 6 on keypad |
| Move camera forward | 8 on keypad |
| Move camera down | 7 on keypad |
| Move camera up | 9 on keypad |
| Turn camera up | CTRL+2 on keypad |
| Turn camera left | CTRL+4 on keypad |
| Turn camera right | CTRL+6 on keypad |
| Turn camera down | CTRL+8 on keypad |
| Rotate camera clockwise | 1 on keypad |
| Rotate camera counter-clockwise | 3 on keypad |
Before continuing on to running an application in a full-scale VR system, we provide two asides: using a simulated glove and using a simulated analog device. The examples provided thus far have not discussed this because the information was not relevant to the particular sample application being used. Knowing how to use these simulated devices is important, however, and it is treated separately as a reference for your future endeavors in running VR Juggler applications.
If you include the sim.glove.mixin.jconf
file, your application will also have access to a simulated glove,
with position and gesture inputs. The glove is controlled by a window
titled “Glove Keyboard”. This window lets you control the
glove position and selected gesture. Movement control of the glove
uses the mouse and is the same as that of the wand. The mouse buttons
are used to select gestures. The mapping of the gesture numbers to
actual hand positions is controlled by the “training
file” for the sim glove. The default training file is
$VJ_BASE_DIR/share/vrjuggler/data/gesture/simpleSimGestures.dat.
If you include the
sim.analog.wandmixin.jconf file, your application
will also have access to a set of four analog devices (devices with a
value in a range from 0.0 to 1.0). The analog devices are also
controlled using the “Wand Keyboard” window which means
that their configuration file requires the wand configuration
file.
A separate file, sim.analog.mixin.jconf,
is provided for analog input from a separate simulator
window.
The key presses used for controlling the analog devices are listed in Table 5.4, “Analog Device Simulator Keys”.
Table 5.4. Analog Device Simulator Keys
| Analog Device Action | Key Press |
|---|---|
| VJAnalog0 increase | Q |
| VJAnalog0 decrease | A |
| VJAnalog1 increase | W |
| VJAnalog1 decrease | S |
| VJAnalog2 increase | E |
| VJAnalog2 decrease | D |
| VJAnalog3 increase | R |
| VJAnalog3 decrease | F |