WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-22-2016, 03:02 PM
fivel_lab fivel_lab is offline
Member
 
Join Date: Mar 2011
Posts: 36
timing on a sequence of actions

Hi!
I am trying to animate an avatar using boneSpinTo driven by data coming in from FAAST. I've got this part working.

What I'd like to do now is to scale the speed with which the avatar's bones spin to the current state of the tracking data. So, if the left arm of the person being tracked moves 30cm/sec, then the left arm of the avatar would move k*30cm/sec (until the avatar's left arm was at the rotation that the tracked person's arm was at).

To do this I thought I'd use a sequence of actions, each of which covers a fraction of the total spin necessary to align the avatar and the tracking data:

Code:
for bone in myBones:
#find out where the bone needs to go
   targetEuler = trackerBones[bone].getEuler() 
#find where the bone was the last time it was moved
   tempEuler = bonesWereHere[bone]

   spinSequence = [];
   while True:
      #find discrepancy between where bone is and target
      diff = [x-y for x,y in izip(targetEuler, tempEuler)]
      #find amount by which to move bone towards target
      delta = [x*k for x in diff]  # k is a scaling factor < 1.0

      if delta != [0,0,0]:
         tempEuler = [sum(x) for x in izip(tempEuler, delta)]
      else:
         tempEuler = targetEuler
         break

      #make an action to spin the bone by the amount specified in delta
      spinIt = vizact.boneSpinTo(bone, mode = viz.ABS_GLOBAL, euler = tempEuler)
      spinSequence.append(spinIt)

   #now that all intermediate actions have been added, execute the sequence
   myAvatar.runAction(vizact.sequence(spinSequence))
However, this method doesn't seem to slow things down very much, unless the k is REALLY small (or maybe i'm just not noticing how much it is slowing down). I'm wondering how long each action in a sequence of actions takes to execute, and if vizard interpolates between a chain of related actions in a sequence to cut down on processing? If it does, is there a way to ensure that each action takes, say, at least 1 frame to execute before the sequence moves on to the next action?

Hope that makes sense! Any help is GREATLY appreciated!
Thanks..
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble Exporting OSGB Animations via Sequence Helper (3Ds Max) envi253 Vizard 1 06-05-2015 11:31 AM
osg Sequence TarkaDahl Vizard 4 09-01-2011 01:45 AM
how to freeze sequence of actions dwaik Vizard 1 04-05-2010 01:26 PM
stopping a sequence durf Vizard 1 04-14-2009 01:31 PM
Weird lagging/choppiness when avatars perform actions vjonshih Vizard 8 11-30-2004 04:08 PM


All times are GMT -7. The time now is 06:17 PM.


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