record and playback head-tracked data
Hi Vizards, I'm a little stuck on a project I've been trying to implement. I have a Power Wall setup with head-tracking in which I'd like to record the head position and orientation while a user walks around a virtual environment. Then, while the user remains stationary, I'd like to play back that same scene (with frustum and view updates) to the user.
I can setup my cave, link the head-tracker to it, and record the head-tracking data just fine with a onFrameUpdate callback. But then when I try to remove the head-tracker (programmatically), and use the recorded coordinates to update the cave frustums (cave.update) and Vizard MainView (viz.MainView.setPosition) it doesn't behave as I expect, and the scene simply doesn't update. Maybe I'm not understanding what the right approach to this problem is at all. Perhaps I should be using some sort of camera? Could any of you Vizard guru's please give me some help? Thank you! |
It's hard to tell what you are doing wrong without seeing any sample code. I've attached a sample script that will record the tracker data and play it back. Press space key to start/stop recording. Once the recording has stopped it will automatically playback the tracking data. Hopefully this will give you some ideas on how to implement what you are trying to accomplish.
Code:
import viz |
Okay. Interesting. I was able to get a stripped-down example working, though my approach was slightly different than yours. So for the forum record I will post it here, then I just have a few questions about the differences. FYI, the sunyobjects module is just full of on-the-fly objects whose appearance should be obvious from the class name.
Code:
from __future__ import division #implements "/" as division without truncation regardless of its operands A more minor difference is that during playback you yield on None after each position update, whereas I yield on viztask.waitDraw(). What is the difference between these approaches, and which would ensure that each frame of the playback was identical to the recorded frames? Finally, and this perhaps is not a difference at all, you use vizact.onupdate, while I use viz.callback(viz.UPDATE_EVENT). Is there a reason to prefer one command over the other, or are they completely identical? Thanks for all the help! |
Quote:
Quote:
Quote:
|
All times are GMT -7. The time now is 07:22 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC