(perspective-matrix-3d field-of-view aspect near far)

Source

(defn perspective-matrix-3d [field-of-view aspect near far] (let [f (math tan (- (* (math PI) 0.5) (* field-of-view 0.5))) range-inv (/ 1 (- near far))] [(/ f aspect) 0 0 0 0 f 0 0 0 0 (* (+ near far) range-inv) -1 0 0 (* near far range-inv 2) 0]))