const loader = new GLTFloader()loader.load('cars.gltf',(gltf) => {scene.add(gltf.scene)let angle = 0function animate() {requestAnimateFrame(animate)angle += 0.01//0.01是旋转速度gltf.scene.rotation.y = anglerenderer.render(scene, camera)}animate()}
)
效果如下: