WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

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

Hello,

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?

Thanks,
Christian
Reply With Quote
  #2  
Old 03-26-2009, 02: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
  #3  
Old 04-01-2009, 08:44 AM
Enlil Enlil is offline
Member
 
Join Date: May 2008
Posts: 61
Thanks.

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

Christian
Reply With Quote
  #4  
Old 04-01-2009, 08:24 PM
Gladsomebeast Gladsomebeast is offline
Member
 
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:

Code:
while not isDone:
    currentEuler = bone.getEuler()
    bone.unlock()
    targetEuler = bone.getEuler()
    bone.lock()
    eulerBlendy = vizmat.interpolate(currentEuler, targetEuler, percentDone)
    bone.setEuler(eulerBlendy)
__________________
Paul Elliott
WorldViz LLC
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


All times are GMT -7. The time now is 02:21 AM.


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