-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: what do "world rotations" mean in the project? #5
Comments
Thank you for your feedback and for checking out the project! :) The As I understand for BVH files:
The BVH implementation is based on the following document: https://research.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH However, I may be missing something, if you could provide the outcome of the expected behavior. If you have any further questions or need more clarifications, feel free to ask! |
Yeah I should have provided the behavior that I would expect.
But lets look at the values of tensor([[[0., 0., 0.],
[0., 0., 1.]]]) They are non-zero. Actually result of To further make my point, in Blender we can get a world matrix of the second bone by running: import bpy
arm_ob = bpy.data.objects["test"]
print(arm_ob.pose.bones[1].matrix)
<Matrix 4x4 (0.5000, -0.7071, 0.5000, 0.0000)
(0.7071, 0.0000, -0.7071, 0.0000)
(0.5000, 0.7071, 0.5000, 1.0000)
(0.0000, 0.0000, 0.0000, 1.0000)> The position part matches the behavior of PyMotion. But the rotation part does not. That's how I understand world rotations too because even bones are in their rest pose without any further rotations, their world rotations may not be zero. |
Thank you for the detailed explanation! Now I understand the problem better. In my understanding, it is a problem of conventions, which I did not realize before because right now, we only support the BVH file format. The BVH file does not explicitly declare the initial orientation of each bone, this should be automatically computed. For example, assuming a primary axis having the direction of the parent-child vector, and then assuming some second axis. From this, an initial rotation is computed, which I believe is what Blender is doing under the hood. The problem is that all this assumes a lot, since the base orientation is not explicitly declared in the BVH files. For now, PyMotion does not assume any of this, and the base orientation is equal to the identity orientation. It all depends on what we consider our initial bone orientation. I understand this may yield counterintuitive results, such as that some bones may have the parent-child vector aligned with, e.g., the Y-world axis, others with the X-world axis, or any vector in general. I've been reading about it, and I think it may be desirable to align the parent-child direction of all bones with a single world axis, such as the Y-axis. This will help with the interpretation of I will write all this down in my roadmap and think of a flexible way to integrate it with the project for all use cases. Hopefully I can work on it soon! :) I will leave this issue open and come back to it once I find a solution. I leave this here for future reference: https://staffwww.dcs.shef.ac.uk/people/S.Maddock/publications/Motion%20Capture%20File%20Formats%20Explained.pdf Thank you for pointing out this issue! |
First of all, amazing project! Thank you for sharing this valuable work.
I am a little confused, though, about "Compute world positions and rotations from a BVH file" part in the README.
Given a simple bvh
test.bvh
with an all-zero keyframe but non-zero offsets:Following code
gives
rotmats
of valuewhich indicates "world rotations" are all zero. So if I'm understanding it correctly
rotmats
is pre-offsets (a.k.a. without applying the rest pose). Is this expected behavior?The text was updated successfully, but these errors were encountered: