Handbook
Glossary
pixel-indices ( coords dim -- indices )
Vocabulary
terrain
Inputs
coords
an
object
dim
an
object
Outputs
indices
an
object
Definition
USING:
arrays
math
math.vectors
sequences
;
IN:
terrain
::
pixel-indices
( coords dim -- indices )
coords
vfloor
v>integer
dim
clamp-coords
:>
floor-coords floor-coords
first2
dim
first
*
+
:>
base-index base-index dim
first
+
:>
next-row-index base-index base-index 1
+
next-row-index next-row-index 1
+
4array
;