首先,引入js文件:
然后,实例化:
//实例化 orbitcontrolsorbitcontrols = new THREE.OrbitControls(camera,renderer.domElement);orbitcontrols.target = new THREE.Vector3(0, 0, 0);orbitcontrols.autoRotate = false;clock = new THREE.Clock();
最后,循环渲染:
//实时渲染function Loop(){ delta = clock.getDelta(); orbitcontrols.update(delta); renderer.render(scene,camera); requestAnimationFrame(Loop);}
1