WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 11-02-2016, 01:33 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Here's an example that performs the pick command on the center of the window:

Code:
import viz
import vizact

viz.go()

viz.clearcolor(viz.SLATE)

soccerball = viz.addChild('soccerball.osgb',pos=[-1,1.8,2])
basketball = viz.addChild('basketball.osgb',pos=[0,1.8,2])
volleyball = viz.addChild('volleyball.osgb',pos=[1,1.8,2])

crosshair = viz.addTexQuad(parent=viz.SCREEN,texture=viz.add('crosshair.png'),pos=[0.5,0.5,0])

def pickObject():
	node = viz.pick(pos=[0.5,0.5])
	if node == soccerball:
		print 'soccerball'
	elif node == basketball:
		print 'basketball'
	elif node == volleyball:
		print 'volleyball'
	else:
		print 'none'
	
vizact.onupdate(0,pickObject)
Also, the gazetime example script in this thread maybe helpful.
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
Regarding Viconnect viewpoint rajnishv Precision Position Tracker (PPT) 3 03-20-2017 11:03 PM
Regarding viewpoint with vizconfig,addFloatRangeItem&Storing viewpoint in PREFERENCES rajnishv Vizard 0 06-27-2016 03:57 AM
Draw Vector in viewpoint lookat direction Chrissy2009 Vizard 2 05-30-2009 12:50 AM
VRML Viewpoint error bstankie Vizard 1 03-11-2003 02:10 PM


All times are GMT -7. The time now is 02:16 PM.


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