# BVH File to HPB and ZYX

On 20/05/2014 at 02:07, xxxxxxxx wrote:

User Information:
Cinema 4D Version:
Platform:
Language(s) :

---------
Hi guys.

What is the process of converting ZXY coordinates (from BVH file) to Cinema's HPB or ZYX coordinates?
I extracted rotation matrices from BVH's ZXY Euler angles like this:

Rx(X) = | 1          0          0       |
| 0          cosX    +sinX |
| 0          -sinX     cosX |

Ry(Y) = | cos Y      0          -sinY |
| 0             1          0        |
|+sinY       0          cosY |

Rz(Z) = | cosZ     +sinZ     0 |
| -sinZ      cosZ     0 |
| 0           0           1 |

Then did matrix multiplication R = YXZ as explained in http://research.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html at the bottom.

Now what is the process to get back those XYZ values from this new R matrix? Iam trying to replicate same values Cinema produces, but in AE.

I have a Euler angles in BVH like this: Zrotation Xrotation Yrotation with respective values: -3.41, 14.78, -164,35

Cinema, upon importing BVH, converts them to X = 104,805; Y = 3,297; and Z = -165,221;

So I am looking for a way to replicate these values. Any ideas on what formulas should I use?

Thank you.