View Single Post
  #4  
Old 06-13-2013, 10:33 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Perhaps you can add a cube that is sized to match where the marks are placed. Then you can get which face of the cube and position of the cube using viz.pick. You could then perform some calculations to normalize the pick location to match texture coordinates. In the following example the cube is not visible because the viewpoint is inside it and back faces are not rendered by default:

Code:
import viz
import vizshape
import vizact

viz.go()

env = viz.addEnvironmentMap('sky.jpg')
sky = viz.addCustomNode('skydome.dlc')
sky.texture(env)

vizshape.addGrid()

cube = vizshape.addCube(size=80,splitFaces=True)

def getPickInfo():
	info = viz.pick(info=True)
	print 'name',info.name
	print 'point',info.point
	
vizact.onmousedown(viz.MOUSEBUTTON_LEFT,getPickInfo)
Reply With Quote