WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 11-18-2013, 01:56 PM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
Hi Maya,

Sounds like you can use a proximity sensor. If you set your sphere as the source of the sensor in the example below, you can do something when someone enters the area (or leaves the area). See http://docs.worldviz.com/vizard/vizproximity.htm for more info.
Code:
import viz
import vizproximity

viz.go()
male = viz.addAvatar('vcc_male2.cfg', pos = [0,.15,.5], euler = [180,0,0])

#Create proximity manager 
manager = vizproximity.Manager()

#Create target and add to manager
target = vizproximity.Target(viz.MainView)
manager.addTarget(target)

#Create sensor and add to manager
sensor = vizproximity.Sensor( vizproximity.CircleArea(1),source=male)
manager.addSensor(sensor)

def EnterProximity(e):
    """@args vizproximity.ProximityEvent()"""
    print 'entered',e.sensor

def ExitProximity(e):
    """@args vizproximity.ProximityEvent()"""
    print 'exited',e.sensor

manager.onEnter(None,EnterProximity)
manager.onExit(None,ExitProximity)
Reply With Quote
 


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
input from a text file dig Vizard 5 10-20-2013 01:20 AM
Lighting relevant text? knightgba Vizard 1 01-26-2011 05:33 PM
Informationboxes with text snoopy78 Vizard 3 07-16-2009 10:23 AM
Vizard tech tip: Text to Speech Jeff Vizard 1 01-15-2009 09:39 PM
3d Text with Transparent Borders vjosh Vizard 3 12-01-2004 10:50 AM


All times are GMT -7. The time now is 12:48 AM.


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