WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-22-2004, 10:54 AM
Plasma Plasma is offline
Member
 
Join Date: Jan 2004
Posts: 22
Units Question

For some reason I'm having trouble with figuring out what units Vizard is using. The manual says it's using metres, but this doesn't seem to be so, at least not for the Z-axis.

In my program, I have a command that, upon pressing a key, brings the user back to a pre-determined position in the environment. The X and Y coordinates are working fine, but it seems like Z is in millimeters or something. 200 "metres" down the hallway moves the user forward only a small amount, when in actuality the hallway is only about 30m long.

When I made the model in 3D Studio Max, I used metres as the units. I now know that I should have selected 'Generic Units'. Is this the problem? If so, then why do X and Y work properly? I tried re-exporting the model after changing it to Generic Units but it didn't make any difference.

Please help!

Thanks!
Reply With Quote
  #2  
Old 02-23-2004, 09:53 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Vizard uses the meter system for all three axis. You might have accidentally scaled your model along the Z-axis, which could be the cause of your problem. Make sure this isn't the case and let me know if you are still experiencing this problem.
Reply With Quote
  #3  
Old 02-23-2004, 11:24 AM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
When exporting from modeling programs such as 3DMax, you should select "generic" as units. Within Vizard, however, the only time you'll have to be careful that your units are measured in meters is when calibrating a stereoscopic display. Otherwise, everthing thing be scaled equivalently.

As for the Z axis behaving differently than X and Y, I strongly suspect you've got an error in your script for controlling motion. If you'd like to post the snippet of code that controls the motion, one of us can probably point out what's going on.
Reply With Quote
  #4  
Old 02-23-2004, 11:34 AM
Plasma Plasma is offline
Member
 
Join Date: Jan 2004
Posts: 22
Thanks for your help! Here's the program:

#Trial 08 - 2-1B
import sid
import viz
import math
viz.go()

a = 0
b = 0
c = 0

#Add the intersense tracker
tracker = viz.addsensor('intersense')
viz.tracker()
tracker.reset()

#Turn off the mouse cursor
viz.cursor(0)

#Add the objects

viz.add('08hw21b.wrl')

viz.sensitivity(10.0,0.5) #For Participants
#viz.sensitivity(100.0,0.5) #For Development

viz.collision(viz.ON)
viz.gravity(0.0)

#Make the headlight omnidirectional
headlight = viz.get(viz.HEAD_LIGHT)
headlight.position(0,0,0,1)

#Triple the intensity of the headlight
headlight.intensity(3)

#Add the crosshair
crosshair = viz.add(viz.TEXQUAD,viz.SCREEN)
crosshair.texture(viz.add('crosshair.tif'))
crosshair.translate(0.5,0.5)

#Add joystick navigation
def joysticktimer(num):
data = sid.get()[2]
y = sid.get()[1]
if math.fabs(y) > 0.2:
viz.move(0,0,-y*0.9)

#Get the head position
pos = viz.get(viz.HEAD_POS)

#Get the yaw of the viewer
yaw = viz.get(viz.VIEW_YAW)

#Snap back to the home position on S key press
def snapback(key):
if key == 's':
viz.reset(viz.HEAD_ORI|viz.BODY_ORI|viz.HEAD_POS)
viz.translate(viz.HEAD_POS,0.875,1.82,569.5) #Home Position 1
viz.callback(viz.KEYBOARD_EVENT,snapback)

#Print data on trigger pull
buttons = sid.buttons()
if buttons & 1:
print yaw,pos

#Print yaw and positional information constantly in terminal window
#print yaw,pos

viz.eyeheight(1.82)
viz.callback(viz.TIMER_EVENT,joysticktimer)
viz.starttimer(0,0.001,viz.FOREVER)
Reply With Quote
  #5  
Old 02-24-2004, 09:54 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The code looks fine. The only thing I noticed was that the Z value of your home position is very high, 569.5

I'm thinking that your model isn't in the correct units. If you would like me to take a look at it you could email the model to lashkari@worldviz.com
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 01:49 PM.


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