WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 03-26-2009, 06:32 AM
Enlil Enlil is offline
Join Date: May 2008
Posts: 61
Smooth transitions back to animations when unlocking bones


I am locking the head bone to have an avatar look at an object, but I have run into an issue - when I unlock the bone, the head immediately jumps to an animation position, with no smooth transition. Is there some parameter or function I should be calling to get a smooth transition back into the animation when unlocking a locked bone?

Reply With Quote
Old 03-26-2009, 01:12 PM
Jeff Jeff is offline
WorldViz Team Member
Join Date: Aug 2008
Posts: 2,471
If you find out the head orientation at the start of the animation cycle, for example, then when you want the avatar to stop looking at an object, use vizact.headto to smoothly move the head to the starting position. Once its reached that position wait until the start of the next cycle and unlock it.
Reply With Quote
Old 04-01-2009, 07:44 AM
Enlil Enlil is offline
Join Date: May 2008
Posts: 61

Is there a good way to find the head orientation at the start of an animation cycle?

Reply With Quote
Old 04-01-2009, 07:24 PM
Gladsomebeast Gladsomebeast is offline
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
To find out what orientation the animation has the head at unlock the bone, then call bone.getEuler(), then lock the bone again.

Also, I think it might be a bit more complicated than getting the bone orientation then calling vizact.headto(). This is because the head orientation will have changed by the time the headto action is done.

You could manually blend the head back. The vizmat.interpolate fuction will come in handy. It could go something like the following fake code:

while not isDone:
    currentEuler = bone.getEuler()
    targetEuler = bone.getEuler()
    eulerBlendy = vizmat.interpolate(currentEuler, targetEuler, percentDone)
Paul Elliott
WorldViz LLC
Reply With Quote

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

All times are GMT -7. The time now is 09:52 AM.

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