Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Heightfield ¶
Heightfield is the res×res grid of z values — the pure output of the math, row-major, x fastest.
type Scene ¶
type Scene struct {
Field Heightfield
}
Scene wraps a heightfield and renders it to a WebGL canvas.
func (Scene) Render ¶
Render emits the text/html the client injects: a <canvas> and an <img onerror> that bootstraps WebGL. The heightfield rides in a data- attribute as a JSON array; the handler reads it, builds a triangle mesh, and animates a rotating, height-shaded draw. The Go side never touches a pixel; the JS never touches the math. That the JS lives in a string here — not in a .js file, not importable, not typechecked — is the honest cost of the escape hatch, and why it's quarantined to this one cell.