About BVH
miooooooooooo opened this issue · 1 comments
Can you share the code about converting 3D coordinate of hand to .bvh file.
All files can be viewed within GitHub, its Open Source.
Take a look at
Lines 172 to 205 in 9743e40
Especially the case where we use the basis from the first frame for all ongoing angle calculations
Lines 184 to 186 in 9743e40
We calculate the rotation matrices between a selected bone and its parent bone. The skeleton is defined here:
RoSeMotion/app/config/Skeleton.py
Lines 11 to 38 in 9743e40
To give an example: The root's basis is the identity matrix. The difference between the identity matrix and the forearm basis is the forearm basis itself.
If you look at the code, we have basis
and parent_basis
. basis
is defined by the forearm basis, parent_basis
is defined by root (identity). The difference is calculated by matrix multiplication: basis * parent_basis'
The '
stands for transposing the matrices.
In case of the hand palm, the parent_basis
is the one from the forearm and the basis
is defined by the palm's basis. And so on.
We calculate the rotation matrices dependent from the first recorded basis (extracted from the first recorded frame). That is why the calculation looks as follows:
rotation = (initial_basis * basis') * (parent_initial_basis, parent_basis')'
The angles required for the BVH file are calculated from the rotation matrices (euler angles).
Let me know if this helps you and what requires more explanation. I would kindly inform you that this is part of a hopefully soon to be published publication (Open Access), although we just started the peer review (so no guarantee).