We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
把带有骨骼的模型导入进去,面会出现扭曲和错乱,而把一个没有骨骼的模型导入就显示正常,应该部分模型才会这样,因为官方机器人的骨骼却是正常的,暂时不明白什么原因。 代码如下:
function addGltf() { clock = new THREE.Clock(); const dracoLoader = new DRACOLoader(); dracoLoader.setDecoderPath("/draco/"); let loader = new GLTFLoader(); loader.setDRACOLoader(dracoLoader); loader.load('/models/pikachu.glb',(gltf) => { animations = gltf.animations; model = gltf.scene; model.rotation.x = Math.PI / 2; model.rotation.y = -Math.PI / 3; model.scale.setScalar(.1); scene.add(model) addAnimations() activeAction = actions["Idle"]; activeAction.play() model.position.copy(threeLayer.coordinateToVector3(map.getCenter())); animate(); }); } function addAnimations() { mixer = new THREE.AnimationMixer(model); actions = {}; for (let i = 0; i < animations.length; i++) { let clip = animations[i]; let action = mixer.clipAction(clip); actions[clip.name] = action; action.clampWhenFinished = true; action.loop = THREE.Loop; } } function animate() { let dt = clock.getDelta(); if (mixer) mixer.update(dt); requestAnimationFrame(animate); if (threeLayer._needsUpdate) { threeLayer.redraw(); } }
模型资源地址: https://sketchfab.com/3d-models/pikachu-37c740f674cd4719a1d1d2970bbe8c30
The text was updated successfully, but these errors were encountered:
No branches or pull requests
把带有骨骼的模型导入进去,面会出现扭曲和错乱,而把一个没有骨骼的模型导入就显示正常,应该部分模型才会这样,因为官方机器人的骨骼却是正常的,暂时不明白什么原因。
代码如下:
模型资源地址:
https://sketchfab.com/3d-models/pikachu-37c740f674cd4719a1d1d2970bbe8c30
The text was updated successfully, but these errors were encountered: