View Single Post
  #2  
Old 03-03-2009, 12:59 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
you could use viz.intersect and have your line start just below the ball and then go straight down far enough to cross the plane the block is in. If an intersection happens then you reset the position of the block. Something like this.

Code:
def moveBlock():
	
	x,y,z = ball.getPosition()
	info = viz.intersect([x,y-1,z],[x,y-5,z])
	if info.valid:
		info.object.setPosition([0,-10,0], viz.REL_LOCAL)
	
vizact.ontimer(0,moveBlock)
Reply With Quote