Command Palette

Search for a command to run...

Hectal
Phase 1: How a Screen Draws 3D
3D Web · Exercise 1 of 5Next
Beginner

Make the canvas sharp on a ratio-2 screen

The page draws a cube into a canvas that should look 200 × 100 on the page.

Make it sharp on a screen with a pixel ratio of 2: the canvas's style size must stay 200 × 100 CSS pixels, and its drawing buffer must be 400 × 200 pixels.

What Check tests

  1. The canvas looks 200 × 100 on the page
  2. The drawing buffer is 400 × 200
  3. The scene is being drawn

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.