Skip to content
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

fix: Fix MToon UV rotation direction #1076

Merged
merged 1 commit into from
Oct 11, 2022
Merged

fix: Fix MToon UV rotation direction #1076

merged 1 commit into from
Oct 11, 2022

Conversation

0b5vr
Copy link
Contributor

@0b5vr 0b5vr commented Oct 4, 2022

Description

Fix uv rotation animation direciton of MToon.

The rotation direction is in which rotates UV coordinates counter-clockwise (in U-right, V-down space).

Ref: KhronosGroup/glTF#1624

The rotation direction is in which rotates UV coordinates counter-clockwise (in U-right, V-down space)

Ref: KhronosGroup/glTF#1624
@0b5vr 0b5vr added the bug Something isn't working label Oct 4, 2022
@0b5vr 0b5vr added this to the next milestone Oct 4, 2022
@0b5vr 0b5vr requested a review from ke456-png October 4, 2022 09:27
@0b5vr 0b5vr self-assigned this Oct 4, 2022
Copy link
Contributor

@ke456-png ke456-png left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍

uv = mat2( uvRotCos, uvRotSin, -uvRotSin, uvRotCos ) * ( uv - 0.5 ) + 0.5;
uv = mat2( uvRotCos, -uvRotSin, uvRotSin, uvRotCos ) * ( uv - 0.5 ) + 0.5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo

$$ R(\theta) \rightarrow R(-\theta) $$

$$ R(-\theta) = \begin{bmatrix} cos( -\theta) & sin(-\theta) \\ -sin(-\theta) & cos(-\theta) \\ \end{bmatrix} = \begin{bmatrix} cos( \theta) & - sin(\theta) \\ sin(\theta) & cos(\theta) \\ \end{bmatrix} $$

つまり回転が逆になりました

@0b5vr 0b5vr merged commit 2ef4cd3 into dev Oct 11, 2022
@0b5vr 0b5vr deleted the mtoon-uv-rotation branch October 11, 2022 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants