Skip to content

Commit

Permalink
fix vrm0 rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
memelotsqui committed Nov 15, 2023
1 parent 3cceace commit def2612
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/library/merge-geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,19 @@ export async function combineNoAtlas(avatar, options) {
// group.animations = [];
clonedMeshes.forEach(mesh => {
const geometry = new THREE.BufferGeometry();
if (mesh.userData?.isVRM0){
for (let i = 0; i < mesh.geometry.attributes.position.array.length; i+=3){
mesh.geometry.attributes.position.array[i] *= -1
mesh.geometry.attributes.position.array[i+2] *= -1
}
}
const attributes = {}
for (const attributeName in mesh.geometry.attributes) {
const attribute = mesh.geometry.attributes[attributeName];
attributes[attributeName] = attribute.clone();
}



const source = {
attributes,
Expand Down

0 comments on commit def2612

Please sign in to comment.