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.