Command Palette

Search for a command to run...

Hectal
Phase 4: Geometry
3D Web · Exercise 1 of 4Next
Beginner

A triangle from raw numbers

Build a mesh named sail from a BufferGeometry that you fill yourself: three vertices, no index, positions in a Float32Array.

Use the corners (−1, −0.7, 0), (1, −0.7, 0) and (0, 1, 0), in that order, with an orange MeshBasicMaterial, so it is visible from the camera.

What Check tests

  1. A mesh named sail exists
  2. It has 3 vertices of 3 numbers in a Float32Array
  3. It is not indexed
  4. The renderer drew exactly 1 triangle
  5. The middle of the picture is orange (the triangle faces the camera)

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.