NB. title - OpenGL Graphics
NB.
NB. default display is static,
NB. change TRNCOUNT as below for moving title

TRNCOUNT=: 1   NB. try 60

CLEARCOLOR=: 0.2 0 0.2
ROTXYZ=: 240 0 0
TRNOFF=: _1 0.5 6
TRNXYZ=: _1.7 0.3 0 - TRNOFF
TRNSTEP=: TRNOFF % TRNCOUNT
TRNSPIN=: (360-240 360 360)%TRNCOUNT

demo=: 3 : 0
opengl_g_paint=: paintme
glaFont 'arial 60 bold italic'
glEnable ,.GL_LIGHTING, GL_LIGHT0
genfonts ALF
stdlist''
lighttext makenewlist ''
line1 makenewlist ''
line2 makenewlist ''
glpaint''
)

TEXT1=: 'OpenGL'
TEXT2=: 'Graphics'
ALF=: ~. TEXT1,TEXT2
line1=: glCallLists bind (1000+ALF i.TEXT1)
line2=: (glCallLists bind (1000+ALF i.TEXT2)) @ (glTranslate bind _3.8 _1 0) pushpopmatrix

genfonts=: 3 : 0
a=. a. i. y.
b=. 1000+i.#a
glaUseFontOutlines 0 ,. a ,"0 1 ] 1 ,. b ,"0 1 ] 0 0.3, WGL_FONT_POLYGONS
)

lighttext=: 3 : 0
glLight GL_LIGHT0, GL_AMBIENT, 0.6 0.6 0.6 1
glLight GL_LIGHT0, GL_DIFFUSE, 0.9 0.9 1 1
glLight GL_LIGHT0, GL_SPECULAR, 1 1 1 1
glLight GL_LIGHT0, GL_POSITION, 1 1 1.1 1
glMaterial GL_FRONT_AND_BACK,GL_SPECULAR, 1 1 1 1
glMaterial GL_FRONT_AND_BACK,GL_SHININESS, 128 0 0 1
)

paintme=: 3 : 0
if. 0 > {:TRNXYZ do.
  ROTXYZ=: 360 | ROTXYZ + TRNSPIN
  TRNXYZ=: TRNXYZ + TRNSTEP
  stdview makelist LView ''
  stdtranslate makelist LTranslate ''
  stdrotate makelist LRotate ''
  stdpaintx''
else.
  stdpaint''
end.
)
