WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-21-2005, 01:55 PM
alemenchaca alemenchaca is offline
Member
 
Join Date: Nov 2005
Location: Cambridge, MA
Posts: 2
Beginner's troubleshoot

I'm learning to use Vizard with the tutorial. I started with the Keyboard Interaction section, copypasted the code from the tutorial (see below) and my screen doesn't do what it is supposed to do. Could anyone help me? I'm so new in this that I don't really know what is wrong.
Thanks!
Alejandra.

MY CODE:
import viz

viz.go()

micuarto = viz.add('room.wrl') # Add room to your empty world
pantalla = micuarto.getchild('screen') # Get access to a subobject screen in the room

# Add the projected light to the room and translate it to it's correct location
luz = viz.add('light.WRL')
luz.translate(0,2.25,0)

def mytimer(num):

pass

def mykeyboard(key):

# If the user presses the u key do something
if key == 'u':
# Move the screen up
pantalla.goto(0,3,0,.5)
print 'up'

# If the user presses the d key, do something
if key == 'd':
# Move the screen down
pantalla.goto(0,0,0,.5)
print 'down'

viz.callback(viz.TIMER_EVENT,mytimer)
viz.starttimer(0,0.5,-1)

viz.callback(viz.KEYBOARD_EVENT,mykeyboard)
__________________
Alejandra Menchaca
Massachusetts Institute of Technology
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:01 PM.


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