View Single Post
Old 08-25-2009, 12:26 PM
farshizzo farshizzo is offline
WorldViz Team Member
Join Date: Mar 2003
Posts: 2,849
It seems like you simply want to run some code every frame. In that case you can register a timer function, which will be called every frame. Here is an example that plays a sound when the Z position of the view passes 3 meters:
import viz


def CheckView():
	"""Plays a sound when Z position of view is greater than 3"""
	x,y,z = viz.MainView.getPosition()
	if z > 3:
		# Play sound and unregister timer function
		return vizact.EventRemove
Reply With Quote