#1
|
|||
|
|||
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() ) |
#2
|
|||
|
|||
You want the point to deform with the avatar mesh? If so, this is not currently possible. You can link the point to one of the avatars bones, but there is no way to get the associated bones from an intersection test.
|
#3
|
|||
|
|||
I want the point to stick to the avatar so if hes walking the point is still on him.. i can only link objects i dont know how to link an object with a point....
thanks you for ur help |
#4
|
|||
|
|||
Quote:
Code:
import viz import viztask viz.go() bone = viz.add('vcc_male.cfg', alpha= 0.8) bones = bone.getbone('Bip01 L Thigh') 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.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)) link = viz.link(point.Vertex(1),bones) link.preTrans( [0.03,-0.42,0.016] ) link.preEuler( [-20,0,0] ) #Wait for mouse button to be released yield viztask.waitMouseUp(viz.MOUSEBUTTON_LEFT) #Destroy link VertexLink.remove() viztask.schedule( DrawLineTask() ) viz.mouse(viz.ON) Last edited by yak; 08-10-2009 at 03:07 PM. |
#5
|
|||
|
|||
Search the docs for "linkbones". There should be an example script that links a node to an avatar bone. However, as I already mentioned, there is currently no way to get a bone object from an intersection hit with an avatar.
|
#6
|
|||
|
|||
I dont think a point can be linked......because it isnt really an object. is its for example a .wrl or .3ds or .cgf so i cant really figure out how to link them together.
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sensor linking question | smith11235 | Vizard | 6 | 05-31-2011 04:58 PM |
linking view to avatar | 5ky1ine | Vizard | 7 | 04-21-2009 11:03 AM |
Linking problems with Live Character | Frank Verberne | Vizard | 5 | 06-04-2008 11:42 AM |
Body linking | nige777 | Vizard | 3 | 03-06-2008 02:17 PM |
Linking avatar 'bones' to a position tracker. | zachhendershot | Vizard | 3 | 11-19-2003 09:26 PM |