fitIsoGrid
A W×H grid of square cells holding about count agents at the canvas aspect, each side clamped to [min, max].
fitIsoGrid(
count: number,
aspect: number,
min: number,
max: number,
): { w: number; h: number; }
Import sim from shaders/std and use sim.agentFrame.fitIsoGrid.
Parameters
| Name | Type | Notes |
|---|---|---|
count | number | |
aspect | number | |
min | number | |
max | number |
Example
const {w, h} = agentFrame.fitIsoGrid(count, aspect, 8, 160)
See also
fitJitteredGrid— A grid of aboutcountroughly square cells over the canvas plus anoverscanborder on every side, for agents that rest on a jittered grid.