PDA

View Full Version : Units Question


Plasma
02-22-2004, 10:54 AM
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!

farshizzo
02-23-2004, 09:53 AM
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.

tobin
02-23-2004, 11:24 AM
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.

Plasma
02-23-2004, 11:34 AM
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)

farshizzo
02-24-2004, 09:54 AM
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