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


Vocabulary
terrain

Inputs
segmentan object
pointan object


Outputs
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 vdot 255.0 / ] map
first4 pixel-mantissa bilerp ;