NB. fractal mountain

randunif=: (? % ])@($&1e9)
cos=: 2&o.
randsn=: (cos@+:@o.@randunif) * (%:@-@+:@^.@randunif)
interp=: (}:@((2&#@i.)+ +: $ 0&,)@#) { (, }. -:@+ }:)
randadd=: ] + [ * randsn@$@]
ira=: [ randadd interp@(interp"1@])
irfa=: (%@<:@#@] ^ [)ira ]
Z=: -: 0.85&irfa^:5 ]2 2$0

X=: Y=: _1+2*(i.%<:) 33

0 : 0

   require 'plot'
   'boxed 0' plot X;Y;Z
)

require 'opengl'
DAT=: (X ,"0/ Y),"1 0 Z

demo6=: 3 : 0

glinit''
ROTXYZ=: _55 0 _25
COLOR=: PALEGREEN
CLEARCOLOR=: SKYBLUE
stdlistlight''
2 drawsurface DAT
glpaintx''
)

wdreset''
glreset''
demo6''
