Points
View sourceIndependent points; WebGL POINTS (0x0000).
Enum
Selects the WebGL primitive topology used by a draw call.
Pass one of these numeric values as the mode argument to
gl.drawArrays or gl.drawElements. Points (0x0000) draws independent
points; Lines (0x0001) draws independent pairs of vertices;
LineLoop (0x0002) connects the vertices and closes the line;
LineStrip (0x0003) connects consecutive vertices without closing the
line; Triangles (0x0004) draws independent groups of three vertices;
TriangleStrip (0x0005) builds connected triangles from adjacent
vertices; and TriangleFan (0x0006) builds connected triangles around
the first vertex.
import { DrawPrimitive } from '@wimaengine/render-webgl'
// `gl` is an existing WebGL rendering context with a bound vertex array.
gl.drawArrays(DrawPrimitive.Triangles, 0, 3)Independent points; WebGL POINTS (0x0000).
Independent line segments; WebGL LINES (0x0001).
A connected line whose final vertex joins the first; WebGL LINE_LOOP (0x0002).
A connected open line; WebGL LINE_STRIP (0x0003).
Independent triangles formed from each group of three vertices; WebGL TRIANGLES (0x0004).
Connected triangles that reuse adjacent vertices; WebGL TRIANGLE_STRIP (0x0005).
Connected triangles that share the first vertex; WebGL TRIANGLE_FAN (0x0006).