NB. basic demo 4 - movement keys
NB.
NB. viewbox in red
NB. positive viewbox in blue, xy plane is shown.
NB.
NB. initial axes (positive direction):
NB.   x points right
NB.   y points upwards
NB.   z points out of screen, towards user
NB.
NB. experiment with movement keys, use F4 to reset.
NB. see Help/Movement for description.

CUBEVERTEX=: _3 [\ ,(%{.@,) 1 pick cube''
CLEARCOLOR=: WHITE
COLOR=: BLACK

demo=: 3 : 0
glaFont 'arial 18'
glaUseFontBitmaps 0 32 59 32
stdlist''
demodrawing makenewlist 0.85
)

demodrawing=: 3 : 0
glBegin GL_LINES
glcolor BLUE
glVertex y. * 0.5+0.5*CUBEVERTEX
glEnd''
glBegin GL_LINES
glcolor RED
glVertex y. * CUBEVERTEX
glEnd''
glBegin GL_POLYGON
glcolor BLUE
glVertex y. * _3[\0 0 0 1 0 0 1 1 0 0 1 0
glEnd''
)

demopaint=: 3 : 0
glCallLists LIdentity
glcolor 1 0 0 0
glRasterPos _0.2 0 _1
glCallLists LISTS
demoposition''
glaSwapBuffers''
)

demoposition=: 3 : 0
glcolor 0 0 0 0
glLoadIdentity''
glTranslate 0 0 _0.01
glRasterPos _0.32 0.23 _1
glCallLists 'TRNXYZ: ',tominus ":0.01 round TRNXYZ
glRasterPos 0.12 0.23 _1
glCallLists 'SPEED: ',":SPEED
glRasterPos _0.32 _0.22 _1
glCallLists 'VIEWXYZ: ',tominus ":0.1 round VIEWXYZ
glRasterPos _0.32 _0.25 _1
glCallLists 'VIEWUP:  ',":0.1 round VIEWUP
glRasterPos 0.12 _0.22 _1
glCallLists 'ROTXYZ: ',":roundint ROTXYZ
glRasterPos 0.12 _0.25 _1
glCallLists 'ROTNDX:  ',":ROTNDX
)

stdpaint=: demopaint
