terrain-height-at ( segment point -- height )


Vocabulary
terrain

Inputs and outputs
segmentan object
pointan object
heightan object


Definition


:: terrain-height-at ( segment point -- height )
segment dim>> :> dim dim point v*
:> pixel pixel dup vfloor v-
:> pixel-mantissa segment bitmap>> 4 <groups>
:> pixels pixel dim pixel-indices :> indices indices
[ pixels nth COMPONENT-SCALE v. 255.0 / ] map
first4 pixel-mantissa bilerp ;