Command Palette

Search for a command to run...

Hectal
Phase 10: Models and the Asset Pipeline
3D Web · Exercise 1 of 4Next
Intermediate

Read a .glb header

The code fetches the bike's .glb file. Read its 12-byte header with the DataView: the 4 letters at the start (the magic), the version (bytes 4–7) and the total length (bytes 8–11), both little-endian.

Put them in window.glb = { magic, version, length }.

What Check tests

  1. The magic is glTF
  2. The version is 2
  3. The length is the file's real size

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.

Console

Nothing printed yet.