WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-03-2014, 01:00 AM
dcnieho dcnieho is offline
Member
 
Join Date: Feb 2011
Posts: 59
Question linking viewpoint to viz.node

Some background first:
I have a project in which the mainview is linked to 6DOF data recorded when walking with HMD. There are some transforms in between the data from the tracker and the position/orientation in the virtual world, implemented with pre and post actions on the link.
The 6DOF data from the tracker as well as transformed to the virtual world are stored to file.

Now, I'd like to replay this data. So simply use the stored tracker position/orientation data as input to the link transform chain to generate the same frames/views as during previous walking (there are other things going on in the code, changing as little as possible by simply providing fake/replayed tracker data is the best solution to implement what I want). I thought I could easily do this by simply using an empty node (viz.addGroup()), setting its position and orientation each frame and using that in place of the tracker linkable as source for the link with mainview. However, the orientation data is ignored, that is, the mainview is oriented always as if all input orientation data is 0.

Code:
 trackerLinkable = viz.addGroup()
 fileReader = MatFileReader()
 vizact.onupdate(viz.PRIORITY_PLUGINS,fileReader.getNextRealPosOri,trackerLinkable) # see below for relevant bits
  
 headLink = viz.link(headTrack, viz.MainView)
 vizact.onupdate(viz.PRIORITY_PLUGINS+2,headLink.update) # viz.PRIORITY_PLUGINS+1 reserved 
 #headLink.postEuler(), etc...
  
 class MatFileReader():
     def getNextRealPosOri(self,output=None):
          # get next rawPos and rawOri from loaded file
          if output is not None:
              output.setPosition(rawPos)
             output.setEuler(rawOri)
              print (output.getPosition(),output.getEuler()) # prints what is expected. e.g. getMatrix() also looks right
So above works as expected for as far as I can debug it, but it seems the orientation information is lost somewhere along the way. when I do
Code:
 print (viz.MainView.getPosition(),viz.MainView.getEuler())
I get [0,0,0] from getEuler.

A second problem I have is that this appears to run at 30 Hz instead of 60. Am I doing something very suboptimal causing the slowdown?

What have I forgotten? Is there a better way to implement something like this?

Thank you!

Last edited by dcnieho; 11-03-2014 at 01:05 AM.
Reply With Quote
 


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
How to track the actual viewpoint Jerry Vizard 3 05-25-2016 09:44 AM
Moving main viewpoint when linked to PPT v-clizzin Precision Position Tracker (PPT) 1 04-20-2010 04:09 PM
Avatar w/ hat cannot look at viewpoint TrashcanPatrol Vizard 5 08-19-2008 08:26 AM
3d viewpoint movement spacefarer Vizard 9 07-25-2006 03:37 PM
VRML Viewpoint error bstankie Vizard 1 03-11-2003 02:10 PM


All times are GMT -7. The time now is 06:13 PM.


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