Thread: linking
View Single Post
  #1  
Old 08-03-2009, 01:30 PM
yak yak is offline
Member
 
Join Date: May 2009
Posts: 22
linking

Code:
import viz
import viztask
viz.go()




def DrawLineTask():
	
	while True:
		
		#Wait for left mouse butten to be pressed
		yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
		
		#Get mouse position
		pos = viz.mouse.getPosition()
		
		#Create line
		viz.startlayer(viz.POINTS)
		viz.vertexcolor(viz.RED)
		viz.alpha(3)
		
	
		viz.vertex(pos[0],pos[1],0)
		viz.vertex(pos[0],pos[1],0)
		viz.ABS_PARENT
		point = viz.endlayer(parent=viz.SCREEN)
		#Create link between mouse position and vertex
		VertexLink = viz.link(viz.Mouse,point.Vertex(1))
		
		#Wait for mouse button to be released
		yield viztask.waitMouseUp(viz.MOUSEBUTTON_LEFT)
		
		#Destroy link
		VertexLink.remove()
		
viztask.schedule( DrawLineTask() )
this code is for drawing points on a 3d model, mainly the male avatar. what I am stuck with is trying to link it to the male while he is animated so after i draw on him it is linked to him even after another action in demonstrated such as walking or picking something up.
Reply With Quote