View Single Post
  #4  
Old 01-06-2012, 03:47 PM
surf3rguy surf3rguy is offline
Member
 
Join Date: Jan 2012
Posts: 5
Here is what have

# File generated automatically by WorldViz graphical setup tool 3.1
# Setup option Input --> Manufacturer: Keyboard Type: Mouse LR / PageUpDn
# Setup option Tracker --> Manufacturer: InterSense Type: VRPN7 + InertiaCube2/3
# Setup option Display --> Manufacturer: NVIS HMD Type: Nvisor SX60
# Setup option Avatar --> Manufacturer: Generic Type: No Avatar

# This file must be loaded by the correct version of viztracker.py included with Vizard
import viz
viz.requireVersion("3.17.0000")

# Source code that defines the composite. This is user editable but changes will be lost if this file is regenerated
import vizact
import vizuniverse as VU
import __main__
import hand

# Create a custom composite that handles tracking, display, and input devices all together
def createCustomComposite(id=0):
# ---- Trackers ----
# Initialize an empty composite object to store all the trackers
# The composite.storeTracker() method is used to combine the individual trackers for the user's body within the composite
composite = VU.VUCompositeTrackersVRPN(hostname='PPT0@128.111. 240.77', magneticzero=0.0, supplementIntersense=3)

# ---- Display ----
viz.setOption ('viz.fullscreen', 1)
import nvis
nvis.nvisorSX60()

# ---- Input ----
composite.createLeftHand(hand.MultiInputSensor(pin chButtons=[viz.KEY_PAGE_UP,viz.MOUSEBUTTON_LEFT], fistButtons=[viz.MOUSEBUTTON_MIDDLE]))
composite.createRightHand(hand.MultiInputSensor(pi nchButtons=[viz.KEY_PAGE_DOWN,viz.MOUSEBUTTON_RIGHT], fistButtons=[viz.MOUSEBUTTON_MIDDLE]))

# ---- Avatar ----
composite.createAvatarNone()

# ---- Finalize Composite ----

composite.finishTrackers() # Build up internal links for all the tracking devices
# Attach viewpoint to default location on the user
composite.getRawTracker(composite.HEAD).getLink(). preEuler([-90,0,0]) #postEuler does not work. but this does
composite.getRawTracker(composite.HEAD).getLink(). postTrans([3,0,-3.75])#move the person in the right position
composite.defineViewpoint()
# ---- Extra Adjustments Editable By The User ----

# Note that the examples below will not work with LiveCharacters, only inputs with individual trackers
# composite.getRawTracker(composite.HEAD).getLink(). postEuler([0,0,45]) # Apply 45 degree offset to the head tracker
# composite.getLeftHand().setScale([2,2,2]) # Apply scale to the left hand representation
# composite.getLeftHand().alpha(0.0) # Make the left hand invisible
# composite.getRawTracker(composite.LHAND).getLink() .postTrans([0,-0.5,0]) # Lower the hand tracker 50 cm
# composite.setPosScale([2,1,2]) # Scale XZ position of all trackers by a factor of 2x
# composite.setOriScale([0,0,0]) # Suppress all orientation changes for all trackers

# The following examples are compatible with all kinds of composite objects, including LiveCharacters
# composite.getMovableNode().setPosition([1.0,0.0,0.0]) # Move the user and all trackers +1 unit along the X axis
# composite.defineViewpoint(offset=[0,0,0]) # Replace above defineViewpoint() call, allows custom offset of viewpoint

# ---- Return Back Result ----
return composite


# If this script is run directly, then we should allow it to work for testing purposes (normally viztracker.py loads this file in, and this file is not used standalone)
if __name__ == "__main__":
print 'Manually overriding viztracker to test vizsetupcfg configuration'
import viztracker
viztracker.createCustomComposite = createCustomComposite
viztracker.go()
viz.add('gallery.ive')










###########
Basically I move the subject within the room. and the rotate the head so that is is starting in the correct position. but then when you move foreward you move to the left in the world, backwards moves right in the world etc etc. Then when I reset using alt r, the room does not match the virtual one. basically we are working in a virtual model of the actual room we are in.
Reply With Quote