Version v1.0, July 29, 1999
San Diego Supercomputer Center
Visualization Technology Group
Tracker * TrackerInit( int which );
void tracker->Open( char * path );
void tracker->SetMode( int mode );
int tracker->GetMode( );
void tracker->SetTranslationScale( double factor );
double tracker->GetTranslationScale( );
void tracker->SetUpAxis( int axis );
int tracker->GetUpAxis( );
int tracker->GetButtonCount( );
void tracker->Reset();
void tracker->GetTransform( double matrix[4][4] );
void tracker->GetButtons( int buttons[] );
void tracker->Close();
The common feature set of all supported devices is embodied in one simple-to-use API. This means that an application only needs to integrate a single API in order to provide 3D tracking control using ANY supported device. As new low-level device drivers are added to the library, the new tracking capability becomes available to the high-level API and consequently to your application!
| TrackerInit |
must be called once to initialize each device driver you wish to
access. The which argument specifies the desired
device to initialize (see tracker.h for a list of valid
TRACKER3D_... values). Upon successful completion, the
corresponding low-level device driver is initialized and a tracker
object pointer for that device is returned. Otherwise, a NULL
value is returned. Some examples include:
|
| Open | opens the serial driver associated with the device specified by the path argument. This must be called once after a call to TrackerInit in order to enable communications with the device. |
Configuration
| SetMode |
changes the matrix output behavior
(for GetTransform calls) to the specified
mode (see tracker.h for a list of valid
MODE_... values). Some examples include:
|
| SetTranslationScale | changes the scaling factor (for GetTransform calls). |
| SetUpAxis |
changes the coordinate system of the matrix (for
GetTransform calls) to the specified orientation.
|
| Reset | sets the internal accumulation matrix (used by MODE_CUMULATIVE) to the identity matrix. This may be called, for example, if a user has manipulated an object offscreen or wishes to return the position and orientation to nice default values (ie: front facing at the origin). |
Reading
| GetTransform | retrieves the 4x4 double matrix from the tracking device. The upper 3x3 segment is a standard rotation matrix and the first 3 values of the 4th column are translation values. |
| GetButtons | retrieves the int array buttons from the tracking device. Each value corresponds to the state of a button. The value 0 meaning the button is not pressed and 1 meaning the button is pressed. Call GetButtonCount to determine the number of buttons that a device supports. |
Cleanup
| Close | must be called once for each open device before your program exits in order to clean up the serial and low-level drivers associated with the tracking device. |
#include <tracker.h>
Tracker myPointer;
double myPointerMatrix[4][4];
Tracker myCamera;
double myCameraMatrix[4][4];
myPointer = TrackerInit( TRACKER3D_POLHEMUS );
myPointer->Open( "/dev/ttyd1" );
myPointer->SetMode( MODE_RAW );
myCamera = TrackerInit( TRACKER3D_MAGELLAN );
myCamera->Open( "/dev/ttyd2" );
myCamera->SetMode( MODE_CUMULATIVE );
...
myPointer->GetTransform( myPointerMatrix );
myCamera->GetTransform( myCameraMatrix );
...
myPointer->Close();
myCamera->Close();
OpenGL
...
myPointer->GetTransform( myPointerMatrix );
glxxx( myPointerMatrix );
...
Performer
...
myPointer->GetTransform( myPointerMatrix );
pfxxx( myPointerMatrix );
...
(c 1999) San Diego Supercomputer Center