Skip to content

fix(vrm): normalize VRMA humanoid rotations - #207

Draft
doodlewind wants to merge 1 commit into
creative-educationfrom
agent/vrma-normalized-retarget
Draft

fix(vrm): normalize VRMA humanoid rotations#207
doodlewind wants to merge 1 commit into
creative-educationfrom
agent/vrma-normalized-retarget

Conversation

@doodlewind

Copy link
Copy Markdown
Collaborator

Summary

  • convert raw VRMA glTF bone rotations into VRM normalized humanoid space before retargeting
  • convert normalized VRM 1 poses into each VRM 0 model bone raw local rest basis
  • match Three.js world-matrix decomposition, including non-uniform-scale shear
  • add synthetic basis/shear coverage plus optional Persona/VRoid fixture goldens

Why

The previous loader copied raw local VRMA quaternions directly (apart from the VRM 1 to VRM 0 facing flip). Raw rest axes differ between rigs, so wrists, hands, ankles, and feet were visibly twisted even though humanoid bone names matched.

This is a generic pocket-vrm correction with no Persona-specific runtime branch. The Persona fixture is optional, git-ignored test data used only as an independent three-vrm golden.

Validation

  • cargo test --manifest-path engine/Cargo.toml -p pocket-vrm (19 unit + 6 fixture tests)
  • cargo clippy --manifest-path engine/Cargo.toml -p pocket-vrm --all-targets -- -D warnings
  • rustfmt --edition 2024 --check engine/crates/pocket-vrm/src/vrma.rs engine/crates/pocket-vrm/tests/fixtures.rs
  • git diff --check
  • visually checked latest Persona packaged idle and multiple speaking frames against the current Persona renderer; limb axes are natural after retargeting

Stack

This draft currently targets creative-education only because it is built on the generic window visibility commit in #204. The VRMA change is independent and should be retargeted to main after #204 lands.

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.

1 participant