Handbook
Glossary
terrain-height-at ( segment point -- height )
Vocabulary
terrain
Inputs
segment
an
object
point
an
object
Outputs
height
an
object
Definition
USING:
accessors
grouping
kernel
math
math.vectors
sequences
;
IN:
terrain
::
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
;