Motion capturing-need help

Hi all. I am new in Blender and I could really use some help. I have a school assignment that is due in three weeks and this is the only place I could go to. The idea was to record a movement and animate a 3d character in Blender, but the problem is I didn’t get a bvh file or any other mocap data file and instead I got two videos (we used only two cameras) of marker movement and two matlab programs to get the coordinates. So after I clicked on every marker in every frame of those videos I used the other matlab program to make a 3D reconstruction of markers. Now I have 3D position of those markers in every frame, but I don’t know how to use them in blender. Matlab coordinate system is different from the one in Blender and even when I rotate the coordinates for 270 degrees around x to get the same one I still have a problem because the markers are not positioned in the center as the 3d model in blender is. So basically the question is is there a way to use those coordinates so that the 3d model could still look like a mocap?

Hi there. Id say you should PM Monster right now. He is a beast of knowledge about blender. /u/Monster

Hi Teck-freak. Here is the blend [ATTACH]329083[/ATTACH]. The coordinates for the first frame are: neck(218,6546;646,5472;1042,931), shoulder(152,3302;484,8787;925,0684), elbow(171,6239;404,6734;740,059), forearm(274,2318;336,3158;618,8663), hand(387,805;322,9749;501,2169), thigh(152,2028;509,5508;360,2867), knee(163,8164; 565,85; 70,58), lower leg(132,5811;606,1528;-51,4542); ankle(166,29;595,34;-374,45).
These are the coordinates matlab gave, but in blender z is facing up so the coordinates are x=x, y=z, z=-y. [TABLE=“width: 64”]

[TABLE=“width: 64”]

[TABLE=“width: 500”]


Here is the blend Female.blend (833 KB). These are the coordinates for the first frame matlab gave after 3D reconstruction. In blender the values should be x=x, y=z, z=-y.
[TABLE=“width: 640”]

lower leg





Here is another idea. Can I upload those videos into Blender and make my 3D character follow the path?

there is a possibillity for that. you can do motion-capture in blender, unfortunatley I never did that. But there are some tutorials about that. litterally the first thing i found was this: . But if I shall do anything, Im going to need the videos as well (or is that Nasty stuff we are talking about:eyebrowlift2:?). And put up your data-output for all frames (e.g. exel-like spreadsheet).
Have you alreaddy texted with Monster? And rename the tread to sth like ‘Motion-Capturing, help needed’.

Of course if you have a little knowledge about python, there would be the programming-solution:

  1. add emptys for every Marker
  2. set constraints to the bones to copy the markers position and look at them
  3. for each frame do via python:
    1. fetch the coordinates
    2. move Emptys to that positions
    3. insert Keyframe LocRot

I’ll try to put sth together for that. Bonus would be that you’d basically have a new tool.:cool:

It seems like some one tried to use motion tracking to control an armature and it didn’t turn out so good, but that was awhile ago.

Haha no nasty stuff. Will upload everything today, thank you very much! I did text him, but he didn’t answer yet. Well as you might have guessed I don’t know anything about python, but I will take a look today. It seems to me that I’m the first to do this at my university because no one knows how to help me. They didn’t even know about bvh file…

Hi, I tried to rig sth.
may it be possible that you have some of the coordinates wrong?
well here is what i got. by the way: you schould have the coordinates and the blend-file not only in the same orientation but also in the same scale. anyway that would be the first step to a pythonic solution. tell me if you are interested, then I might do more( and clean up your armature) Best whishes, Teck-freak


test_of_mocaping_Female.blend (792 KB)

I’m sorry I forgot to mention the coordinates are in mm. And I was looking at the coordinate systems of matlab and blender and it seems to me that the blend should be oriented in x axis direction not -y, so rotation around z for 90 degrees in needed.

Here is the new answer from Monster.
i suggest as first step you create a set free floating bones. This are bones that are not parented to anything. This way you can place them at any position within armature space (origin = origin of the armature).

New you try to convert the xc,yc,zc values of the captured positions to the xb,yb,zb values of the according bone. A Blender script could do that for you. You might ask in the Blender script subforum for help. I recommend the Blender script because you do not need that in the bge itself. Do not forget to create a location key for each bone.

The result should be an action that moves the bones according to the captured data.

As second step you can create the character’s “real” bones. These are the bones that rotate. You can add some tracking constraints that let a bone track a free floating bone. This should result into rotations that match the captured data. The bone length will remain constant even, if the captured data is not very precise. With some well defined constraints you can prevent unnatural looking rotations. Good rigged armatures have such constraints.

With that you should be able to create an action that contains the rotational keys of the tracking bones.
These two steps allow you to skip the conversion from cartesian to polar coordinates, which can be tricky.

An alternative way is to directly convert from cartesion to the required polar coordinates. This is less work on the armature, but more work with the script.

I would try the first option first, as it allows a visual check if the captured positions are correct.

yap. Thats about what I created for you (with floating bones instead of emptys). Have you understood my .blend - file?
If not, feel free to ask. And could you kindly tell us the exact deadline?
Please upload some files(I cant find them) so I can try to work on them (or at least inform us about your progress).
Best whishes, Teck-freak

Quote: “Haha no nasty stuff” – {:expressionless: There I was hoping …