1 USING: kernel math math.matrices math.matrices.extras
2 math.order math.vectors prettyprint sequences ;
3 IN: benchmark.3d-matrix-scalar
5 :: p-matrix ( dim fov near far -- matrix )
6 dim dup first2 min v/n fov v*n near v*n
7 near far <frustum-matrix4> ;
9 :: mv-matrix ( pitch yaw location -- matrix )
10 { 1.0 0.0 0.0 } pitch <rotation-matrix4>
11 { 0.0 1.0 0.0 } yaw <rotation-matrix4>
12 location vneg <translation-matrix4> mdot mdot ;
14 :: 3d-matrix-scalar-benchmark ( -- )
17 { 1024.0 768.0 } 0.7 0.25 1024.0 p-matrix :> p
18 3.0 1.0 { 10.0 -0.0 2.0 } mv-matrix :> mv
23 MAIN: 3d-matrix-scalar-benchmark