WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1  
Old 01-30-2004, 11:53 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Okay, in that case you need to turn off automatic head tracking and manually apply the rotations. You want to apply the yaw rotation of the intersense to the body orientation and the pitch,roll to the head orientation. Here's some code to help you:
Code:
import viz
import sid

viz.go()

isense = viz.add('intersense.dls')

#Get the main viewpoint object
viewpoint = viz.get(viz.MAIN_VIEWPOINT)

def mytimer(num):
	y = sid.get()[1]
	x = sid.get()[0]
	#Get the data from the intersense
	data = isense.get()
	#Apply the yaw to the body orientation
	viewpoint.rotate(data[3],0,0,'',viz.BODY_ORI)
	#Apply pitch and roll to the head orientation
	viewpoint.rotate(0,data[4],data[5],'',viz.HEAD_ORI)
	#Navigate relative to body orientation
	if abs(y) > 0.2:
		viz.move(0,0,-y*0.1,viz.BODY_ORI)
	if abs(x) > 0.2:
		viz.move(x*0.1,0,0,viz.BODY_ORI)

viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.001,viz.FOREVER)
This will restrict navigation to the x-z plane but still let the user look up and down.

Hope this helps!
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


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


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