Skip to content

Instantly share code, notes, and snippets.

@videlais
Created January 10, 2017 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save videlais/740488749b718ed9d74ea365bd408a4e to your computer and use it in GitHub Desktop.
Save videlais/740488749b718ed9d74ea365bd408a4e to your computer and use it in GitHub Desktop.
function animate() {
// Call the requestAnimationFrame function on the animate function
// (thus creating an infinite loop)
requestAnimationFrame( animate );
// Rotate the x position of the mesh by 0.03
mesh.rotation.x += 0.03;
// Rotate the y position of the mesh by 0.02
mesh.rotation.y += 0.02;
// Render everything using the created renderer, scene, and camera
renderer.render( scene, camera );
}
init();
animate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment