From 5c42b69d208464a8070a44f3f7254c5b5a49dc03 Mon Sep 17 00:00:00 2001 From: sandb Date: Mon, 22 Mar 2010 00:10:16 +0100 Subject: [PATCH] added debug multiply to macs, added eot support to .htaccess, improved projection performance by removing some unnecessary calculations --- .htaccess | 1 - db/pamela.sql | Bin 8192 -> 0 bytes js/pamela-matrices.js | 5 +++-- macs.php | 12 ++++++++++++ 4 files changed, 15 insertions(+), 3 deletions(-) delete mode 100644 db/pamela.sql diff --git a/.htaccess b/.htaccess index 77a26fa..82f84f7 100644 --- a/.htaccess +++ b/.htaccess @@ -3,4 +3,3 @@ AddType application/vnd.ms-fontobject .eot RewriteRule (.*).php $1 RewriteRule (.*).hmtl $1 - diff --git a/db/pamela.sql b/db/pamela.sql deleted file mode 100644 index a76a9df196255ae7ff4a508d926af31efcb27630..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeI0J#W)M7{{MBR>+V621++hs8nebRrbX`+s|iU0Kvd|K3}NS#Ay>peUXql!p6wV zS3p910EV(NAvP91LPze-zEoAarYh)8j%A;J_q_a_dvv~jpS;>D=44ciB@xrI;zc

7jMKv||B-jDn14BJXH4iq`IoIRX+T8~m zo4KkVV_8Fn3_;8!SLMY#AjY1yN-B9=kwsY?E+mDzLB#X?XsyuzV_+0yIZ@y-^99KPLE3C;7Y*DZit%kI`>mOzSZt-kSC{g%$MBd z6}uY!@&V~B=5ki#HnM?E%%n6RC07ya>;~juR!sQpgzU=`qLUtwdf1N6cr@*Z$(1FDG^URr; z$=-TMu2+G8vUr&INyy;b)q-1nN6wj3V08*~;KI%4)yeBDI|c5v0&f1_>DS|ea|*0b zfe!pp`+Ry2O@9aI^?!@k>wn5HGg|;O!!!rA{%2{FFts62^Lv&*Z1@N>fhorzLcuMc z_?G`@`L_)pAj?n)j2T9u4yUt%&{(a2{0%?Sak1<6`8$R{b z_ls^G^iQ4vvZs>PiP64OD|E<7Zw_xS< diff --git a/js/pamela-matrices.js b/js/pamela-matrices.js index bbf3011..adcc1f4 100644 --- a/js/pamela-matrices.js +++ b/js/pamela-matrices.js @@ -151,8 +151,9 @@ Matrix.prototype.translate = function(dX, dY, dZ) { Matrix.prototype.project = function(v) { var pj = this.multiplyVector(v); - pj.x /= pj.z / (width / 2); - pj.y /= pj.z / (width / 2); + var distancePerHalfScreen = (pj.z / pj.w) / (width / 2); + pj.x /= distancePerHalfScreen; + pj.y /= distancePerHalfScreen; return pj; }; diff --git a/macs.php b/macs.php index d2aaf6e..574145a 100644 --- a/macs.php +++ b/macs.php @@ -27,9 +27,21 @@ require_once("config.php"); require_once("lib/trans.php"); require_once("lib/macs.php"); +// for debug purposes, increases the numbers of macs artificially +function multiply() { + global $macs; + $c = count($macs); + for ($j = 0; $j < $c; $j++) { + for ($i = 0; $i <10; $i++) { + $macs[] = $macs[$j].$i; + } + } +} + $macs = macs_get(); $macs = known_macs_translate($macs); if (count($macs) > 0) { + //multiply(); echo '["'.implode('", "', $macs).'"]'; } else { echo '[]';