Thread: multiple timers
View Single Post
  #2  
Old 06-02-2006, 06:55 AM
halley halley is offline
Member
 
Join Date: Oct 2005
Posts: 27
A timer starts whenever you call viz.starttimer(), so your goal is to decide when it's appropriate to make that call.

Something like this sketch (this is not tested code):

Code:
timer_one = False

def mytimer(num):
	if num == 0:
		if not timer_one and viz.get(viz.FRAME_TIMESTAMP) > 5.0:
			timer_one = True
			viz.starttimer(1, 0, viz.PERPETUAL)
		# do other timer-zero stuff
	if num == 1:
		# do other timer-one stuff

viz.callback(viz.TIMER_EVENT, mytimer)
viz.starttimer(0, 0.01, viz.FOREVER)
__________________
--
[ e d h a l l e y ]
I'm just a user, not a representative of WorldViz. Hope I've been helpful.
Reply With Quote