WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-08-2005, 11:19 AM
Adam Adam is offline
Member
 
Join Date: Apr 2005
Posts: 13
Nested Hotspots. Is it possible?

Hi All,

I was wondering if it was possible to have nested hotspots? (as the title of the thread indicates)

My plan was to create a zone of safe travel in the lab that would monitor a users position, and give them a warning when they exit the safe zone (which would be specified by a rectangle hotspot out).

Additionally, I wanted to make use of a circular hotspot, within that safe zone of travel. Is this possible?

I have had no luck as of yet getting both to work in conjunction. I realize I could achieve the same effect with if statements inside a timer that checks current position against the boundaries of the safe zone, but this is not a very elegant solution.

I really just need to get this to work however, and will resort to any means necessary to carry off the desired effect.

The code I have tried so far is as follows: (pardon the formatting)

import viz
viz.go()

SAFE = 1
UNSAFE = 2
TARGET = 3

viz.clearcolor(1,1,1)

def handlemyhotspots(id,x,y,z):

if id == SAFE:
print 'inside safe zone'
viz.clearcolor(1,1,1)
viz.starthotspot(UNSAFE,viz.RECTANGLE_HOTSPOT_OUT, 0,3,2.4,6)

elif id == UNSAFE:
print 'outside safe zone'
viz.clearcolor(0,0,0)
viz.starthotspot(SAFE,viz.RECTANGLE_HOTSPOT_IN,0,3 ,2.4,6)

elif id == TARGET:
print 'at target'

viz.callback(viz.HOTSPOT_EVENT, handlemyhotspots)

viz.starthotspot(UNSAFE,viz.RECTANGLE_HOTSPOT_OUT, 0,3,2.4,6)
viz.starthotspot(TARGET,viz.CIRCLE_HOTSPOT_IN,0,3, .5)

I would appreciate any assistance you can provide with regard to my question.

Adam
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 09:00 PM.


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