let display () =
GlClear.clear [`color; `depth] ;
GlMat.push ();
cam_transfo () ;
GlLight.light 0 (`position (!lx, !ly, !lz, 1.)) ;
GlLight.material ~face:`both (`specular (1., 1., 1., 1.0)) ;
GlLight.material ~face:`both (`diffuse (0., 0.5, 0., 1.0)) ;
GlLight.material ~face:`both (`shininess 100.) ;
if !walk then begin
begins `lines ;
GlLight.material ~face:`both (`ambient (0.,1.,0.,1.)) ;
vertex3 (-1.,0.,-1000.) ;
vertex3 (-1.,0.,1000.) ;
GlLight.material ~face:`both (`ambient (1.,0.,0.,1.)) ;
vertex3 (1.,0.,-1000.) ;
vertex3 (1.,0.,1000.) ;
GlLight.material ~face:`both (`ambient (1.,1.,1.,1.)) ;
vertex3 (1.,0.,0.) ;
vertex3 (-1.,0.,0.) ;
vertex3 (-1.,0.,0.) ;
vertex3 (0.,0.,0.8) ;
vertex3 (0.,0.,0.8) ;
vertex3 (1.,0.,0.) ;
ends ()
end ;
GlLight.material ~face:`both (`ambient (0.6, 0.6, 0.6, 1.0)) ;
if !walk then
Visu.visu_mb 10. (Array.mapi (fun i (x, y, z) ->
(x, y, z, if i = 2 then 5. else 1.))
Solver.pos)
else
Visu.visu_mb 10. (Array.map (fun (x, y, z) -> (x, y, z, 1.)) Solver.pos) ;
GlMat.pop () ;
Glut.swapBuffers ()