WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-03-2009, 12: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
  #2  
Old 08-04-2009, 03:53 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #3  
Old 08-05-2009, 12:55 PM
yak yak is offline
Member
 
Join Date: May 2009
Posts: 22
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
Reply With Quote
  #4  
Old 08-10-2009, 03:01 PM
yak yak is offline
Member
 
Join Date: May 2009
Posts: 22
Quote:
Originally Posted by farshizzo View Post
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.
how do u link it to the bone if point isnt an object. I know how to link object to object but not a point or command to object..

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.
Reply With Quote
  #5  
Old 08-12-2009, 11:30 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
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.
Reply With Quote
  #6  
Old 08-16-2009, 12:04 PM
yak yak is offline
Member
 
Join Date: May 2009
Posts: 22
Quote:
Originally Posted by farshizzo View Post
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.
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.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 07:09 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC