Oops, the attachment didn't go through... here's a "no parts lists" variant of Brian's code, inline.
NB. turtledebug.ijs NB. standalone verseion require 'opengl trig' coinsert 'jgl3 jzopengl ' load 'trig' turtle =: monad define glPushMatrix '' NB. glPushAttrib GL_CURRENT_COLOR glEnable GL_NORMALIZE glColor BCOLOR glTranslate TPOS glRotate ROTturtle glScale SCALE * SIZE glClipPlane GL_CLIP_PLANE0, 0 0 1 0 glEnable GL_CLIP_PLANE0 gluSphere LQuad, 1 30 30 turtlehead '' glDisable GL_CLIP_PLANE0 NB. glPopAttrib '' glPopMatrix '' ) turtlehead =: monad define glPushMatrix '' glPushAttrib GL_CURRENT_COLOR glTranslate 0 1 0 glColor HCOLOR gluSphere LQuad, TURTLE_HEAD_RELATIVE , 30 30 turtlenose '' glPopAttrib '' glPopMatrix '' ) turtlenose =: monad define glPushMatrix '' glPushAttrib GL_CURRENT_COLOR glTranslate 0 0.25 0 glColor NCOLOR gluSphere LQuad, TURTLE_HEAD_RELATIVE , 30 30 glPopAttrib '' glPopMatrix '' ) ROTturtle =: 30 0 0 1 SIZE =: 0.2 NB. turtle body size relative to 1 SCALE =: 1 2 0.5 NB. turtle elliptical rescale TURTLE_HEAD_RELATIVE =: 0.3 NB. head size relative to body PARTS =: i. 0 PARTSSTART =: 2000 run =: verb define gldefault'' glinit'' stdlistlight'' LQuad =: gluNewQuadric'' gluQuadricDrawStyle LQuad,GLU_FILL gluQuadricNormals LQuad,GLU_SMOOTH genlist 'LTurtle0 LTurtle1' TPOS =: _1 0 0 BCOLOR =: 1 0 0 1 NCOLOR =: 0 1 0 1 HCOLOR =: 1 0 1 1 turtle makelist LTurtle0'' TPOS =: 1 0 0 BCOLOR =: 0 0 1 1 HCOLOR =: 0 1 0 1 NCOLOR =: 1 0 1 1 turtle makelist LTurtle1'' glaSwapBuffers '' glpaintx'' ) run'' -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
