You can use the
viztracker.Keyboard6DOF() object to setup keyboard navigation and link it to the CaveView object. Here is sample code:
Code:
import viztracker
keyTracker = viztracker.Keyboard6DOF()
viz.link(keyTracker, origin)
The Keyboard6DOF object uses the WASD keys by default for navigation. You can customize the keys by passing the following optional keyword arguments to the constructor:
forward - key for moving forward
backward - key for moving backward
right - key for strafing right
left - key for strafing left
turnRight - key for rotating right
turnLeft - key for rotating left
For example, if you wanted to use the arrow keys for moving around you would use the following code to create the keyboard tracker object:
Code:
keyTracker = viztracker.Keyboard6DOF(forward=viz.KEY_UP,backward=viz.KEY_DOWN,left=viz.KEY_LEFT,right=viz.KEY_RIGHT)