Skip to content

Mesh Points

App: apps/mesh_points/

Creates a points mesh: a grid of vertices with draw mode "points", and animates their r, g, b attributes each frame with setVertexAttribute. (No flush() in this demo — if your backend requires it for dynamic attributes, add _mesh.flush() after updates.)

Terminal window
% ./plume3d mesh_points

or

Terminal window
% ./../plume3d .
  • Builds a 9×9 grid of points (spacing 0.1, size 8 in the loop).
  • Each vertex: [x, y, 0, r, g, b, 1.0] with r/g from grid position, b fixed.
  • In update, animates each vertex’s r, g, b by index and time with _mesh.setVertexAttribute(i, "r", r) etc.
  • GraphicsloadShader, newMesh, drawMesh.
  • MeshgetVertexCount, setVertexAttribute; draw mode "points".
  • Mathsin.