px = 0 py = 0 rx = 0 ry = 0 t = 0 function animate() { //cube.rotation.x = 0.01 //cube.rotation.y = 0.01 cube.rotation.x = rx cube.rotation.y = ry if (t>=360){ t = 0 } px = 2*Math.cos(t) py = 2*Math.sin(t) cube.position.set(px, py, 0) t +=0.1 sleep(50) }