WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-20-2009, 10:15 AM
whj whj is offline
Member
 
Join Date: Apr 2008
Posts: 60
Basically I want to look around with HMD and move with joystick independently at the same time. Here is what I've done. Worked a little bit and then messed up. Does anybody know how to correct my code? Thanks a lot.

def mytimer(num):
global joy_pos, joy_rot

## Control orientation
rot_data = ppt.getEuler()
viz.MainView.setEuler(rot_data,viz.HEAD_ORI)

if abs(joy_rot) > 0.2:
angle = joy_rot*TURN_SPEED*viz.elapsed()
viz.MainView.rotate(0, 1, 0, angle, viz.BODY_ORI, viz.RELATIVE_WORLD)

## Control position
if abs(joy_pos[0]) > 0.25:
viz.MainView.move(joy_pos[0]*WALK_SPEED*viz.elapsed(), 0, 0, viz.BODY_ORI)
if abs(joy_pos[1]) > 0.25:
viz.MainView.move(0, 0, -joy_pos[1]*WALK_SPEED*viz.elapsed(), viz.BODY_ORI)
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
General question and question regarding arrays dan12345 Vizard 1 01-15-2008 10:15 AM
question about yaw, pitch, roll TunTun Vizard 2 05-23-2007 12:46 PM
(beginner) calculating orientation change with eulers astull Vizard 16 02-22-2007 09:45 AM
intersense orientation jargon Vizard 2 05-14-2005 04:55 PM
to rephrase my question... shai Vizard 2 10-27-2004 10:55 AM


All times are GMT -7. The time now is 08:27 AM.


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