WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 11:21 AM.


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