Tracking-related functions & macros
- CAVEGetPosition (CAVEID id, float pos[3])
- Returns the current position of the head, the wand, or an eye.
id indicates which position to return - it can be
CAVE_HEAD, CAVE_WAND, CAVE_LEFT_EYE, or CAVE_RIGHT_EYE.
- CAVEGetOrientation (CAVEID id, float ori[3])
- Returns the current orientation of the head or the wand, in Euler angles.
id indicates which position to return - CAVE_HEAD or CAVE_WAND.
ori consists of the rotation about X, about Y, and about Z;
the angles are in degrees.
- CAVEGetVector (CAVEID id, float vec[3])
- Returns a unit-length vector for the head or wand, pointing in a given
direction, based on the current orientation.
id indicates which vector to return; it can be CAVE_HEAD_FRONT,
CAVE_HEAD_BACK, CAVE_HEAD_LEFT, CAVE_HEAD_RIGHT, CAVE_HEAD_UP,
CAVE_HEAD_DOWN, CAVE_WAND_FRONT, ... .
- CAVEBUTTON1, CAVEBUTTON2, CAVEBUTTON3
- Macros for the current state of the wand buttons. The value is
0 when the button is released, non-zero when it is pressed.
- CAVE_JOYSTICK_X, CAVE_JOYSTICK_Y
- Macros for the current state of the wand joystick. The values
are floats, normally in the range -1.0 to 1.0. When the joystick
is not being pushed, the X and Y will be close to, but not
exactly, 0.
CAVE tracking actually supports up to 32 sensors, and
up to 32 buttons and 32 valuators.
To get data from sensors other than the first two, use the macro
CAVESENSOR(sensornum), and the functions
CAVEGetSensorPosition(), CAVEGetSensorOrientation(), and CAVEGetSensorVector().
The number of tracked sensors is CAVEptr->num_sensors.
To read the state of other buttons or valuators, use the CAVEController
struct. The struct entries are num_buttons, num_valuators,
button[], and valuator[] (e.g. CAVEController->valuator[2]).
interact.c - Example of interaction, using
tracker & wand data
Previous page
Next page
Last modified 19 July 1997.
Dave Pape, pape@evl.uic.edu