Command Palette

Search for a command to run...

Hectal
Phase 7: Cameras and Controls
3D Web · Exercise 2 of 3 PreviousNext
Intermediate

Put limits on the orbit

The controls can go under the floor, through the bike and far away, and they orbit a point on the floor.

Orbit the middle of the bike (0, 0.45, 0), keep the distance between 1 and 6 m, never go below the horizon (maxPolarAngle = Math.PI / 2), and turn panning off. Keep the line window.controls = controls; so the checks can read them.

What Check tests

  1. The controls orbit (0, 0.45, 0)
  2. The distance stays between 1 and 6 m
  3. The camera never goes below the horizon
  4. Panning is off
  5. A drag far downwards stays above the floor

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.