planetarium/terrain.scm: Produce a properly shaded sample.
authorMatt Birkholz <puck@birchwood-abbey.net>
Sat, 30 Apr 2016 19:49:41 +0000 (12:49 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Sat, 30 Apr 2016 19:49:41 +0000 (12:49 -0700)
commitaf449f6c3f795b95232719cde796304afbbe4454
treed6155378d3beab2406ae0e11be28eb272550c15a
parentc1379fc3fefeb7573c82caa6a9baa40f6e486152
planetarium/terrain.scm: Produce a properly shaded sample.

Set the light position in the draw method.  The position is stored in
eye coords and must be updated when the eye moves.  Use a directional
light.  Do not cull back faces.

Fix normal to use the height change (not absolute height!) to east,
west, north and south.  Add more normal tests.

Fix write-sample-terrain to produce the correct number of samples.

Support an optional height->color function.  Change height-color to be
such a function.  Merge draw-colored and draw-shaded into draw-mesh;
conditionally use gl:color-material.

Fix bounds of data plotted.  Since heights adjacent to edges are
imagined flat (not undefined), ALL heights can be used to form quads.
src/planetarium/terrain.scm