WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 03-14-2005, 02:03 AM
exhale exhale is offline
Member
 
Join Date: Feb 2005
Posts: 19
Hello,

thanks for your help, but i can't get it to trigger..
The text in the if statements isn't printed, so i guess it's never reached. I only changed the X, Z values of your script so it was surrounding my object. I'll post an excerpt of the code:

#hotspot IDs
ENTER = 0
LEAVE = 1

#Radius of hotspot
RADIUS = 5

#position of hotspot
HOTSPOT_X = 30
HOTSPOT_Z = 17.5

tbox = viz.add('tbox_paars.wrl')
tbox.translate(30,0,17.5)

tbox2 = viz.add('tbox_rood.wrl')
tbox2.translate(30,0,17.5)
tbox2.visible(viz.OFF)

def onhotspot(id,x,y,z):
if id == ENTER:
print 'Entered hotspot'
tbox.visible(viz.TOGGLE)
tbox2.visible(viz.TOGGLE)
#Create a hotspot that will be triggered when we leave the circle
viz.starthotspot(LEAVE,viz.CIRCLE_HOTSPOT_OUT,HOTS POT_X,HOTSPOT_Z,RADIUS)

elif id == LEAVE:
print 'Leaving hotspot'
tbox.visible(viz.TOGGLE)
tbox2.visible(viz.TOGGLE)
#Create a hotspot that will be triggered when we enter the circle
viz.starthotspot(ENTER,viz.CIRCLE_HOTSPOT_IN,HOTSP OT_X,HOTSPOT_Z,RADIUS)

#hotspot -> onhotspot
viz.callback(viz.HOTSPOT_EVENT,onhotspot)
#Create a hotspot that will be triggered when we enter the circle
viz.starthotspot(ENTER,viz.CIRCLE_HOTSPOT_IN,HOTSP OT_X,HOTSPOT_Z,RADIUS)

ps: Code is indented correctly in the editor

any ideas why this isn't working?

EDIT: i also tried leaving out the if statements and doing the visible toggling straight away, which didn't work either. The method is never entered. I also tried with a rectangle, put collision on or off, which didn't give me any success..

greets and thanks in advance!

Kevin

Last edited by exhale; 03-14-2005 at 02:17 AM.
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


All times are GMT -7. The time now is 10:51 PM.


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