diff options
author | Karl Berry <karl@freefriends.org> | 2012-08-14 23:28:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-08-14 23:28:44 +0000 |
commit | 4434165a72f0b014b89cb12bcfdc38307a59352e (patch) | |
tree | ca6f715d2725a5a4a59b16e3f04147471fdd96aa /Master/texmf-dist/tex/latex/media9/javascript | |
parent | c33dd0f6eb3ee533df663d363845fc7d22578ba6 (diff) |
media9 (14aug12)
git-svn-id: svn://tug.org/texlive/trunk@27407 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/media9/javascript')
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js | 60 |
1 files changed, 19 insertions, 41 deletions
diff --git a/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js b/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js index b6c82a22876..a987b5ed08c 100644 --- a/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js +++ b/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js @@ -4,7 +4,7 @@ // // 3Dmenu.js // -// version 20120301 +// version 20120813 // //////////////////////////////////////////////////////////////////////////////// // @@ -311,20 +311,14 @@ function calc3Dopts () { c2c.set(camera.position); c2c.subtractInPlace(camera.targetPosition); c2c.normalize(); - var x=(Math.abs(c2c.x) < 1e-12 ? 0 : c2c.x); - var y=(Math.abs(c2c.y) < 1e-12 ? 0 : c2c.y); - var z=(Math.abs(c2c.z) < 1e-12 ? 0 : c2c.z); - if(!(x==0 && y==-1 && z==0)) - res+=host.util.printf('\n3Dc2c=%s %s %s,', x, y, z); + if(!(c2c.x==0 && c2c.y==-1 && c2c.z==0)) + res+=host.util.printf('\n3Dc2c=%s %s %s,', c2c.x, c2c.y, c2c.z); // //new camera settings // //bounding sphere centre --> new camera target var coo=new Vector3(); coo.set((mb.center())[0], (mb.center())[1], (mb.center())[2]); - coo.x = (Math.abs(coo.x) < 1e-12 ? 0 : coo.x); - coo.y = (Math.abs(coo.y) < 1e-12 ? 0 : coo.y); - coo.z = (Math.abs(coo.z) < 1e-12 ? 0 : coo.z); if(coo.length) res+=host.util.printf('\n3Dcoo=%s %s %s,', coo.x, coo.y, coo.z); //radius of orbit @@ -422,17 +416,11 @@ function get3Dview () { var roo=c2c.length; c2c.normalize(); var res='VIEW%=insert optional name here\n'; - var x = (Math.abs(coo.x) < 1e-12 ? 0 : coo.x); - var y = (Math.abs(coo.y) < 1e-12 ? 0 : coo.y); - var z = (Math.abs(coo.z) < 1e-12 ? 0 : coo.z); - if(!(x==0 && y==0 && z==0)) + if(!(coo.x==0 && coo.y==0 && coo.z==0)) res+=host.util.printf(' COO=%s %s %s\n', coo.x, coo.y, coo.z); - x = (Math.abs(c2c.x) < 1e-12 ? 0 : c2c.x); - y = (Math.abs(c2c.y) < 1e-12 ? 0 : c2c.y); - z = (Math.abs(c2c.z) < 1e-12 ? 0 : c2c.z); - if(!(x==0 && y==-1 && z==0)) - res+=host.util.printf(' C2C=%s %s %s\n', x, y, z); - if(roo > 0.11e-17) + if(!(c2c.x==0 && c2c.y==-1 && c2c.z==0)) + res+=host.util.printf(' C2C=%s %s %s\n', c2c.x, c2c.y, c2c.z); + if(roo > 1e-9) res+=host.util.printf(' ROO=%s\n', roo); var roll = camera.roll*180/Math.PI; if(host.util.printf('%.4f', roll)!=0) @@ -576,18 +564,12 @@ function get3Dview () { var uvec=mesh.transform.transformDirection(new Vector3(0,1,0)); var vvec=mesh.transform.transformDirection(new Vector3(0,0,1)); respart+=' TRANSFORM=' - +(Math.abs(lvec.x) < 1e-12 ? 0 : lvec.x)+' ' - +(Math.abs(lvec.y) < 1e-12 ? 0 : lvec.y)+' ' - +(Math.abs(lvec.z) < 1e-12 ? 0 : lvec.z)+' ' - +(Math.abs(uvec.x) < 1e-12 ? 0 : uvec.x)+' ' - +(Math.abs(uvec.y) < 1e-12 ? 0 : uvec.y)+' ' - +(Math.abs(uvec.z) < 1e-12 ? 0 : uvec.z)+' ' - +(Math.abs(vvec.x) < 1e-12 ? 0 : vvec.x)+' ' - +(Math.abs(vvec.y) < 1e-12 ? 0 : vvec.y)+' ' - +(Math.abs(vvec.z) < 1e-12 ? 0 : vvec.z)+' ' - +(Math.abs(mesh.transform.translation.x) < 1e-12 ? 0 : mesh.transform.translation.x)+' ' - +(Math.abs(mesh.transform.translation.y) < 1e-12 ? 0 : mesh.transform.translation.y)+' ' - +(Math.abs(mesh.transform.translation.z) < 1e-12 ? 0 : mesh.transform.translation.z)+'\n'; + +lvec.x+' '+lvec.y+' '+lvec.z+' ' + +uvec.x+' '+uvec.y+' '+uvec.z+' ' + +vvec.x+' '+vvec.y+' '+vvec.z+' ' + +mesh.transform.translation.x+' ' + +mesh.transform.translation.y+' ' + +mesh.transform.translation.z+'\n'; defaultvals=false; } respart+=' END\n'; @@ -610,16 +592,12 @@ function get3Dview () { var centre=clip.transform.translation; var normal=clip.transform.transformDirection(new Vector3(0,0,1)); res+=' CROSSSECT\n'; - var x = (Math.abs(centre.x) < 1e-12 ? 0 : centre.x); - var y = (Math.abs(centre.y) < 1e-12 ? 0 : centre.y); - var z = (Math.abs(centre.z) < 1e-12 ? 0 : centre.z); - if(!(x==0 && y==0 && z==0)) - res+=host.util.printf(' CENTER=%s %s %s\n', x, y, z); - var x = (Math.abs(normal.x) < 1e-12 ? 0 : normal.x); - var y = (Math.abs(normal.y) < 1e-12 ? 0 : normal.y); - var z = (Math.abs(normal.z) < 1e-12 ? 0 : normal.z); - if(!(x==1 && y==0 && z==0)) - res+=host.util.printf(' NORMAL=%s %s %s\n', x, y, z); + if(!(centre.x==0 && centre.y==0 && centre.z==0)) + res+=host.util.printf( + ' CENTER=%s %s %s\n', centre.x, centre.y, centre.z); + if(!(normal.x==1 && normal.y==0 && normal.z==0)) + res+=host.util.printf( + ' NORMAL=%s %s %s\n', normal.x, normal.y, normal.z); res+=' END\n'; } res+='END\n'; |