Vizard 8 » Reference » Input Devices » Position and Orientation Trackers » NaturalPoint TrackIR
8.1

NaturalPoint TrackIR plug-in

This plug-in provides support for the NaturalPoint TrackIR head tracking devices. The TrackIR plug-in supports both position and rotation data.

Initialization

The TrackIR plug-in is implemented as a Vizard extension. Before attempting to connect to the tracker in Vizard, make sure the TrackIR application is running and able to track your target. Also, make sure "Vizard" is displayed in the list of supported titles. If Vizard is not listed, you might need to update the game list by selecting "Check For Game Updates..." from the TrackIR application menu.

 

The TrackIR extension object has the following methods:

Method

Description

<trackir>.addTracker()

Returns a TrackIR 6DOF sensor.

The TrackIR sensor object has the following methods in addition to the standard extension sensor methods:

Method

Description

<sensor>.reset()

Re-center the head tracker.

<sensor>.getActive()

Returns True if tracking is active, or False if tracking has been disabled/paused by user.

<sensor>.getFrameNumber()

Returns the frame number of last received data packet.

Example

The following example shows how to add the TrackIR sensor and link it to the main viewpoint:

import viz
import vizact
viz.go()

#Create trackir extension
TrackIR = viz.add('TrackIR.dle')

#Add tracker
tracker = TrackIR.addTracker()

#Link to viewpoint
headLink = viz.link(tracker,viz.MainView)
headLink.postTrans([0,1.5,0])

#Add dojo model
viz.add('dojo.osgb')

#Recenter when 'r' key is pressed
vizact.onkeydown('r',tracker.reset)