【发布时间】:2022-02-17 04:09:03
【问题描述】:
如何在three.js中制作动画进度条? 我已经被这个问题困住了很长一段时间。 我尝试使用 html5 视频播放器进度条的方法。但它似乎不适用于 3d 动画。
var loader = new GLTFLoader()
loader.load( './resources/full_case/mymodel.glb', function ( gltf ) {
gltf.scene.scale.set(0.1,0.1,0.1)
gltf.scene.position.set(0,0,-150)
gltf.scene.rotation.set(0, Math.PI * 2, 0)
scene.add( gltf.scene );
mixer = new THREE.AnimationMixer( gltf.scene );
gltf.animations.forEach( ( clip ) => {
let animation = mixer.clipAction( clip );
animation.setLoop(THREE.LoopOnce)
animation.clampWhenFinished = true;
animation.timeScale = 1
animation.play()
} );
} );
【问题讨论】:
-
Mugen87 有一个很好的答案,但如果您需要更多详细信息,请查看我的答案。
标签: javascript three.js