()
| 55 | |
| 56 | // Draw the scene every time the screen is refreshed |
| 57 | function animate() { |
| 58 | requestAnimationFrame(animate); |
| 59 | |
| 60 | // Rotate cube (Change values to change speed) |
| 61 | cube.rotation.x += 0.01; |
| 62 | cube.rotation.y += 0.01; |
| 63 | |
| 64 | renderer.render(scene, camera); |
| 65 | } |
| 66 | |
| 67 | function onWindowResize() { |
| 68 | // Camera frustum aspect ratio |