레퍼런스 instances()

instances()

Draws count instances of the next 3D primitive or model using WebGL instanced rendering.

Call a draw method on the returned object to render that primitive count times in a single draw call. Instance-specific transforms and attributes (position, color, etc.) are supplied through a custom shader that reads per-instance data from an instanced attribute buffer.

예제

구문

instances(count)

매개변수

count
Number|p5.StorageBuffer|p5.StorageList: number of instances to draw, or a storage buffer/list whose element count is used. A plain number must be a positive integer.

반환값

p5.InstancesWrapper: an object with methods sphere, box, plane, ellipsoid, cylinder, cone, torus, triangle, rect, quad, ellipse, arc, model, line, point, bezier, and spline. Call one of these to draw count instances of that primitive.

관련 레퍼런스