View Single Post
  #4  
Old 09-20-2004, 04:37 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Are you running this script on a laptop computer? Vizard uses CPU clockspeed to determine elapsed time, and most laptops have variable CPU speeds in order to save power, which causes inconsistencies in timing.

If you aren't using a laptop then I've included a sample script which displays the elapsed time on the screen. Make sure you are doing something similar to this:
Code:
import viz
viz.go()

text = viz.add(viz.TEXT3D,'0',viz.SCREEN)
text.translate(0.5,0.5)
text.time = 0

def ontimer(num):
	text.time += viz.elapsed()
	text.message('%d::%.2f'%(int(text.time/60.0),text.time%60.0))

viz.callback(viz.TIMER_EVENT,ontimer)
viz.starttimer(0,0.01,viz.FOREVER)
Reply With Quote