NB. Maeder's Minimal Surface

maeder=: 3 : 0
u=. steps 0 4p1 25
v=. steps 0 1 25
x=. ((cos u) */ v) - -: (cos +: u) */ *: v
y=. - ((sin u) */ v) + -: (sin +: u) */ *: v
z=. 4r3 * (cos u * 3r2) */ v ^ 1.5
cleanz 1.5 *"1 fit11 makexyz x;y;z
)

TDATA=: maeder''
TCLR=: (0 0 0 ,: 1 1 1) hue fit01 2{"1 TDATA
TPATTERN=: 16 16$, RGBA WHITE,GRAY,YELLOW,:WHITE
TPATPOS=: */~ int01 <:#TDATA
ROTXYZ=: 325 205 155
CLEARCOLOR=: 0.9 0.9 1
COLORMATERIAL=: 0
AMBIENT=: 0.8
DIFFUSE=: LIMEGREEN
SPECULAR=: DIFFUSE
SHININESS=: 50 0 0 1

demo=: 3 : 0
stdlistlight''
NB. gentexture2D TPATTERN
NB. 2 drawsurface makenewlist TDATA;TCLR;TPATPOS
DISPLAYMODE=: GLU_OUTLINE_POLYGON
DISPLAYMODE=: GLU_OUTLINE_PATCH
2 drawsurface makenewlist TDATA
)

require 'numeric trig opengl'
('jzopengl';'z') copath 'base'
glinit''
demo''
