#1
|
|||
|
|||
Coordinates for Zones
Hi All,
I am running an experiment where participants will see a number of vehicles move towards there viewpoint. With the help of Farshizzo (thanks), some gridlines then appear and I want the participant to click in the grid that they thought they saw objects approaching them. My questions are... 1) Is there any way of setting up "zones" that correspond with the gridlines? 2) How would I go about setting up a range of coordinates that indicate a particular response? Best wishes. Mark |
#2
|
|||
|
|||
OK so I managed to do this by inserting a number of buttons within the gridlines - does anyone know how to make them transparent?
Lastly, I need to allow the user to select up to five zones of action - is anyone able to tell me the command that will allow this? |
#3
|
|||
|
|||
You can disable viz.RENDERING on a node to prevent it from being displayed, but still allow it to be picked. Here is an example that splits the screen into 4 zones and prints out which zone was clicked when the mouse button is pressed. This should give you an idea of how to assign arbitrary zones to the screen.
Code:
import viz import vizact import vizshape viz.go() ZONE_POSITIONS = [ (0.25,0.25,0), (0.25,0.75,0), (0.75,0.75,0), (0.75,0.25,0) ] zones = [] for pos in ZONE_POSITIONS: z = vizshape.addQuad(size=(0.5,0.5),pos=pos,parent=viz.SCREEN) z.disable(viz.RENDERING) zones.append(z) def PickZone(): node = viz.pick(mode=viz.SCREEN) if node in zones: print 'picked zone',zones.index(node) vizact.onmousedown(viz.MOUSEBUTTON_LEFT,PickZone) |
#4
|
|||
|
|||
That's great thank you.
Do you know if there is a way of allowing the user to select multiple zones? So if there are vehicles moving in three of the zones, they can click each one in turn before the program progresses? Thanks again |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do coordinates in IS900 thransform into coordinates in vizard's world | jacky | Vizard | 1 | 08-11-2011 10:44 AM |
child-objects in VRML-file all have the same coordinates | Sven | Vizard | 4 | 06-09-2010 02:07 AM |
Dtrack and avatar -coordinates question | sircedric4 | Vizard | 3 | 09-08-2009 11:32 AM |
viz.vertex coordinates | lilio | Vizard | 6 | 05-16-2009 04:36 PM |
Locating the Coordinates of Vertices for on the fly objects | shivanangel | Vizard | 4 | 10-30-2006 08:28 PM |