WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-13-2009, 10:45 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You should be able to use the bone.lookat command to have the head face a certain position. Here is a sample script:
Code:
import viz
import vizact
viz.go()

viz.add('tut_ground.wrl')

#Create animating ball
ball = viz.add('white_ball.wrl')
ball.add(vizact.sequence(vizact.goto(-2,1,0),vizact.goto(2,1,0),viz.FOREVER))

#Create male avatar
avatar1 = viz.add('vcc_male.cfg',pos=(-2,0,3),euler=(180,0,0))
avatar1.state(1)
head1 = avatar1.getBone('Bip01 Head')
head1.lock()

#Create female avatar
avatar2 = viz.add('vcc_female.cfg',pos=(2,0,3),euler=(180,0,0))
avatar2.state(1)
head2 = avatar2.getBone('Bip01 Head')
head2.lock()

def UpdateAvatarHead():
	"""Update avatars to look at ball position"""
	pos = ball.getPosition()
	
	head1.lookat(pos,0,viz.AVATAR_WORLD)
	head2.lookat(pos,0,viz.AVATAR_WORLD)

vizact.ontimer(0,UpdateAvatarHead)

viz.MainView.move(0,0,-5)
Reply With Quote
 


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
Linking problems with Live Character Frank Verberne Vizard 5 06-04-2008 12:42 PM
Texturing Avatar head problems S.Telemaque Vizard 0 04-01-2007 11:01 PM
Problems Texturing avatar head S.Telemaque Vizard 3 03-27-2007 08:18 PM
problems adding a custom morph head to a custom body Greenwu Vizard 1 07-27-2006 11:32 AM
tracking head rotation orientation VAmanda Vizard 3 09-21-2005 05:57 PM


All times are GMT -7. The time now is 05:57 PM.


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