1
0
This commit is contained in:
syui 2024-10-04 13:37:23 +09:00
parent 7bc0ba9e93
commit 72456a96f3
Signed by: syui
GPG Key ID: 5417CFEBAD92DF56

View File

@ -36,6 +36,12 @@ const VRMModel: React.FC<ModelProps> = ({ url, url_anim, position, rotation, sca
mixer.clipAction(clip).play();
}
});
if (mixerRef.current) {
const hips = vrmModel.humanoid?.getBoneNode('hips');
if (hips) {
hips.rotation.y = Math.PI;
}
}
});
}, [url, url_anim]);
@ -65,10 +71,10 @@ export const VRMModelCanvas = () => {
}}
camera={{ position: [1.2, 0, 0] }}>
<color attach="background" args={["#000"]} /> {/* Light gray background */}
<OrbitControls />
<OrbitControls dampingFactor={0.05} rotateSpeed={0.1} zoomSpeed={0.5}/>
<ambientLight intensity={10} />
<pointLight position={[10, 10, 10]} />
<VRMModel url="./models/t.vrm" url_anim="./models/default.vrma" position={[0, -0.6, 0]} rotation={[0, 0, 0]} scale={[1, 1, 1]} />
<VRMModel url="./models/t.vrm" url_anim="./models/default.vrma" position={[0, -0.6, 0]} rotation={[0, 89.5, 0]} scale={[1, 1, 1]} />
</Canvas>
</div>
)