How to Convert 3D Positions into a BVH File
I need to convert a sequence of 3D positions of human joints (mocap data) into a BVH file that can be loaded into blender.
The data I have is a numpy array of size TxJx3, where T is the number of frames, J is the number of joints (21 in my case), and 3 represents the 3 co-ordinate values. I have managed to visualize the sequence using python, as I have shown in this video.
import numpy as np
# TxJx3 numpy array
mocap_data = np.array([[[x1, y1, z1], [x2, y2, z2], ..., [x21, y21, z21]],
[[x1, y1, z1], [x2, y2, z2], ..., [x21, y21, z21]],
...,
[[x1, y1, z1], [x2, y2, z2], ..., [x21, y21, z21]]])
My question is, how can I convert these 3D positions into a BVH file, that I can load into blender? Or convert them to any other format so that I can load these data in blender?