WILDLANDS — procedural geometry.
Every builder returns a `Geo`: flat arrays in the shape renderer.mesh.create
takes (positions / normals / uvs / colors / indices), in LOCAL space.
Vertex colour RGB multiplies the albedo of the pbr shader, so one material
carries bark, leaf, hide and stone variation on the same draw.
push3(t: ?, x: ?, y: ?, z: ?) → void
| arg | type | description |
|---|
| t | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
vertex(g: ?, x: ?, y: ?, z: ?, nx: ?, ny: ?, nz: ?, u: ?, v: ?, r: ?, gg: ?, b: ?, a: ?) → void
| arg | type | description |
|---|
| g | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
| nx | ? | |
| ny | ? | |
| nz | ? | |
| u | ? | |
| v | ? | |
| r | ? | |
| gg | ? | |
| b | ? | |
| a | ? | |
tri(g: ?, a: ?, b: ?, c: ?) → void
| arg | type | description |
|---|
| g | ? | |
| a | ? | |
| b | ? | |
| c | ? | |
recomputeNormals(g: ?) → void
Area-weighted normals from the triangles. A displaced surface shaded with the
smooth analytic normals of the sphere it started as reads as a ball no matter
how far it was pushed, so anything deformed gets its normals rebuilt here.
tpos(x: ?, y: ?, z: ?) → void
| arg | type | description |
|---|
| x | ? | |
| y | ? | |
| z | ? | |
qAxis(ax: ?, ay: ?, az: ?, angle: ?) → void
| arg | type | description |
|---|
| ax | ? | |
| ay | ? | |
| az | ? | |
| angle | ? | |
qMul(a: ?, b: ?) → void
Quaternion product, exposed so callers can compose their own orientations.
qrot(q: ?, x: ?, y: ?, z: ?) → void
| arg | type | description |
|---|
| q | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
xformPoint(t: ?, x: ?, y: ?, z: ?) → void
| arg | type | description |
|---|
| t | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
xformDir(t: ?, x: ?, y: ?, z: ?) → void
| arg | type | description |
|---|
| t | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
append(dst: ?, src: ?, t: ?, tint: ?) → void
Copy `src` into `dst`, transformed. `tint` (optional {r,g,b}) multiplies colour.
| arg | type | description |
|---|
| dst | ? | |
| src | ? | |
| t | ? | |
| tint | ? | |
sphere(opts: ?) → void
A UV sphere with optional radial displacement. Colour is a function of the
unit direction, so a material can darken a belly and lighten a back.
tube(pts: ?, radii: ?, sides: ?, opts: ?) → void
A swept tube along a polyline. `pts` are {x,y,z}; `radii` one per point.
`sides` is even so the colour seam is not on the front face.
| arg | type | description |
|---|
| pts | ? | |
| radii | ? | |
| sides | ? | |
| opts | ? | |
card(corners: ?, color: ?) → void
A flat card (leaf / blade / feather / plank) given three or four corners in
local space. Three corners makes a triangle, which is what a feather or a
fin needs; four makes the quad that a leaf uses.
| arg | type | description |
|---|
| corners | ? | |
| color | ? | |
leaf(len: ?, wid: ?, color: ?, q: ?, px: ?, py: ?, pz: ?) → void
A leaf: a pointed oval card with a midrib fold, oriented by a quaternion.
| arg | type | description |
|---|
| len | ? | |
| wid | ? | |
| color | ? | |
| q | ? | |
| px | ? | |
| py | ? | |
| pz | ? | |
barkColor(seed: ?) → void
tree(seed: ?, opts: ?) → void
Returns { bark = Geo, leaves = Geo }. `opts.kind` picks the silhouette.
The crown is one continuous volume sampled with leaf cards rather than a
handful of separate balls, which is what makes it read as a tree.
| arg | type | description |
|---|
| seed | ? | |
| opts | ? | |
_shellness(px: ?, py: ?, pz: ?) → void
how far inside the crown a point is: 1 at the surface, 0 at the core
| arg | type | description |
|---|
| px | ? | |
| py | ? | |
| pz | ? | |
rock(seed: ?, opts: ?) → void
| arg | type | description |
|---|
| seed | ? | |
| opts | ? | |
color(nx: ?, ny: ?, nz: ?) → void
| arg | type | description |
|---|
| nx | ? | |
| ny | ? | |
| nz | ? | |
grassTuft(seed: ?) → void
color(nx: ?, ny: ?) → void
| arg | type | description |
|---|
| nx | ? | |
| ny | ? | |
box(g: ?, cx: ?, cy: ?, cz: ?, sx: ?, sy: ?, sz: ?, c: ?) → void
| arg | type | description |
|---|
| g | ? | |
| cx | ? | |
| cy | ? | |
| cz | ? | |
| sx | ? | |
| sy | ? | |
| sz | ? | |
| c | ? | |
structure(kind: ?) → void
tool(kind: ?) → void
A tool held in the hand. `kind` = axe | pick | spear | torch
color(nx: ?, ny: ?) → void
| arg | type | description |
|---|
| nx | ? | |
| ny | ? | |
wildcoreOrb(open: ?) → void
The WILDCORE ORB: two hinged shells, a metal band, an energy core.
Returns { shell = Geo, band = Geo, core = Geo } so each can wear its own material.
color(nx: ?, ny: ?, nz: ?) → void
| arg | type | description |
|---|
| nx | ? | |
| ny | ? | |
| nz | ? | |
color(v: ?, u: ?, nx: ?, ny: ?, nz: ?) → void
| arg | type | description |
|---|
| v | ? | |
| u | ? | |
| nx | ? | |
| ny | ? | |
| nz | ? | |
color(nx: ?, ny: ?) → void
| arg | type | description |
|---|
| nx | ? | |
| ny | ? | |