diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/ChangeLog | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/media9.pdf | bin | 3303749 -> 3304517 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/media9/media9.tex | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js | 333 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/media9/media9.sty | 10 |
5 files changed, 175 insertions, 181 deletions
diff --git a/Master/texmf-dist/doc/latex/media9/ChangeLog b/Master/texmf-dist/doc/latex/media9/ChangeLog index 32ddd90f0e8..53f900fc067 100644 --- a/Master/texmf-dist/doc/latex/media9/ChangeLog +++ b/Master/texmf-dist/doc/latex/media9/ChangeLog @@ -1,3 +1,8 @@ +2013-11-26 + * v0.36 + * fix: Postscript error with zero size media annotations + * change: updated 3Dmenu.js, transformation of mesh group nodes now possible + 2013-11-15 * v0.35 * new: play button overlay, can be disabled with new option `noplaybutton' @@ -14,7 +19,7 @@ 2013-09-24 * v0.33 - * Fix: Adobe Reader prompting for "save changes" on closing + * fix: Adobe Reader prompting for "save changes" on closing 2013-09-06 * v0.32 diff --git a/Master/texmf-dist/doc/latex/media9/media9.pdf b/Master/texmf-dist/doc/latex/media9/media9.pdf Binary files differindex 3602166a841..8fd8b61dfd5 100644 --- a/Master/texmf-dist/doc/latex/media9/media9.pdf +++ b/Master/texmf-dist/doc/latex/media9/media9.pdf diff --git a/Master/texmf-dist/doc/latex/media9/media9.tex b/Master/texmf-dist/doc/latex/media9/media9.tex index e6187eee6dd..186d50bb6c2 100644 --- a/Master/texmf-dist/doc/latex/media9/media9.tex +++ b/Master/texmf-dist/doc/latex/media9/media9.tex @@ -310,11 +310,11 @@ Switches from the default perspective to orthographic view mode. In orthographic \begin{verbatim} 3Dmenu \end{verbatim} -Mainly used during document authoring. Adds three entries, `\emph{\sffamily Generate Default View}', `\emph{\sffamily Get Current View}' and `\emph{\sffamily Cross Section}' to the context (right-click) menu of an activated 3D annotation. Moreover, it allows individual parts of the scene to be scaled, translated and rotated against the remaining scene objects using the keyboard. Their new position can be saved in the current view. Parts to be modified should be highlighted with the mouse first (the part's bounding box becomes visible). Then, arrow keys \keys{\arrowkeyleft}, \keys{\arrowkeyright} let the part spin around its vertical axis, and \keys{\arrowkeyup}, \keys{\arrowkeydown} tilt against the vertical position. \keys{X}, \keys{\shift+X}, \keys{Y}, \keys{\shift+Y}, \keys{Z}, \keys{\shift+Z} translate the selected part along the World axes and \keys{S}, \keys{\shift+S} scale the part. +Mainly used during document authoring. Adds three entries, `\emph{\sffamily Generate Default View}', `\emph{\sffamily Get Current View}' and `\emph{\sffamily Cross Section}' to the context (right-click) menu of an activated 3D annotation. Moreover, it allows single parts or part groups of the scene to be scaled, translated and rotated against the remaining scene objects using the keyboard. Their new position can be saved in the current view (`\emph{\sffamily Get Current View}'). At first, parts to be modified must be highlighted by clicking either into the scene or into the model tree (the part's bounding box becomes visible). Then, arrow keys \keys{\arrowkeyleft}, \keys{\arrowkeyright} let the part spin around the vertical axis, and \keys{\arrowkeyup}, \keys{\arrowkeydown} tilt against it. In order to spin parts around their local up-axis, keep \keys{\ctrl} pressed while using \keys{\arrowkeyleft} and \keys{\arrowkeyright}. Keys \keys{X}, \keys{\shift+X}, \keys{Y}, \keys{\shift+Y}, \keys{Z}, \keys{\shift+Z} translate the selected part along the World axes, and \keys{S}, \keys{\shift+S} scale the part. `\emph{\sffamily Generate Default View}' computes optimal camera settings such that the visible parts of the 3D scene fit tightly into the viewing area. The result is printed, formatted as a list of \verb+\includemedia+ options, into the JavaScript console. The calculation is based on the 3D object size and its position in the World coordinate system as well as the current viewing mode (perspective or orthographic). -`\emph{\sffamily Cross Section}' is a toggle switch to add or remove a cross section to or from the current view. If a part of the 3D scene was previously selected, the central rotating point of the section plane is put into the part's centre, otherwise into the target point of the camera. The section plane can be rotated around the vertical axis and tilted against its upright position using the arrow keys \keys{\arrowkeyleft}, \keys{\arrowkeyright}, \keys{\arrowkeyup} and \keys{\arrowkeydown}. Keys \keys{X}, \keys{\shift+X}, \keys{Y}, \keys{\shift+Y}, \keys{Z}, \keys{\shift+Z} move the section plane along the World axes. +`\emph{\sffamily Cross Section}' is a toggle switch to add or remove a cross section to or from the current view. If a part of the 3D scene was previously selected, the central rotating point of the section plane is put into the part's centre, otherwise into the target point of the camera. The section plane can be rotated around the vertical axis and tilted against its upright position using the arrow keys \keys{\arrowkeyleft}, \keys{\arrowkeyright}, \keys{\arrowkeyup} and \keys{\arrowkeydown}. Keys \keys{X}, \keys{\shift+X}, \keys{Y}, \keys{\shift+Y}, \keys{Z}, \keys{\shift+Z} move the section plane along the World axes, and \keys{S}, \keys{\shift+S} scale its size. `\emph{\sffamily Get Current View}' writes camera settings, any part alterations, an optional cross section as well as part and scene rendering attributes of the current view into the JavaScript console. The output is a readily formatted \verb+VIEW+ section to be inserted into or appended to a file of predefined views. See option `\verb+3Dviews+'. All settings reachable via the `\emph{\sffamily Part Options}' and `\emph{\sffamily Viewing Options}' context menu items are written to the \verb+VIEW+ section. \begin{verbatim} @@ -827,7 +827,7 @@ Currently, two open-source software packages are known to export into the PRC fi MeshLab~\cite{meshlab} is an open-source conversion and processing software for 3D mesh data which can import from and export to a number of file formats. Its U3D export filter is based on the open-source `Universal 3D Sample Software'~\cite{u3dlib}. -There are a few options to \verb+\includemedia+ which define how the 3D object is positioned within the view port of a virtual camera, or conversely, how the virtual camera is positioned and oriented within a coordinate system, called `The World', which bears the 3D object at a fixed position. Fig.~\ref{3dscene} should help to visualize the scenery: The virtual camera is orbiting at a distance of $ROO$ (option `\verb+3Droo+') around the centre of orbit, specified by the position vector $\overrightarrow{COO}$ (option `\verb+3Dcoo+'); $\sphericalangle AAC$ (option `\verb+3Daac+') is the camera's aperture angle. The direction vector $\overrightarrow{C2C}$ (option `\verb+3Dc2c+') is needed to specify the initial camera position. The camera may be given an initial roll angle (option `\verb+3Droll+') around its optical axis $(-1)\cdot\overrightarrow{C2C}$. +There are a few options to \verb+\includemedia+ which define how the 3D object is positioned within the view port of a virtual camera, or conversely, how the virtual camera is positioned and oriented within a coordinate system, called `The World', which bears the 3D object at a fixed position. Fig.~\ref{3dscene} should help to grasp the scenery: The virtual camera is orbiting at a distance of $ROO$ (option `\verb+3Droo+') around the centre of orbit, specified by the position vector $\overrightarrow{COO}$ (option `\verb+3Dcoo+'); $\sphericalangle AAC$ (option `\verb+3Daac+') is the camera's aperture angle. The direction vector $\overrightarrow{C2C}$ (option `\verb+3Dc2c+') is needed to specify the initial camera position. The camera may be given an initial roll angle (option `\verb+3Droll+') around its optical axis $(-1)\cdot\overrightarrow{C2C}$. \begin{figure}[ht] \resizebox{\linewidth}{!}{\input{files/3dsystem}} \caption{Camera and 3D object in the World System $XYZ$; centre of orbit position vector \usebox{\COO}, centre of orbit to camera direction vector \usebox{\CtoC}, radius of orbit $ROO$, aperture angle of camera $\sphericalangle AAC$.}\label{3dscene} diff --git a/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js b/Master/texmf-dist/tex/latex/media9/javascript/3Dmenu.js index 20bf5a8a55a..a0b04d915ae 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 20120912 +// version 20131126 // //////////////////////////////////////////////////////////////////////////////// // @@ -30,13 +30,15 @@ // // Toggle switch to add or remove a cross section into or from the current // view. The cross section can be moved in the x, y, z directions using x, -// y, z and X, Y, Z keys on the keyboard and be tilted against and spun -// around the upright Z axis using the Up/Down and Left/Right arrow keys. +// y, z and X, Y, Z keys on the keyboard, be tilted against and spun +// around the upright Z axis using the Up/Down and Left/Right arrow keys +// and caled using the s and S keys. // -// 2.) Enables manipulation of position and orientation of indiviual parts in -// the 3D scene. Parts which have been selected with the mouse can be -// moved around and rotated like the cross section as described above, as -// well as scaled using the s and S keys. +// 2.) Enables manipulation of position and orientation of indiviual parts and +// groups of parts in the 3D scene. Parts which have been selected with the +// mouse can be scaled moved around and rotated like the cross section as +// described above. To spin the parts around their local up-axis, keep +// Control key pressed while using the Up/Down and Left/Right arrow keys. // // This work may be distributed and/or modified under the // conditions of the LaTeX Project Public License, either version 1.3 @@ -55,7 +57,7 @@ // set of points; see: http://www.inf.ethz.ch/personal/gaertner/miniball.html // //////////////////////////////////////////////////////////////////////////////// -//host.console.show(); +host.console.show(); //constructor for doubly linked list function List(){ @@ -498,78 +500,81 @@ function get3Dview () { } if(defaultrender!='Solid') res+=' RENDERMODE='+defaultrender+'\n'; - for(var i=0;i<scene.meshes.count;i++){ - var mesh=scene.meshes.getByIndex(i); - var meshUTFName = ''; - for (var j=0; j<mesh.name.length; j++) { - var theUnicode = mesh.name.charCodeAt(j).toString(16); + for(var i=0;i<scene.nodes.count;i++){ + var nd=scene.nodes.getByIndex(i); + if(nd.constructor.name!='Mesh'&&nd.constructor.name!='Node3') continue; + var ndUTFName = ''; + for (var j=0; j<nd.name.length; j++) { + var theUnicode = nd.name.charCodeAt(j).toString(16); while (theUnicode.length<4) theUnicode = '0' + theUnicode; - meshUTFName += theUnicode; + ndUTFName += theUnicode; } - var end=mesh.name.lastIndexOf('.'); - if(end>0) var meshUserName=mesh.name.substr(0,end); - else var meshUserName=mesh.name; - respart=' PART='+meshUserName+'\n'; - respart+=' UTF16NAME='+meshUTFName+'\n'; + var end=nd.name.lastIndexOf('.'); + if(end>0) var ndUserName=nd.name.substr(0,end); + else var ndUserName=nd.name; + respart=' PART='+ndUserName+'\n'; + respart+=' UTF16NAME='+ndUTFName+'\n'; defaultvals=true; - if(!mesh.visible){ + if(!nd.visible){ respart+=' VISIBLE=false\n'; defaultvals=false; } - if(mesh.opacity<1.0){ - respart+=' OPACITY='+mesh.opacity+'\n'; + if(nd.opacity<1.0){ + respart+=' OPACITY='+nd.opacity+'\n'; defaultvals=false; } - currender=defaultrender; - switch(mesh.renderMode){ - case scene.RENDER_MODE_BOUNDING_BOX: - currender='BoundingBox';break; - case scene.RENDER_MODE_TRANSPARENT_BOUNDING_BOX: - currender='TransparentBoundingBox';break; - case scene.RENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE: - currender='TransparentBoundingBoxOutline';break; - case scene.RENDER_MODE_VERTICES: - currender='Vertices';break; - case scene.RENDER_MODE_SHADED_VERTICES: - currender='ShadedVertices';break; - case scene.RENDER_MODE_WIREFRAME: - currender='Wireframe';break; - case scene.RENDER_MODE_SHADED_WIREFRAME: - currender='ShadedWireframe';break; - case scene.RENDER_MODE_SOLID: - currender='Solid';break; - case scene.RENDER_MODE_TRANSPARENT: - currender='Transparent';break; - case scene.RENDER_MODE_SOLID_WIREFRAME: - currender='SolidWireframe';break; - case scene.RENDER_MODE_TRANSPARENT_WIREFRAME: - currender='TransparentWireframe';break; - case scene.RENDER_MODE_ILLUSTRATION: - currender='Illustration';break; - case scene.RENDER_MODE_SOLID_OUTLINE: - currender='SolidOutline';break; - case scene.RENDER_MODE_SHADED_ILLUSTRATION: - currender='ShadedIllustration';break; - case scene.RENDER_MODE_HIDDEN_WIREFRAME: - currender='HiddenWireframe';break; - //case scene.RENDER_MODE_DEFAULT: - // currender='Default';break; - } - if(currender!=defaultrender){ - respart+=' RENDERMODE='+currender+'\n'; - defaultvals=false; + if(nd.constructor.name=='Mesh'){ + currender=defaultrender; + switch(nd.renderMode){ + case scene.RENDER_MODE_BOUNDING_BOX: + currender='BoundingBox';break; + case scene.RENDER_MODE_TRANSPARENT_BOUNDING_BOX: + currender='TransparentBoundingBox';break; + case scene.RENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE: + currender='TransparentBoundingBoxOutline';break; + case scene.RENDER_MODE_VERTICES: + currender='Vertices';break; + case scene.RENDER_MODE_SHADED_VERTICES: + currender='ShadedVertices';break; + case scene.RENDER_MODE_WIREFRAME: + currender='Wireframe';break; + case scene.RENDER_MODE_SHADED_WIREFRAME: + currender='ShadedWireframe';break; + case scene.RENDER_MODE_SOLID: + currender='Solid';break; + case scene.RENDER_MODE_TRANSPARENT: + currender='Transparent';break; + case scene.RENDER_MODE_SOLID_WIREFRAME: + currender='SolidWireframe';break; + case scene.RENDER_MODE_TRANSPARENT_WIREFRAME: + currender='TransparentWireframe';break; + case scene.RENDER_MODE_ILLUSTRATION: + currender='Illustration';break; + case scene.RENDER_MODE_SOLID_OUTLINE: + currender='SolidOutline';break; + case scene.RENDER_MODE_SHADED_ILLUSTRATION: + currender='ShadedIllustration';break; + case scene.RENDER_MODE_HIDDEN_WIREFRAME: + currender='HiddenWireframe';break; + //case scene.RENDER_MODE_DEFAULT: + // currender='Default';break; + } + if(currender!=defaultrender){ + respart+=' RENDERMODE='+currender+'\n'; + defaultvals=false; + } } - if(!mesh.transform.isEqual(origtrans[mesh.name])){ - var lvec=mesh.transform.transformDirection(new Vector3(1,0,0)); - var uvec=mesh.transform.transformDirection(new Vector3(0,1,0)); - var vvec=mesh.transform.transformDirection(new Vector3(0,0,1)); + if(!nd.transform.isEqual(origtrans[nd.name])){ + var lvec=nd.transform.transformDirection(new Vector3(1,0,0)); + var uvec=nd.transform.transformDirection(new Vector3(0,1,0)); + var vvec=nd.transform.transformDirection(new Vector3(0,0,1)); respart+=' TRANSFORM=' +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'; + +nd.transform.translation.x+' ' + +nd.transform.translation.y+' ' + +nd.transform.translation.z+'\n'; defaultvals=false; } respart+=' END\n'; @@ -626,14 +631,14 @@ menuEventHandler.onEvent = function(e) { }; runtime.addEventHandler(menuEventHandler); -//global variable taking reference to currently selected mesh node; -var mshSelected=null; +//global variable taking reference to currently selected node; +var target=null; selectionEventHandler=new SelectionEventHandler(); selectionEventHandler.onEvent=function(e){ - if(e.selected && e.node.constructor.name=="Mesh"){ - mshSelected=e.node; + if(e.selected){ + target=e.node; }else{ - mshSelected=null; + target=null; } } runtime.addEventHandler(selectionEventHandler); @@ -651,18 +656,23 @@ cameraEventHandler.onEvent=function(e){ runtime.addCustomMenuItem("csection", "Cross Section", "checked", 1); } } + + for(var i=0; i<rot4x4.length; i++){ + rot4x4[i].setIdentity() + } } runtime.addEventHandler(cameraEventHandler); -//key event handler for moving, spinning and tilting objects +var rot4x4=new Array(); //keeps track of spin and tilt axes transformations +//key event handler for scaling moving, spinning and tilting objects keyEventHandler=new KeyEventHandler(); keyEventHandler.onEvent=function(e){ - var target=null; var backtrans=new Matrix4x4(); - if(mshSelected){ - target=mshSelected; - var trans=target.transform; - var parent=target.parent; + if(target) { + var backtrans=new Matrix4x4(); + var trgt=target; + var trans=trgt.transform; + var parent=trgt.parent; while(parent.transform){ //build local to world transformation matrix trans.multiplyInPlace(parent.transform); @@ -672,91 +682,92 @@ keyEventHandler.onEvent=function(e){ } backtrans.transposeInPlace(); }else{ + var ndcnt=scene.nodes.count; try { - target=scene.nodes.getByName("Clipping Plane"); + var trgt=scene.nodes.getByName("Clipping Plane"); }catch(e){ - var ndcnt=scene.nodes.count; - target=scene.createClippingPlane(); - if(ndcnt!=scene.nodes.count){ - target.remove(); - target=null; - } + var trgt=scene.createClippingPlane(); } + if(ndcnt==scene.nodes.count){ + var trans=trgt.transform; + }else{ + trgt.remove(); + return; + } + } + + var tname=trgt.name; + if(typeof(rot4x4[tname])=='undefined') rot4x4[tname]=new Matrix4x4(); + var tiltAxis=rot4x4[tname].transformDirection(new Vector3(0,1,0)); + var spinAxis=rot4x4[tname].transformDirection(new Vector3(0,0,1)); + + //get the centre of the mesh + if(trgt.constructor.name=='Mesh'){ + var centre=trans.transformPosition(trgt.computeBoundingBox().center); + }else{ //part group (Node3 parent node) + var centre=new Vector3(trans.translation); } - if(!target) return; switch(e.characterCode){ case 30://tilt up - tiltTarget(target, -Math.PI/900); + rot4x4[tname].rotateAboutLineInPlace(-Math.PI/900,rot4x4[tname].translation,tiltAxis); + trans.rotateAboutLineInPlace(-Math.PI/900,centre,tiltAxis); break; case 31://tilt down - tiltTarget(target, Math.PI/900); + rot4x4[tname].rotateAboutLineInPlace(Math.PI/900,rot4x4[tname].translation,tiltAxis); + trans.rotateAboutLineInPlace(Math.PI/900,centre,tiltAxis); break; case 28://spin right - spinTarget(target, -Math.PI/900); + if(e.ctrlKeyDown&&target){ + rot4x4[tname].rotateAboutLineInPlace(-Math.PI/900,rot4x4[tname].translation,spinAxis); + trans.rotateAboutLineInPlace(-Math.PI/900,centre,spinAxis); + }else{//allow clipping plane be spun around world z only + rot4x4[tname].rotateAboutLineInPlace(-Math.PI/900,rot4x4[tname].translation,new Vector3(0,0,1)); + trans.rotateAboutLineInPlace(-Math.PI/900,centre,new Vector3(0,0,1)); + } break; case 29://spin left - spinTarget(target, Math.PI/900); + if(e.ctrlKeyDown&&target){ + rot4x4[tname].rotateAboutLineInPlace(Math.PI/900,rot4x4[tname].translation,spinAxis); + trans.rotateAboutLineInPlace(Math.PI/900,centre,spinAxis); + }else{ + rot4x4[tname].rotateAboutLineInPlace(Math.PI/900,rot4x4[tname].translation,new Vector3(0,0,1)); + trans.rotateAboutLineInPlace(Math.PI/900,centre,new Vector3(0,0,1)); + } break; case 120: //x - translateTarget(target, new Vector3(1,0,0), e); + translateTarget(trans, new Vector3(1,0,0), e); break; case 121: //y - translateTarget(target, new Vector3(0,1,0), e); + translateTarget(trans, new Vector3(0,1,0), e); break; case 122: //z - translateTarget(target, new Vector3(0,0,1), e); + translateTarget(trans, new Vector3(0,0,1), e); break; case 88: //shift + x - translateTarget(target, new Vector3(-1,0,0), e); + translateTarget(trans, new Vector3(-1,0,0), e); break; case 89: //shift + y - translateTarget(target, new Vector3(0,-1,0), e); + translateTarget(trans, new Vector3(0,-1,0), e); break; case 90: //shift + z - translateTarget(target, new Vector3(0,0,-1), e); + translateTarget(trans, new Vector3(0,0,-1), e); break; case 115: //s - scaleTarget(target, 1, e); + trans.translateInPlace(centre.scale(-1)); + trans.scaleInPlace(1.01); + trans.translateInPlace(centre.scale(1)); break; case 83: //shift + s - scaleTarget(target, -1, e); + trans.translateInPlace(centre.scale(-1)); + trans.scaleInPlace(1/1.01); + trans.translateInPlace(centre.scale(1)); break; } - if(mshSelected) - target.transform.multiplyInPlace(backtrans); + trans.multiplyInPlace(backtrans); } runtime.addEventHandler(keyEventHandler); -function tiltTarget(t,a){ - var centre=new Vector3(); - if(mshSelected) { - centre.set(t.transform.transformPosition(t.computeBoundingBox().center)); - }else{ - centre.set(t.transform.translation); - } - var rotVec=t.transform.transformDirection(new Vector3(0,1,0)); - rotVec.normalize(); - t.transform.translateInPlace(centre.scale(-1)); - t.transform.rotateAboutVectorInPlace(a, rotVec); - t.transform.translateInPlace(centre); -} - -function spinTarget(t,a){ - var centre=new Vector3(); - var rotVec=new Vector3(0,0,1); - if(mshSelected) { - centre.set(t.transform.transformPosition(t.computeBoundingBox().center)); - rotVec.set(t.transform.transformDirection(rotVec)); - rotVec.normalize(); - }else{ - centre.set(t.transform.translation); - } - t.transform.translateInPlace(centre.scale(-1)); - t.transform.rotateAboutVectorInPlace(a, rotVec); - t.transform.translateInPlace(centre); -} - -//translates object by amount calculated based on Canvas size +//translates object by amount calculated from Canvas size function translateTarget(t, d, e){ var cam=scene.cameras.getByIndex(0); if(cam.projectionType==cam.TYPE_PERSPECTIVE){ @@ -767,34 +778,7 @@ function translateTarget(t, d, e){ var scale=cam.viewPlaneSize/2 /Math.min(e.canvasPixelWidth,e.canvasPixelHeight); } - t.transform.translateInPlace(d.scale(scale)); -} - -//scales object by amount calculated based on Canvas size -function scaleTarget(t, d, e){ - if(mshSelected) { - var bbox=t.computeBoundingBox(); - var diag=new Vector3(bbox.max.x, bbox.max.y, bbox.max.z); - diag.subtractInPlace(bbox.min); - var dlen=diag.length; - - var cam=scene.cameras.getByIndex(0); - if(cam.projectionType==cam.TYPE_PERSPECTIVE){ - var scale=Math.tan(cam.fov/2) - *cam.targetPosition.subtract(cam.position).length - /dlen - /Math.min(e.canvasPixelWidth,e.canvasPixelHeight); - }else{ - var scale=cam.viewPlaneSize/2 - /dlen - /Math.min(e.canvasPixelWidth,e.canvasPixelHeight); - } - var centre=new Vector3(); - centre.set(t.transform.transformPosition(t.computeBoundingBox().center)); - t.transform.translateInPlace(centre.scale(-1)); - t.transform.scaleInPlace(1+d*scale); - t.transform.translateInPlace(centre); - } + t.translateInPlace(d.scale(scale)); } function addremoveClipPlane(chk) { @@ -803,21 +787,19 @@ function addremoveClipPlane(chk) { //add Clipping Plane and place its center either into the camera target //position or into the centre of the currently selected mesh node var centre=new Vector3(); - if(mshSelected){ - //local to parent transformation matrix - var trans=mshSelected.transform; - //build local to world transformation matrix by recursively - //multiplying the parent's transf. matrix on the right - var parent=mshSelected.parent; + if(target){ + var trans=target.transform; + var parent=target.parent; while(parent.transform){ trans=trans.multiply(parent.transform); parent=parent.parent; } - //get the centre of the mesh (local coordinates) - centre.set(mshSelected.computeBoundingBox().center); - //transform the local coordinates to world coords - centre.set(trans.transformPosition(centre)); - mshSelected=null; + if(target.constructor.name=='Mesh'){ + var centre=trans.transformPosition(target.computeBoundingBox().center); + }else{ + var centre=new Vector3(trans.translation); + } + target=null; }else{ centre.set(scene.cameras.getByIndex(0).targetPosition); } @@ -829,13 +811,14 @@ function addremoveClipPlane(chk) { } } -//function to store current transformation matrix of all mesh nodes in the scene +//function to store current transformation matrix of all nodes in the scene function getCurTrans() { - var nc=scene.meshes.count; + var nc=scene.nodes.count; var tA=new Array(nc); for(var i=0; i<nc; i++){ - var cm=scene.meshes.getByIndex(i); - tA[cm.name]=new Matrix4x4(cm.transform); + var nd=scene.nodes.getByIndex(i); + if(nd.constructor.name!='Mesh'&&nd.constructor.name!='Node3') continue; + tA[nd.name]=new Matrix4x4(nd.transform); } return tA; } @@ -843,8 +826,8 @@ function getCurTrans() { //function to restore transformation matrices given as arg function restoreTrans(tA) { for(var i=0; i<tA.length; i++){ - var msh=scene.meshes.getByIndex(i); - msh.transform.set(tA[msh.name]); + var nd=scene.nodes.getByIndex(i); + nd.transform.set(tA[nd.name]); } } diff --git a/Master/texmf-dist/tex/latex/media9/media9.sty b/Master/texmf-dist/tex/latex/media9/media9.sty index 0f381901d79..d19a615d251 100644 --- a/Master/texmf-dist/tex/latex/media9/media9.sty +++ b/Master/texmf-dist/tex/latex/media9/media9.sty @@ -42,8 +42,8 @@ \RequirePackage{atbegshi} \RequirePackage{tikz} -\def\g@mix@date@tl{2013/11/15} -\def\g@mix@version@tl{0.35} +\def\g@mix@date@tl{2013/11/26} +\def\g@mix@version@tl{0.36} \def\g@mix@liiikerneldate{2013/07/28} \def\g@mix@liiipkgdate{2013/07/28} @@ -1179,6 +1179,12 @@ \tl_greplace_all:Nnn\g_mix_flashvars_tl{=~}{=} \tl_gtrim_spaces:N\g_mix_flashvars_tl \mix_scale:n{\l_mix_poster_box} + \bool_if:nT{ + \dim_compare_p:n{\l_mix_tt_tl=\c_zero_dim}|| + \dim_compare_p:n{\l_mix_wd_tl=\c_zero_dim} + }{ + \bool_gset_false:N\g_mix_usrpbtn_bool + } \bool_if:NTF\g_mix_usrdraft_bool{ \tl_if_empty:NF\g_mix_usrlabel_tl{ \mix_keytoaux_now:nn{ann@\g_mix_usrlabel_tl}{draft} |