Command Palette

Search for a command to run...

Hectal
Phase 3: three.js Foundations
3D Web · Exercise 1 of 5Next
Beginner

Spin a cube at half a turn per second

The cube turns 0.05 radians per frame, so it spins at the speed of your screen. Make it turn at exactly half a turn per second on any screen.

Use THREE.Timer (connected to the document), not the deprecated THREE.Clock.

What Check tests

  1. The scene has a cube that turns
  2. It uses THREE.Timer
  3. It does not use the deprecated Clock
  4. The turn comes from getDelta()
  5. It turns slower than 4 radians a second (not a per-frame constant)

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.