Plume Triangle
App: apps/plume_triangle/
The minimal graphics example: load a shader, create a single colored triangle mesh (LÖVE-style vertices [x, y, z, r, g, b, a]), and draw it each frame.
Run from root
Section titled “Run from root”% ./plume3d plume_triangleor
Run from app directory
Section titled “Run from app directory”% ./../plume3d .What it does
Section titled “What it does”Graphics.loadShader("shaders/triangle")— loads the triangle shader.Graphics.newMesh(vertices, "triangles", _shader)— three vertices (red, green, blue corners).Graphics.drawMesh(_mesh)indraw().
- Graphics —
loadShader,useShader(implicit when passing shader to newMesh),newMesh,drawMesh. - Mesh — used as returned from
newMesh.
Vertex format
Section titled “Vertex format”Vertices are lists of 7 numbers: [x, y, z, r, g, b, a]. The demo uses a custom shader in shaders/ (see shaders/src/triangle.slang and compile.sh).