WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 08-25-2009, 11:38 AM
vissimutah vissimutah is offline
Join Date: Aug 2009
Posts: 2
Distance or position based event?

We're trying to play a sound when the viewpoint reaches a certain point in the virtual environment. Do we have to register a custom event to do this? Is there a way to use a loop without freezing the program?
Reply With Quote
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
writing joystick position to a data file Saz Vizard 3 12-17-2008 05:18 AM
default start position erchrastil Vizard 2 06-23-2008 08:15 AM
position of html-file on screen active_world Vizard 1 05-16-2008 07:24 PM
Avatar always returns in initial position pattie Vizard 2 08-31-2006 08:15 PM
Get position data in an own little program Researcher Precision Position Tracker (PPT) 2 02-01-2006 02:55 AM

All times are GMT -7. The time now is 08:26 AM.

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