Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Twitching occurs in animations when porting to SMF1 #32

Open
bartteunis opened this issue Jan 7, 2022 · 3 comments
Open

Twitching occurs in animations when porting to SMF1 #32

bartteunis opened this issue Jan 7, 2022 · 3 comments
Assignees

Comments

@bartteunis
Copy link
Member

Bones can be inverted inbetween some keyframes.
This works fine in SMF v10 and the corresponding version of the Model Tool because it has additional math for inverting DQs.
When porting these animations to SMF1 and previewing in Model Tool 0.8.9, the twitching occurs.
Can these corrections be done in the Blender exporter? If so, what should be added to export correct DQs?
Is this issue related to DQs or also to matrices?

@bartteunis
Copy link
Member Author

This requires #9 DQ export option

It seems to correspond to the if-else part in smf_model_load_from_buffer that is checked for every node:

if (i > 0)
{
// ...

@bartteunis bartteunis self-assigned this Apr 1, 2022
@bartteunis
Copy link
Member Author

A subtle yet important remark: smf_dq_invert doesn't invert a DQ but negates it.
See Quaternions and spatial rotation:

It can be proven that the inverse of a unit quaternion is obtained simply by changing the sign of its imaginary components.

smf_dq_invert, however, changes the sign of all components, so rather it performs a scalar multiplication by -1.
So it is negate that should be used instead of invert.

@bartteunis
Copy link
Member Author

Untested, test to see if this is solved by #9

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant