NB. crosscap
NB.
NB. for a doubled crosscap, try:
NB. x=. (sin +: u) */ sin +: v

crosscap=: 3 : 0
u=. steps 0 1p1 15
v=. steps _1r2p1 1r2p1 15
x=. (sin u) */ sin +: v
y=. (sin +: u) */ *: cos v
z=. (cos +: u) */ *: cos v
1.25*makexyz x;y;z
)

TDATA=: crosscap''
TCLR=: (0 0 0 ,: 1 1 1) hue fit01 2{"1 TDATA
TPATTERN=: 32 32$, RGBA WHITE,LIMEGREEN,YELLOW,:WHITE
TPATPOS=: */~ int01 <:#TDATA

ROTXYZ=: 25 350 180
CLEARCOLOR=: SKYBLUE
COLOR=: TEAL
SHOWPATTERN=: 1

demo=: 3 : 0
stdlistlight''
if. 0=SHOWPATTERN do.
  2 drawsurface makenewlist TDATA
else.
  gentexture2D TPATTERN
  2 drawsurface makenewlist TDATA;TCLR;TPATPOS
end.
)
