-
Notifications
You must be signed in to change notification settings - Fork 57
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
About quaternion to euler rotation #2
Comments
Hi,
I’m not familiar with Python, so I can not help with your question.
Art
… 在 2018年8月13日,下午3:51,catidog ***@***.***> 写道:
hello, thx for your code, i'm doing something just similar with your project. I have encountered some problems that need your help.
I have each joint quaternion and location data and i need to get the CHANNEL of BVH file.
I found that the HIERARCHY of BVH file i download from website are all the same,so i just copy HIERARCHY part and write MOTION data.
I did the following things with Pyrhon:
1.calculate relative quaternion between current joint and parent joint
q_relative = q_current * inverse(q_parent)
2.calculate euler rotation ZXY(my BVH file all the CHANNEL is Z-X-Y rotation)
'''
y1 = 2*(orientationXorientationY - orientationWorientationZ)
y2 = orientationWorientationW - orientationXorientationX + orientationY+orientationY - orientationZ*orientationZ
x = 2*(orientationY*orientationZ + orientationW*orientationX)
x = +1 if x > +1 else x
x = -1 if x < -1 else x
z1 = 2*(orientationX*orientationZ - orientationW*orientationY)
z2 = orientationW*orientationW - orientationX*orientationX - orientationY+orientationY + orientationZ*orientationZ
rotationZ = math.degrees(math.atan2(z1, z2))
rotationX = math.degrees(math.asin(x))
rotationY = math.degrees(math.atan2(y1, y2))
euler_rotation = [rotationZ, rotationX, rotationY]
'''
After the visualization, the movement is wrong.
This problem has been bothering me for a long time, I need your help.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#2>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ANM5wxrYFeTBZpVAf3ooK-ycVMYsB6ZKks5uQTAVgaJpZM4V6CcV>.
|
Hi, did you manage to solve this? |
I just realized that you can read the source code of the BVH importer of Blender, if you have confirmed that your code is right, there is another thing you may forget to setup, you need to setup the rotation mode for each joint from 'Quaternion(WXYZ)' to 'ZXY Euler’ in pose mode.
… 在 2019年1月23日,上午12:44,Carlos Cabada ***@***.***> 写道:
Hi, did you manage to solve this?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#2 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ANM5w-QIFvJQ849RAO0SXNCWUPrKA6cGks5vFz_mgaJpZM4V6CcV>.
|
I need to do everything in real-time, not over recorded files. I'm doing a virtual character control but the rotations seem to be so wrongly done. This is what I'm facing: Stack Overflow Question |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello, thx for your code, i'm doing something just similar with your project. I have encountered some problems that need your help.
I have each joint quaternion and location data and i need to get the CHANNEL of BVH file.
I found that the HIERARCHY of BVH file i download from website are all the same,so i just copy HIERARCHY part and write MOTION data.
I did the following things with Pyrhon:
1.calculate relative quaternion between current joint and parent joint
q_relative = q_current * inverse(q_parent)
2.calculate euler rotation ZXY(my BVH file all the CHANNEL is Z-X-Y rotation)
'''
y1 = 2*(orientationXorientationY - orientationWorientationZ)
y2 = orientationWorientationW - orientationXorientationX + orientationY+orientationY - orientationZ*orientationZ
'''
After the visualization, the movement is wrong.
This problem has been bothering me for a long time, I need your help.
The text was updated successfully, but these errors were encountered: