# Calculate face direction from bvh or 3d skeleton data

This topic is 2028 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,

i have a 3d skeleton with Head joint  and neck joint , and i want to caculate where the face is looking at. Face direction vector.

Any ideas?

thanks

##### Share on other sites

What's the difficulty? You have the vector in the frame of reference of the head, so you can map it to world coordinates using the same model-to-world matrix that you use for rendering. Since you are converting a vector, not a point, use a 0' as the fourth coordinate.

##### Share on other sites

I have Rx=-13, Ry=-3, Rz=4 for the rotations of the head in local cordinates.

Do you mean that i should calculate the transformation matrixes for all axes and multiply them to create R=Rx*Ry*Rz and take the 3rd column of matrix R?

Thanks

##### Share on other sites

You should do whatever it is you are doing to place the head in the world. This is probably representable as a 4x4 matrix. Now take the forward-looking vector in the head's model, append a 0' to it and apply the matrix to it.

If your rotation for the head is expressed as a composition of rotations around coordinate axes then sure, do what you describe. But if that fails it doesn't mean I gave you bad advice: It means you don't know how you are transforming your model.

1. 1
2. 2
Rutin
19
3. 3
khawk
15
4. 4
5. 5
A4L
13

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633743
• Total Posts
3013645
×