WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #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
  #2  
Old 09-22-2008, 05:01 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
If you are applying a uniform gain to the data, then you can use the filter plugin. Here is sample code that creates a tracker object with a 2x gain in the x,z axis:
Code:
filter = viz.add('filter.dle')
magnifiedTracker = filter.position(tracker,scale=(2,1,2))
view = vizcave.CaveView(magnifiedTracker)
However, you should not be applying the magnified data to the frustum calculation, only the viewpoint. The frustum still needs to be computed from the physical eye position of the user, even if you are simulating a longer stride.
Reply With Quote
  #3  
Old 09-23-2008, 07:18 AM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
Ah ... perfect. Thank you! Knew you would have a better solution than I.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM


All times are GMT -7. The time now is 07:22 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC