WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1  
Old 06-22-2008, 09:34 AM
dan12345 dan12345 is offline
Member
 
Join Date: Jan 2008
Posts: 58
changing between avatar states

Hi, i have two problems i have bumped into :

1. i want the avatar to change between one state to another, wait a few seconds, and then return to its original state. how can this be done?

avatar.state(newState)
wait = vizact.waittime(3)
avatar.addAction(wait)
avatar.state(oldNum

did not work.

2. another problem i have, that the 2 state differ in the orientation - one of the states is facing forward and the other is facing backwards. to solve this
, i tried rotating the avatar just before changing the states, but this caused
an animation bug - since now it actually rotates BEFORE the animation swapping takes place, which is not the result i had wanted ( to make things clear, what happens now is that the avatar first rotates instantly around, and then makes a strange twirl in order to face the right direction ). How can i solve this?

Thanks!
Reply With Quote
  #2  
Old 06-23-2008, 01:39 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
1) The easiest method would be to use a task. Here is some sample code:
Code:
import viz
viz.go()

avatar = viz.add('vcc_female.cfg',pos=(0,0,5),euler=(180,0,0))

import viztask

def AvatarTask():
	
	avatar.state(2)
	
	yield viztask.waitTime(3)
	
	avatar.state(3)

viztask.schedule(AvatarTask)
2) Ideally, all your animations should start and stop facing the same direction. By default, when you transition between animation states, the avatar will blend between the current pose and the new animation pose. The quick turn you see is due to this blending. There is an optional delay parameter in the avatar.state command which controls how long the blending should take place. Try setting it to 0, it should remove the blending.
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
Collision of an avatar with a quad Frank Verberne Vizard 8 06-04-2008 09:44 AM
Looking through the eyes of an avatar Frank Verberne Vizard 2 04-01-2008 05:52 AM
How to make avatar's eyes to blink when speaking michelcm3 Vizard 12 01-15-2008 08:48 AM
avatar neck too short aa-chris Vizard 2 10-16-2007 09:28 AM
Avatars in an array and link/unlink betancourtb82 Vizard 7 09-05-2006 04:06 PM


All times are GMT -7. The time now is 06:12 AM.


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