NB. model
NB.
NB. move into the solid (press i or Shift i),
NB. to see inside the balls and cylinders.
NB.
NB. use speed keys to control the speed of
NB. movement (1=slowest)

SOLID=: dodecahedron''  NB. try cube'' etc.

ROTXYZ=: 30 5 _5
VIEWXYZ=: 0 0 4.5
SPHERE=: 2042
CYLINDER=: 2043

demo=: 3 : 0
stdlistlight''
len=. dist -/ _3[\ {.1 pick SOLID
LQuad=: gluNewQuadric''
startlist SPHERE
glcolor RED
gluSphere LQuad,0.11 20 20
endlist''
startlist CYLINDER
glcolor SILVER
gluCylinder LQuad,0.025 0.025,len ,10 1
endlist''
make_spheres makenewlist 0 pick SOLID
make_tubes makenewlist 1 pick SOLID
)

NB. =========================================================
NB. make spheres:
make_spheres=: 3 : 0 "1
glPushMatrix ''
glTranslate y.
glCallList SPHERE
glPopMatrix ''
)

NB. =========================================================
NB. make tubes:
make_tubes=: 3 : 0 "1
glPushMatrix ''
'f t'=. _3 <\ y.
glTranslate f
'x y z'=: 1 1 _1 * unitvec f-t
angle=. dfr arccos z
axis=. y,-x,0
glRotate angle,axis
glCallList CYLINDER
glPopMatrix ''
)
