View Single Post
  #2  
Old 01-12-2016, 02:51 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The command returns a point in global coordinates but you could convert this into local coordinates of the object that is picked:

Code:
import viz
import vizact
viz.go()

viz.addChild('piazza.osgb')
ball = viz.addChild('beachball.osgb',pos=[0,1.5,3])

def updatePick():
	info = viz.pick(info=True)
	if info.object == ball:
		print 'global',info.point
		helper = viz.addGroup(parent=ball)
		helper.setPosition(info.point, viz.ABS_GLOBAL)
		print 'local',helper.getPosition() #mode defaults to viz.ABS_PARENT
		
vizact.ontimer(1,updatePick)
Reply With Quote