NB. Kuen's  surface of constant negative curvature

kuen=: 3 : 0
u=. steps _4 4 10
v=. }. }: steps 0 1p1 10

w=. %"1 & (1 + *: u */ sin v)
x=. (w sin v) * (cos u) + u * sin u
y=. (w sin v) * (sin u) - u * cos u
z=. (2 * w cos v) + (u * 0) +/ ^. tan v%2

cleanz 2.5 2.5 1 *"1 fit11 makexyz x;y;z
)

TDATA=: kuen''
TCLR=: (0 0 0 ,: 1 1 1) hue fit01 2{"1 TDATA
TPATTERN=: 256 256$, RGBA WHITE,GRAY,YELLOW,:WHITE
TPATPOS=: */~ int01 <:#TDATA
ROTXYZ=: 300 185 325
TRNXYZ=: 0.3 0.125 0
CLEARCOLOR=: 0.9 0.9 1
COLORMATERIAL=: 0
AMBIENT=: 0.8
DIFFUSE=: LIMEGREEN
SPECULAR=: DIFFUSE
SHININESS=: 50 0 0 1

demo=: 3 : 0
stdlistlight''
gentexture2D TPATTERN
2 drawsurface makenewlist TDATA;TCLR;TPATPOS
)
