![]() |
#1
|
|||
|
|||
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)) Hope that makes sense! Any help is GREATLY appreciated! Thanks.. |
Thread Tools | |
Display Modes | Rate This Thread |
|
|
![]() |
||||
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 |