Shader Learn

05 Data becomes vertices

vec3: three numbers place a point in space

Pick a row, then drag X / Y / Z; the array and its vertex change together.

-1.21.2
-1.21.2
-1.21.2
Explanation

Drag the underlined numbers left and right

// selected vertex p2vec3 point = vec3(, , );

Click a row to pick a vertex; X is left/right, Y up/down, Z front/back.

JS sidegl.uniformMatrix4fv(uModel, …) // rotation -0.55 / 0.35

A vec3 places a point in space with three numbers: X left/right, Y up/down, Z front/back.

Try it

  • Pick p6 and push Z to the maximum
  • Pull one vertex away and watch its triangles stretch with it