PDA

View Full Version : vcc avatars: defining bone length


bjgold
08-07-2007, 02:45 PM
I'm new to the world of full character avatars, and as such I'm playing with the vcc_ avatars because they afford us the bones like in our Measurand motion capture system.

However, as the people wearing the system are different sizes, we need to set the bone lengths (especially the arms) for each person. Is there a way to do this in Vizard? Thanks to the forum, I can find the length of the upper and lower arms, using


pos1 = leftShoulder.getPosition(viz.ABSOLUTE_WORLD)
pos2 = upperLeftArm.getPosition(viz.ABSOLUTE_WORLD)
length = vizmat.Distance(pos1,pos2)
print 'distance between left shoulder and elbow, ', length

However, the distance seems to vary depending on the movement of the sensors, and thus must be some sort of relative distance, where we need an absolute distance.

mspusch
08-08-2007, 11:24 AM
Sounds like you want to get the distance from a bone is from its parent bone. Get this distance by calling getPosition with the defualt arguemnt: viz.REL_PARENT.

You can set the bones position offset from its parent bone by calling the setPosition command. You can also pass the optional argument viz.ABS_GLOBAL to the setPosition command to set the bone in world corrdinates.