You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The web folder holds a starter template. The page renders a heading and a line of placeholder text, and nothing in it knows what terrain is.
There is also nothing to ask for terrain yet. The viewer is built against a stand-in that answers the same request the real service will, so the work does not wait on the backend and so #75 replaces it without the rest of the viewer noticing.
Terrain is drawn flat: a fixed camera looking down on a plane, with each cell coloured by its height. Raising that same plane into a surface is what makes it 3D later, so none of the setup here is spent twice.
Description
Get generated terrain onto the page as coloured cells.
There are four parts. A rendering surface is mounted on the page and survives the window being resized. A height grid is turned into one colour per cell. Those colours are drawn onto the surface with cells kept square edged. And a stand-in produces a height grid for a seed, a corner, and a size.
A request names a seed, a corner, and a size, all in cells. How the backend divides its work does not appear here.
Heights run from 0 to 255 and anything outside that is pulled to the ends. The real range is not known until Elevation Encoding is built, so one ticket changes this later.
The stand-in works out terrain from where a cell sits in the world, so two requests meeting along an edge agree about the terrain there. Without that the last ticket in this epic has nothing to show.
Nothing assumes a grid size. Build against 32 cells across.
Do them in the order above. Drawing a fixed sample grid before the stand-in exists keeps the two apart when something looks wrong.
Activity