;; this is similar to gluPerspective
;; but fills a suitable PROJECTION matrix
(bind-func fill_orthographic_matrix
(lambda (mat:float* left right bottom top near far)
(pfill! mat
(/ 2.0 (- right left)) 0.0 0.0 0.0
0.0 (/ 2.0 (- top bottom)) 0.0 0.0
0.0 0.0 (* -1.0 (/ 2.0 (- far near))) 0.0
(* -1.0 (/ (+ left right) (- right left)))
(* -1.0 (/ (+ top bottom) (- top bottom)))
(* -1.0 (/ (+ far near) (- far near)))
1.0)
void))