View Single Post
  #2  
Old 06-02-2005, 04:50 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Here is a sample script that should help you out:
Code:
import viz
viz.go()

male = viz.add('male.cfg')

head = male.getbone('skel_Head')
head.lock()

dummy = viz.add(viz.GROUP)

ball = viz.add('white_ball.wrl')
ball.spin(0,1,0,45)
ball.translate(2,0,0)
ball.center(-2,0,0)

def ontimer(num):
	dummy.translate(head.get(viz.POSITION,viz.ABSOLUTE_WORLD))
	dummy.lookat(ball.get(viz.POSITION,viz.ABSOLUTE_WORLD))
	head.rotatequat(dummy.get(viz.QUAT), viz.ABSOLUTE_WORLD)

viz.callback(viz.TIMER_EVENT,ontimer)
viz.starttimer(0,0,viz.FOREVER)
I'll add the lookat command for bones in the next release.

You're two for two today. Are there any other features you want me to add to the next release?
Reply With Quote