three js clock

Solutions on MaxInterview for three js clock by the best coders in the world

showing results for - "three js clock"
Debora
20 Jan 2016
1var clock = new THREE.Clock();
2var speed = 2; //units a second
3var delta = 0;
4
5render();
6function render(){
7  requestAnimationFrame(render);
8
9  delta = clock.getDelta();
10  object.position.z += speed * delta;
11
12  renderer.render(scene, camera);
13}