WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-18-2011, 06:07 AM
new_horizon new_horizon is offline
Member
 
Join Date: Apr 2010
Posts: 43
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
Reply With Quote
  #2  
Old 08-18-2011, 08:03 AM
new_horizon new_horizon is offline
Member
 
Join Date: Apr 2010
Posts: 43
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?
Reply With Quote
  #3  
Old 08-18-2011, 08:58 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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)
Reply With Quote
  #4  
Old 08-18-2011, 09:03 AM
new_horizon new_horizon is offline
Member
 
Join Date: Apr 2010
Posts: 43
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
Reply With Quote
Reply

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
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


All times are GMT -7. The time now is 05:47 PM.


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