NB. OpGLN_cube.ijs NB. system\examples\graphics\opengl\lab\ogl_cube.ijs NB. rotate => key-in: x/X, y/Y, z/Z require'opengl gl3' coinsert'jgl3' A=: 0 : 0 pc a closeok; xywh 0 0 200 200;cc g isigraph opengl rightmove bottommove; pas 0 0; rem form end; ) run=: a_run a_run=: 3 : 0 wd A ogl=: ''conew'jzopengl' R=: 0 0 0 wd'pshow;' ) a_close=: 3 : 0 destroy__ogl'' wd'pclose' ) a_g_paint=: 3 : 0 RC =: rc__ogl '' if. RC do. g_draw_init wh__ogl end. g_draw'' show__ogl'' ) a_g_char =: 3 : 0 wd'psel a' R=: 360 | R + 2 * 'xyz' = {.sysdata R=: 360 | R - 2 * 'XYZ' = {.sysdata a_g_paint'' ) g_draw_init=: 3 : 0 glViewport 0 0,y ('arial';30) glaUseFontBitmaps__ogl 32 95 32 glMatrixMode GL_PROJECTION glLoadIdentity'' glOrtho _1 1 _1 1 _1 1 NB. gluPerspective 30, (%/y),1 10 ) g_draw=: 3 : 0 glClearColor 1 1 1 0 glClear GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT glEnable GL_DEPTH_TEST glMatrixMode GL_MODELVIEW glLoadIdentity'' glColor 0 0 0 0 glRasterPos _0.4 _0.7 0 glaCallLists ' X Y Z' glRasterPos _0.4 _0.9 0 glaCallLists 5 ": R glTranslated 0 0 0 glRotated R ,. 3 3 $ 1 0 0 0 NB. glPolygonMode GL_FRONT_AND_BACK, GL_LINE NB. Wired drawbox '' ) BLUE=: 0 0 1 0 GREEN=: 0 1 0 0 RED=: 1 0 0 0 drawbox=:3 : 0 p=: _1 ^ #: i.8 p=. 0.3*p BLUE polygon 0 1 3 2{p GREEN polygon 0 1 5 4{p RED polygon 0 2 6 4{p (RED+BLUE) polygon 4 5 7 6{p NB. Violet (RED+GREEN) polygon 1 3 7 5{p NB. Yellow (BLUE+GREEN) polygon 2 3 7 6{p NB. Aqua ) polygon=: 4 : 0 glColor4d x glBegin GL_POLYGON glVertex y glEnd '' )