WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   How can you dynamically change the gain on a tracker-based CaveView? (https://forum.worldviz.com/showthread.php?t=1652)

michaelrepucci 09-19-2008 10:19 AM

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?

farshizzo 09-22-2008 05:01 PM

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.

michaelrepucci 09-23-2008 07:18 AM

Ah ... perfect. Thank you! Knew you would have a better solution than I.


All times are GMT -7. The time now is 05:28 AM.

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