05 Data becomes vertices
Coordinate array → vertices
Eight vec3 rows define eight corners. So far there are only points, no surface.
Exercise
Drag numbers, or edit the code
// JS - 8 corners, 3 numbers eachpositions = [ [-0.75, -0.75, 0.75], // p0 [ 0.75, -0.75, 0.75], // p1 [ 0.75, 0.75, 0.75], // p2 ...];
- 24 numbers
- 8 points
Uploaded as one continuous buffer of numbers; points do not join into faces by themselves.
JS side
gl.uniformMatrix4fv(uModel, …) // rotation -0.55 / 0.35A model starts as a list of numbers in JS: every 3 numbers make one vertex.
Try it
- Count the points: does it match the number of rows?