Command Palette

Search for a command to run...

Hectal
Phase 7: Cameras and Controls
3D Web · Exercise 1 of 3Next
Intermediate

Fix the stretched picture

The camera was made for a square window, but the canvas is twice as wide as it is tall, so the bike looks stretched.

Make the camera's aspect match the canvas (innerWidth / innerHeight) and rebuild its projection matrix.

What Check tests

  1. camera.aspect matches the canvas
  2. The projection matrix was rebuilt from it

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.