![]() |
|
|
|
#1
|
|||
|
|||
|
Need help with bone mapping
Hi Vizard community,
I am new to python and especially Vizard and created a bone mapping script for research in a student project at university. However I have a problem: My arms move up, when I move them down and vice versa. The following snippet is what I think causes the problem, but I cannot figure out the correct Eulers: Code:
kinectToCharacter = { 'Bip01 L UpperArm':(leftShoulder, [0, 90, 0]), \
'Bip01 L Forearm':(leftElbow, [0, 90, 0]), \
'Bip01 R UpperArm':(rightShoulder, [0, -90, 180]), \
'Bip01 R Forearm':(rightElbow, [0, -90, 180]), \
'Bip01 L Thigh':(leftHip, [90, 0, -90]), \
'Bip01 L Calf':(leftKnee, [90, 0, -90]), \
'Bip01 R Thigh':(rightHip, [90, 0, -90]), \
'Bip01 R Calf':(rightKnee, [90, 0, -90]), \
'Bip01':(waist, [0, 90, -90]) \
}
bones = {}
for boneName in kinectToCharacter:
b = avatar.getBone(boneName)
b.lock()
bones[b] = kinectToCharacter[boneName]
def animate():
for bone in bones:
kinectTracker = bones[bone][0]
euler = kinectTracker.getEuler()
m = vizmat.Transform()
m.setEuler(euler)
m.preEuler(bones[bone][1])
bone.setEuler(m.getEuler(), viz.ABS_PARENT)
Interesting fact that might help solving my problem: If I exchange the arms they move correctly up and down, but are obviously on the wrong side of the avatar. To any mods/admins: I did not know where to put this, so if this thread is in the wrong place please contact me to clarify any issues. |
|
#2
|
|||
|
|||
|
Moving an avatar with tracking data is usually done with inverse kinematics. The next version of the Vizard 5 Beta will include a basic avatar IK library. Vizconnect, also included in the next Beta, will have a visual interface for using this IK and mapping trackers to avatar points. Currently the library works with up to 6 points; head, waist, hands, and feet. The result will be sufficient for many users needs.
|
|
#3
|
|||
|
|||
|
Hi Jeff,
Thanks for the fast reply! Can you tell me when the next Beta will be made available or point me to the information? I am really keen on getting more information about the IK library! Please tell your team that you are doing an amazing job ![]() Best regards |
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tracking when foot bone makes contact with x plane | NicoleVR | Vizard | 2 | 11-20-2013 10:13 AM |
| Problems with getting head bone rotation right | Enlil | Vizard | 2 | 02-13-2009 11:24 AM |
| 3D Texture Mapping - gluBuild3DMipmaps not supported | stefs | Vizard | 1 | 04-23-2008 12:00 PM |
| mapping method | FlyingFish | Vizard | 1 | 07-12-2007 10:06 AM |
| avatar bone movement | epl | Vizard | 3 | 05-03-2004 05:27 PM |