Panda3D Manual: VR Helmets and Trackers
<<prev | top | next>> |
This section is especially geared towards Carnegie Mellon University's virtual reality equipment. The tracking setup used consists of a space pad that receives signals, a virtual reality headmount, and four small trackers, one of which is attached to the headmount. These magnetic trackers may be held in the hand or implanted in non-metallic objects, and they will relay their position and orientation to the space pad, which then supplies it to the program. First, make sure that the SimpleTracking is in the same folder as your program files. Then, import it as you would any Panda3D module.
import SimpleTracking
Once imported, the SimpleTracking functions are now available. The tracker initialization should be in its own function for encapsulation purposes. The VRPN system needs to know the server name and the spacepad object.
serverIP = "<Server and Port>" spacePad = SimpleTracking.SpacePadSystem( self.serverIP ) space_pad_node = self.spacePad.getSpacePadHelper() spacePad.enable()
The two servers for available at the Pittsburgh Technology Center are transform.etc.cmu.edu:4500, and rollout.etc.cmu.edu:4500. The space pad is treated as a NodePath, so it may be moved around. Typically, the space pad is moved 8 feet off the ground. Also, the range of the space pad is from a three or so inches from the top of the space pad to around the knees of an average person. The final line above enables space pad tracking. This line should be commented if you wish for the tracking information to be disabled. A four-dimensional matrix should also be created to contain information about the camera.
camera.setMat( Mat4.identMat() )
Finally, objects within the Panda3D application may be reparented to the trackers. The four trackers are HMDHelper, GreenHelper, YellowHelper, and BlueHelper. They must be called through the space pad. Also, remember that reparenting may create some strange inheritance issues.
NodePath.reparentTo(spacePad.getHMDHelper() ) NodePath.reparentTo(spacePad.getGreenHelper() ) NodePath.reparentTo(spacePad.getYellowHelper() ) NodePath.reparentTo(spacePad.getBlueHelper() )
Finally, there are two functions in SimpleTrack to disable and enable the space pad while the program is running.
spacePad.enable() spacePad.disable()
<<prev | top | next>> |