noise: update for iota

db4
Slava Pestov 2010-01-15 06:13:42 +13:00
parent df4fb4a3ee
commit a93831a36e
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
IN: noise.tests
USING: noise tools.test sequences math ;
[ t ] [ { 100 100 } perlin-noise-map-coords [ [ 100 <= ] all? ] all? ] unit-test

View File

@ -120,7 +120,7 @@ TYPED:: perlin-noise ( table: byte-array point: float-4 -- value: float )
faded trilerp ;
MEMO: perlin-noise-map-coords ( dim -- coords )
first2 [| x y | x [ y 0.0 0.0 float-4-boa ] float-4-array{ } map-as ] with map concat ;
first2 iota [| x y | x iota [ y 0.0 0.0 float-4-boa ] float-4-array{ } map-as ] with map concat ;
TYPED:: perlin-noise-map ( table: byte-array transform: matrix4 coords: float-4-array -- map: float-array )
coords [| coord | table transform coord m4.v perlin-noise ] data-map( float-4 -- c:float )