2018-02-04 00:00:21 -05:00
|
|
|
USING: kernel locals math math.matrices math.matrices.extras
|
|
|
|
math.order math.vectors prettyprint sequences ;
|
2009-09-30 12:51:44 -04:00
|
|
|
IN: benchmark.3d-matrix-scalar
|
|
|
|
|
|
|
|
:: p-matrix ( dim fov near far -- matrix )
|
|
|
|
dim dup first2 min v/n fov v*n near v*n
|
2018-02-04 00:00:21 -05:00
|
|
|
near far <frustum-matrix4> ;
|
2009-09-30 12:51:44 -04:00
|
|
|
|
|
|
|
:: mv-matrix ( pitch yaw location -- matrix )
|
2018-02-04 00:00:21 -05:00
|
|
|
{ 1.0 0.0 0.0 } pitch <rotation-matrix4>
|
|
|
|
{ 0.0 1.0 0.0 } yaw <rotation-matrix4>
|
2020-02-26 15:51:04 -05:00
|
|
|
location vneg <translation-matrix4> mdot mdot ;
|
2009-09-30 12:51:44 -04:00
|
|
|
|
2012-07-19 20:35:47 -04:00
|
|
|
:: 3d-matrix-scalar-benchmark ( -- )
|
2009-09-30 12:51:44 -04:00
|
|
|
f :> result!
|
|
|
|
100000 [
|
|
|
|
{ 1024.0 768.0 } 0.7 0.25 1024.0 p-matrix :> p
|
|
|
|
3.0 1.0 { 10.0 -0.0 2.0 } mv-matrix :> mv
|
2020-02-26 15:51:04 -05:00
|
|
|
mv p mdot result!
|
2009-09-30 12:51:44 -04:00
|
|
|
] times
|
|
|
|
result . ;
|
|
|
|
|
2012-07-19 20:35:47 -04:00
|
|
|
MAIN: 3d-matrix-scalar-benchmark
|