Skip to content

fix(three-mmd-b): z flip#13

Merged
kwaa merged 2 commits into
moeru-ai:mainfrom
Lilia-Chen:lilia/dev
Nov 19, 2025
Merged

fix(three-mmd-b): z flip#13
kwaa merged 2 commits into
moeru-ai:mainfrom
Lilia-Chen:lilia/dev

Conversation

@Lilia-Chen

Copy link
Copy Markdown
Collaborator

Root cause

The problem is that PMX's default Z direction = default negative Z in three.js. Therefore, the model was mirrored by the X-Y plane.

Resolution

  • build-geometry.ts: positions, normals, face winding order and morph targets are flipped.
  • build-bones.ts: Z-coordinate flip for each bone.
  • TODO: Given the fact that the animation loading is incomplete so far, need to remember to apply the same Z-flip to the animation trace coordinates.

Before vs After

Before: 👎
image

After: 👍
3acaa970269385dce4fbcd6c23861d6a

The bones are also correct:
a15ef6aa46939e80562ecbc21be24305

@kwaa kwaa changed the title bug-fix: The Model Chirality (Z flip) Issue Has Been Resolved fix(three-mmd-b): z flip Nov 19, 2025
Comment thread packages/three-mmd-b/src/utils/build-bones.ts Outdated
Comment thread packages/three-mmd-b/src/utils/build-geometry.ts Outdated
Comment thread packages/three-mmd-b/src/utils/build-geometry.ts Outdated
@kwaa kwaa merged commit 95df864 into moeru-ai:main Nov 19, 2025
1 check failed
@Lilia-Chen Lilia-Chen deleted the lilia/dev branch November 20, 2025 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants