Vizard 8 » Tutorials & Examples » Example scripts » Tracking » Automatic
8.0

Automatic head tracking

\examples\tracking\automatic.py

This script demonstrates how to perform head tracking.

"""
This script demonstrates how to perform automatic head tracking.
By default this script will connect to an intersense.
Press the 'r' key to reset the tracker
"""
import viz
import vizact

viz.setMultiSample(4)
viz.fov(60)
viz.go()

import vizinfo
vizinfo.InfoPanel()

#Add environment
viz.addChild('gallery.osgb')

#Add the intersense tracker
isense = viz.add('intersense.dle')
tracker = isense.addTracker()

#Link tracker to main viewpoint
viz.link(tracker,viz.MainView)

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