View Single Post
  #1  
Old 09-19-2008, 10:19 AM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
How can you dynamically change the gain on a tracker-based CaveView?

I'm using a setup with a PowerWall and head-tracker. I currently have the view linked to the tracker with:
Code:
cave.setTracker(pos=tracker,ori=tracker)
view = vizcave.CaveView(tracker)
It's simple and it looks great! I love Vizard.

Now I want to be able to dynamically change the gain on the tracker position, so that in one segment of the program the frustum and view are updated based on the raw tracker position, while in a different segment the frustum and view are updated based on a magnification of the actual tracker position. In this way the user could be shown virtually what it would be like to be larger (e.g., how quickly their view would change if their stride were twice as long).

To do this, do I need code like:
Code:
viz.callback(viz.UPDATE_EVENT,onUpdate)
def onUpdate(event):
   view.setPosition(magnifyPosition(view.getPosition()))
   cave.update(pos=magnifyPosition(tracker.getPosition()),ori=tracker.getQuat())
or is there something simpler or more elegant? Or is this just plain bad form?
Reply With Quote