WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-20-2012, 06:17 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
For anyone with the same problem, here's my solution I eventually used:
Code:
import viz
import vizact
import viztask

viz.go()

#CONSTANTS
TIMER_SPEED = 0.1
SEC_DELAY = 4

yaw_list = []
pitch_list = []
roll_list = [] 

def logTrackingData():
	orientation = viz.MainView.getEuler()
	yaw_list.append(orientation[0])
	pitch_list.append(orientation[1])
	roll_list.append(orientation[2])
	
def readTrackingData():
	global yaw, pitch, roll
	#Read information
	yaw = yaw_list[0]
	pitch = pitch_list[0]
	roll = roll_list[0]
	#Delete information already read
	yaw_list.pop(0)
	pitch_list.pop(0)
	roll_list.pop(0)

def readWithDelay():
	#Wait 4 seconds
	yield viztask.waitTime(SEC_DELAY)
	vizact.ontimer(TIMER_SPEED, readTrackingData)

vizact.ontimer(TIMER_SPEED, logTrackingData)
viztask.schedule(readWithDelay())
Reply With Quote
Reply


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
Avatar & Motion Capture Interface Angie Vizard 1 08-05-2010 06:17 PM
avatar scale and link.setpos conflict? sircedric4 Vizard 0 09-29-2009 07:48 AM
Collision of an avatar with a quad Frank Verberne Vizard 8 06-04-2008 09:44 AM
Looking through the eyes of an avatar Frank Verberne Vizard 2 04-01-2008 05:52 AM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 08:48 AM


All times are GMT -7. The time now is 09:39 PM.


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