(bind-func fill_projection_matrix
(lambda (mat:float* fovy aspect near far)
(let ((a (* fovy (/ PIf 180.0))) ;; convert deg to rad
(c (/ (cos (* a 0.5)) (sin (* a 0.5)))))
(pfill! mat
(/ c aspect) 0.0 0.0 0.0
0.0 c 0.0 0.0
0.0 0.0 (* -1.0 (/ (+ far near) (- far near))) -1.0
0.0 0.0 (* -1.0 (/ (* 2.0 far near) (- far near))) 0.0)
void)))