diff options
author | Karl Berry <karl@freefriends.org> | 2009-03-23 23:56:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-03-23 23:56:40 +0000 |
commit | c36a93508014f2ba14a09dec8f70a39577ac6470 (patch) | |
tree | 3508ef9b31d96c2c824aff72c23c9eb7e7f78058 | |
parent | f3e4da8de0bec75f027ec22af12443c9cfa2a0f6 (diff) |
movie15 update (23mar09)
git-svn-id: svn://tug.org/texlive/trunk@12504 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/movie15/dice.vws | 30 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/movie15/lights.js | 84 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/movie15/movie15.pdf | bin | 346920 -> 470741 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/movie15/movie15.tex | 192 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/movie15/turntable.js | 3 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/movie15/movie15.sty | 857 |
6 files changed, 927 insertions, 239 deletions
diff --git a/Master/texmf-dist/doc/latex/movie15/dice.vws b/Master/texmf-dist/doc/latex/movie15/dice.vws index bfd7f35ec83..3b1bd9a7a4b 100644 --- a/Master/texmf-dist/doc/latex/movie15/dice.vws +++ b/Master/texmf-dist/doc/latex/movie15/dice.vws @@ -1,7 +1,23 @@ -[Front]{}{}{27}{}{}% using defaults: coo=0 0 0 (arg #2), c2c=0 -1 0 (arg #3), roll=0 (arg #5) and aac=30 (arg #6) -[Back]{}{0 1 0}{27}{}{} -[Left]{}{-1 0 0}{27}{}{} -[Right]{}{1 0 0}{27}{}{} -[Top]{}{0 0 1}{27}{}{} -[Bottom]{}{0 0 -1}{27}{}{} -[Fish Eye at Centre]{}{}{}{}{130}% using defaults: coo=0 0 0 (arg #2), c2c=0 -1 0 (arg #3), roo=0 (arg #4), roll=0 (arg #5) +VIEW={Front} + %using defaults for COO, C2C, ROLL and AAC + ROO=27 +END +VIEW={Back} + ROO=27 + C2C=0 1 0 +END +VIEW={Left} + ROO=27 + C2C=-1 0 0 +END +VIEW={Right} + ROO=27 + C2C=1 0 0 +END +VIEW={Top} + ROO=27 + C2C=0 0 1 +END +VIEW={Fish Eye at Centre} + AAC=130 +END diff --git a/Master/texmf-dist/doc/latex/movie15/lights.js b/Master/texmf-dist/doc/latex/movie15/lights.js index 97c6175336f..ba367dfbb6b 100644 --- a/Master/texmf-dist/doc/latex/movie15/lights.js +++ b/Master/texmf-dist/doc/latex/movie15/lights.js @@ -7,45 +7,45 @@ // * Adds light sources around the object for better illumination. // //////////////////////////////////////////////////////////////////////// - -//first remove any scene lights -for (var i = scene.lights.count - 1; i >= 0; i--) { - scene.lights.removeByIndex(i); -} - -//new lights -//from left -l1 = scene.createLight(); -l1.color.set(1,1,1); -l1.brightness = .4; -l1.direction.set(1,0,0); - -//from right -l2 = scene.createLight(); -l2.color.set(1,1,1); -l2.brightness = .4; -l2.direction.set(-1,0,0); - -//from bottom -l3 = scene.createLight(); -l3.color.set(1,1,1); -l3.brightness = .4; -l3.direction.set(0,0,1); - -//from top -l4 = scene.createLight(); -l4.color.set(1,1,1); -l4.brightness = .4; -l4.direction.set(0,0,-1); - -//from front -l5 = scene.createLight(); -l5.color.set(1,1,1); -l5.brightness = .4; -l5.direction.set(0,1,0); - -//from back -l6 = scene.createLight(); -l6.color.set(1,1,1); -l6.brightness = .4; -l6.direction.set(0,-1,0); +console.println(scene.lightScheme); +////first remove any scene lights +//for (var i = scene.lights.count - 1; i >= 0; i--) { +// scene.lights.removeByIndex(i); +//} +// +////new lights +////from left +//l1 = scene.createLight(); +//l1.color.set(1,1,1); +//l1.brightness = .4; +//l1.direction.set(1,0,0); +// +////from right +//l2 = scene.createLight(); +//l2.color.set(1,1,1); +//l2.brightness = .4; +//l2.direction.set(-1,0,0); +// +////from bottom +//l3 = scene.createLight(); +//l3.color.set(1,1,1); +//l3.brightness = .4; +//l3.direction.set(0,0,1); +// +////from top +//l4 = scene.createLight(); +//l4.color.set(1,1,1); +//l4.brightness = .4; +//l4.direction.set(0,0,-1); +// +////from front +//l5 = scene.createLight(); +//l5.color.set(1,1,1); +//l5.brightness = .4; +//l5.direction.set(0,1,0); +// +////from back +//l6 = scene.createLight(); +//l6.color.set(1,1,1); +//l6.brightness = .4; +//l6.direction.set(0,-1,0); diff --git a/Master/texmf-dist/doc/latex/movie15/movie15.pdf b/Master/texmf-dist/doc/latex/movie15/movie15.pdf Binary files differindex 5ad2b84a4a1..b80429e3619 100644 --- a/Master/texmf-dist/doc/latex/movie15/movie15.pdf +++ b/Master/texmf-dist/doc/latex/movie15/movie15.pdf diff --git a/Master/texmf-dist/doc/latex/movie15/movie15.tex b/Master/texmf-dist/doc/latex/movie15/movie15.tex index 8f18cc27993..af172194d7e 100644 --- a/Master/texmf-dist/doc/latex/movie15/movie15.tex +++ b/Master/texmf-dist/doc/latex/movie15/movie15.tex @@ -101,7 +101,7 @@ final The opposite of draft. Useful to override a global draft option specified in the \verb+\documentclass+ command. -If PDF is generated via DVI and Postscript by the usual \verb+latex+ $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+ sequence of commands, the `graphicx' and `hyperref' packages are required. In the case of pdf\LaTeX{}, the `graphicx' and `hyperref' packages are not required. +If PDF is generated via DVI and Postscript by the usual \verb+latex+ $\rightarrow$ \verb+dvips+ $\rightarrow$ \verb+ps2pdf+ sequence of commands, the `graphicx' package is required. Note that several runs may be necessary to resolve internally created cross-references. Appropriate warnings will be issued in such cases. @@ -294,14 +294,6 @@ Prescribes an initial camera roll around the optical axis (in clockwise directio Without the above options the virtual camera sits at the origin $(0,0,0)$ of the World, looking in the positive $Y$ direction, i.\,e. default settings of \verb+3Droo=0+, \verb+3Dcoo=0 0 0+ and \verb+3Dc2c=0 -1 0+ are assumed. (Note that $\overrightarrow{C2C}$ is the opposite of the view vector!) Thus, in order to get a `front view' of the 3D object it is sufficient to set the radius of orbit, i.\,e. the distance between camera and object appropriately. Sometimes you may want to adjust the orbital centre, i.\,e. the target of the camera as well, in particular, if the object is irregularly shaped. Fortunately, it is possible to let the values of the corresponding options be determined automatically. Simply insert a hyperlink using the \verb+\movieref+ command together with the `\verb+3Dcalculate+' option. Once the settings for `\verb+3Droo+' and `\verb+3Dcoo+' have been calculated, the hyperlink can be removed again. See section \ref{hyperlinks} for an explanation and example \ref{ex3d} in section \ref{examples}. \begin{verbatim} -3Dviews=<views file> -\end{verbatim} -Instead of or in addition to the default view, further \emph{named views} can be set in an auxiliary file specified by the `\verb+3Dviews+' option. The additional views can later be selected from a drop down list in the tool bar that is associated with every activated 3D object in the Reader. The file \verb+<views file>+ contains lines which obey the syntax: -\begin{verbatim} -[<name>]{<coo_x> <coo_y> <coo_z>}{<c2c_x> <c2c_y> <c2c_z>}{<roo>}{<roll>}{<aac>} -\end{verbatim} -The \verb+<name>+ entry is optional. If \verb+<name>+ is not given, a default name consisting of `View' followed by the number of the current entry in the list is formed. For \verb+<coo_x>+, \verb+<coo_y>+, \verb+<coo_z>+, \verb+<c2c_x>+, \verb+<c2c_y>+, \verb+<c2c_z>+, \verb+<roo>+, \verb+<roll>+ and \verb+<aac>+ the same rules as for the corresponding options `\verb+3Dcoo+', `\verb+3Dc2c+', `\verb+3Droo+', `\verb+3Droll+' and `\verb+3Daac+' apply. Empty braces, \verb+{}+, are possible and cause default values to be used. Trailing spaces or comment signs (\%) are allowed. Reading of the file stops either at its end, at the first empty line encountered or at the first line containing nothing but spaces and/or a comment sign followed by arbitrary stuff. See option `\verb+3Dgetview+' of \verb+\movieref+ on how to get the camera settings of the current view in the Reader, which can be used to populate a file of additional views. -\begin{verbatim} 3Dbg=<r> <g> <b> \end{verbatim} This option sets the background colour of the canvas. Only fixed point real numbers in the range from 0 to 1 are allowed for the colour components. @@ -315,6 +307,83 @@ Sets the default lighting scheme. The following values are honoured: `\verb+None \begin{flushleft} Sets the default render mode. The following values are honoured: `\verb+Solid+', `\verb+SolidWireframe+', `\verb+Transparent+', `\verb+TransparentWireframe+', `\verb+BoundingBox+', `\verb+TransparentBoundingBox+', `\verb+TransparentBoundingBoxOutline+', `\verb+Wireframe+', `\verb+ShadedWireframe+', `\verb+HiddenWireframe+', `\verb+Vertices+', `\verb+ShadedVertices+', `\verb+SolidOutline+', `\verb+Illustration+', `\verb+ShadedIllustration+'. \end{flushleft} + +\begin{verbatim} +3Dviews=<views file> +\end{verbatim} +\emph{Deprecated}. Superseeded by the `\verb+3Dviews2+' option and a new, more flexible views file syntax (see below). File \verb+<views file>+ specifies predefined camera positions. It contains lines with the following syntax: +\begin{verbatim} +[<name>]{<coo_x> <coo_y> <coo_z>}{<c2c_x> <c2c_y> <c2c_z>}{<roo>}{<roll>}{<aac>} +\end{verbatim} +The \verb+<name>+ entry is optional. If \verb+<name>+ is not given, a default name consisting of `View' followed by the number of the current entry in the list is formed. For \verb+<coo_x>+, \verb+<coo_y>+, \verb+<coo_z>+, \verb+<c2c_x>+, \verb+<c2c_y>+, \verb+<c2c_z>+, \verb+<roo>+, \verb+<roll>+ and \verb+<aac>+ the same rules as for the corresponding options `\verb+3Dcoo+', `\verb+3Dc2c+', `\verb+3Droo+', `\verb+3Droll+' and `\verb+3Daac+' apply. Empty braces, \verb+{}+, are possible and cause default values to be used. Trailing spaces or comment signs (\%) are allowed. Reading of the file stops either at its end, at the first empty line encountered or at the first line containing nothing but spaces and/or a comment sign followed by arbitrary stuff.% See option `\verb+3Dgetview+' of \verb+\movieref+ on how to get the camera settings of the current view in the Reader, which can be used to populate a file of additional views. + +\begin{verbatim} +3Dviews2=<views file> +\end{verbatim} +Instead of or in addition to the default view, further \emph{named views} can be set in an auxiliary file `\verb+<views file>+'. Besides the virtual camera position, it is possible to adjust the rendering attributes, such as visibility and transparency, of every single part in the scene. Moreover, background colour and scene lighting can be set individually for every view. The additional views can later be selected either from a drop down list in the tool bar that is associated with the activated 3D object in the Reader or from the context menu of the 3D object. + +The file \verb+<views file>+ is structured into view sections, one for every view: +\begin{verbatim} + VIEW[=<optional name>] + COO=<coo_x> <coo_y> <coo_z> + C2C=<c2c_x> <c2c_y> <c2c_z> + ROO=<roo> + AAC=<aac> + ROLL=<roll> + BGCOLOR=<r> <g> <b> + RENDERMODE=<render mode> + LIGHTS=<lighting scheme> + PART=<part name (required) as in the Model Tree> + VISIBLE=true | false + OPACITY=<part opacity> + RENDERMODE=<see option `3Drender' for possible values> + END + PART=<...> + ... + END + etc. + END + VIEW + ... + END + etc. +\end{verbatim} +A view section starts with the keyword \verb+VIEW+, optionally followed by a name for the view, and ends with the keyword \verb+END+. If no name is given to the view, a default one is created, consisting of `View' followed by the number of the current \verb+VIEW+ section in the file. A \verb+VIEW+ section contains optional entries for setting the camera position and global rendering attributes of the scene as well as \verb+PART+ subsections for setting rendering attributes of parts individually. Table~\ref{tab:views} lists the entries in a \verb+VIEW+ section. Part sub-sections are opened by \verb+PART=<part name>+ and closed by \verb+END+. There may be as many part subsections as there are parts a 3D object is composed of. Table~\ref{tab:parts} lists the possible entries in a \verb+PART+ sub-section. All entries are optional. \verb+<part name>+ is required and must match the part name as indicated in the Model Tree of the 3D object (accessible via right-click onto the model in the Reader). In order to avoid trouble it is recommended that part names be exclusively composed of ASCII characters. You may need to load the U3D/PRC model into the authoring application and edit the part names accordingly. + +The views file can be commented. As usual with \LaTeX, comments start with the percent sign. + +To facilitate the creation of a views file, a \verb+\movieref+ link with option `\verb+3Dgetview+' can be temporarily inserted into the document. When clicked, it outputs a complete \verb+VIEW+ section corresponding to the current view of the 3D object in the Reader GUI, including camera position as well as all part and viewing options that may be set via the context (right-click) menu of the 3D object. See section \ref{hyperlinks} for details. + +\begin{table} + \centering + \caption{Entries in a {\tt VIEW} section}\label{tab:views} + \begin{tabular}[t]{llp{0.3\linewidth}}\hline + key & type & value\\\hline\hline + COO & three numbers & centre of orbit, see option `{\tt 3Dcoo}'\\ + C2C & three numbers & centre of orbit to camera vector, see option `{\tt 3Dc2c}'\\ + ROO & number & radius of orbit, see option `{\tt 3Droo}'\\ + AAC & number & camera aperture angle, see option `{\tt 3Daac}'\\ + ROLL & number & camera roll, see option `{\tt 3Droll}'\\ + BGCOLOR & three numbers & canvas background colour (RGB), see option `{\tt 3Dbg}'\\ + RENDERMODE & string & render mode of the 3D object, see option `{\tt 3Drender}'\\ + LIGHTS & string & lighting scheme, see option `{\tt 3Dlights}'\\ + PART & sub-section & part name as in the model tree, see Table~\ref{tab:parts} for list of possible entries\\ + \hline + \end{tabular} +\end{table} + +\begin{table} + \centering + \caption{Entries in a {\tt PART} sub-section}\label{tab:parts} + \begin{tabular}[t]{llp{0.3\linewidth}}\hline + key & type & value\\\hline\hline + VISIBLE & boolean & a flag (`{\tt true}' or `{\tt false}') indicating the visibility of this part\\ + OPACITY & number & a number between 0.0 and 1.0 specifying the opacity of this part\\ + RENDERMODE & string & rendermode of this part, overrides global {\tt RENDERMODE} value in parent {\tt VIEW} section, see option `{\tt 3Drender}'\\ + \hline + \end{tabular} +\end{table} + \begin{verbatim} 3Djscript=<JavaScript file> \end{verbatim} @@ -386,11 +455,11 @@ Instead of referencing an existing view of the 3D object, a new one can be defin \begin{verbatim} 3Dcalculate[=<aac angle>] \end{verbatim} -Mainly used during document authoring. Creates a link for calculating optimal `\verb+3Droo+' and `\verb+3Dcoo+' settings of the virtual camera, which may be used to define a default view. Clicking the link opens a dialogue box from which the settings can be copied to the clipboard for later insertion into the option list of \verb+\includemovie+. The default aperture angle of $30$\textdegree{} is used for the calculation unless an optional \verb+<aac angle>+ has been provided. +Mainly used during document authoring. Creates a link for calculating optimal `\verb+3Droo+' and `\verb+3Dcoo+' settings of the virtual camera, which may be used to define a default view. Clicking the link opens a dialogue box from which the settings can be copied to the clipboard for later insertion into the option list of \verb+\includemovie+. The parameter \verb+<aac angle>+ which is the camera aperture angle $\sphericalangle AAC$ used for calculation is optional. If omitted, the one set by \verb+\includemovie+ option `\verb+3Daac+' is taken. \begin{verbatim} 3Dgetview \end{verbatim} -Mainly used during document authoring. Camera settings corresponding to the current view in the Reader are printed to a dialogue box. The output is readily formatted to be inserted into a file of predefined views. See option `\verb+3Dviews+'. +Mainly used during document authoring. Camera settings as well as part and scene rendering attributes that correspond to the current view are printed to a dialogue box. The output is a readily formatted \verb+VIEWS+ section to be inserted into or appended to a file of predefined views. See option `\verb+3Dviews2+'. \begin{verbatim} 3Djscript=<JavaScript file> \end{verbatim} @@ -493,9 +562,9 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda \begin{center} \includemovie[ poster, - label=alien, - text=(AlienSong.mpg), - repeat, + label=alien, + text=(AlienSong.mpg), + repeat, playerid=AAPL_QuickTime, url ]{\linewidth}{.75\linewidth}{http://www.linux-video.net/Samples/Mpeg1/AlienSong.mpg}\\ @@ -508,7 +577,7 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda \end{center} \end{minipage} -\newpage +%\newpage \item\label{ex3d} Embedded U3D file. It is based on a VRML model by Peter Whitehouse, \href{http://www.wonko.info/vrml/index.htm}{\tt http://www.wonko.info/vrml/index.htm}. Conversion to U3D has been made with DeepExploration\textsuperscript{\scriptsize\textregistered}\cite{dexp}. The file `{\tt dice.vws}' provides predefined views to be selected from the 3D toolbar or by right click.% The JavaScript `{\tt turntable.js}' disables the annoying Gimbal rotation mode. \begin{minipage}[b]{0.5\linewidth} @@ -520,8 +589,8 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda \phantom{xx}text=(dice.u3d),\\ \phantom{xx}3Droo=27,\\ \phantom{xx}3Dlights=Cube,\\ -% \phantom{xx}3Djscript=turntable.js,\\ - \phantom{xx}3Dviews=dice.vws\\ + \phantom{xx}3Djscript=turntable.js,\\ + \phantom{xx}3Dviews2=dice.vws\\ ]\string{\\ \phantom{xx}.5\string\linewidth\\ \string}\string{\\ @@ -539,13 +608,13 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda \begin{center} \includemovie[ poster, - toolbar, %same as `controls' + toolbar, %same as `controls' label=dice, text=(dice.u3d), 3Droo=27, - 3Dlights=Cube, - 3Dviews=dice.vws, -% 3Djscript=turntable.js %a bug in Reader 8 causes the script to fail + 3Dlights=Cube, + 3Dviews2=dice.vws, + 3Djscript=turntable.js ]{\linewidth}{\linewidth}{dice.u3d} \end{center} \movieref[3Dviewindex=N]{dice}{Click here} to cycle through the list of predefined views. \movieref[3Dcalculate=60]{dice}{This link} calculates 3D option settings for a 60\textdegree{} aperture angle of the virtual camera. @@ -561,29 +630,29 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda {\tt% \string\includemovie[poster, label=my\_label]\string{\\ - \phantom{xx}.5\string\linewidth\\ - \string}\string{\\ - \phantom{xx}.5\string\linewidth\\ - \string}\string{\\ + \phantom{xx}.5\string\linewidth\\ + \string}\string{\\ + \phantom{xx}.5\string\linewidth\\ + \string}\string{\\ \phantom{xx}my\_file.u3d\\ - \string}\string\\\\ + \string}\string\\\\ \string\movieref[3Dcalculate]\string{my\_label\string}\string{Click here!\string} } \item Compile and recompile the document until no more `movie15' related warnings appear. - \item Open the PDF document in Adobe Reader and go to the page containing the 3D object. Click the link and wait for a dialogue box to pop up. - \item Copy the settings ({\tt 3Droo=...}, {\tt 3Dcoo=...}) from the dialogue box into the option list of {\tt \string\include\-movie}. Remove the link from the document source: + \item Open the PDF document in Adobe Reader and go to the page containing the 3D object. Click the link and wait for a dialogue box to pop up. Optionally, drag the object with the mouse to change the viewpoint of the camera (the dialogue must be closed beforehand) and click the link again. + \item Copy the settings ({\tt 3Droo=...}, {\tt 3Dcoo=...}, etc.) from the dialogue box into the option list of {\tt \string\include\-movie}. Remove the link from the document source: {\tt% \string\includemovie[\\ - \phantom{xx}poster, 3Droo=33.3333, 3Dcoo=1.2345 9.8765 0\\ - ]\string{\\ - \phantom{xx}.5\string\linewidth\\ - \string}\string{\\ - \phantom{xx}.5\string\linewidth\\ - \string}\string{\\ + \phantom{xx}poster, 3Droo=33.3333, 3Dcoo=1.2345 9.8765 0\\ + ]\string{\\ + \phantom{xx}.5\string\linewidth\\ + \string}\string{\\ + \phantom{xx}.5\string\linewidth\\ + \string}\string{\\ \phantom{xx}my\_file.u3d\\ - \string} + \string} } \item Again, compile and recompile the document until no more `movie15' related warnings appear. @@ -594,47 +663,52 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda \begin{enumerate} \setcounter{enumi}{\lastcount} - \item Associate a JavaScript with the 3D object: + \item Create a file with predefined views of the 3D object and attach it to the latter using the `{\tt{}3Dviews2}' option: {\tt% \string\includemovie[\\ - \phantom{xx}..., 3Djscript=my\_script.js\\ - ]\string{\\ - \phantom{xx}.5\string\linewidth\\ - \string}\string{\\ - \phantom{xx}.5\string\linewidth\\ - \string}\string{\\ + \phantom{xx}..., label=my\_label, 3Dviews2=my\_views.vws\\ + ]\string{\\ + \phantom{xx}.5\string\linewidth\\ + \string}\string{\\ + \phantom{xx}.5\string\linewidth\\ + \string}\string{\\ \phantom{xx}my\_file.u3d\\ - \string} + \string} } - JavaScript is \emph{not} required to make use of \emph{embedded} keyframe animation. Just click the `Play' button in the 3D toolbar of the 3D annotation. However, the example file `{\tt{}animation.js}' in the `{\tt{}doc/javascript}' directory provides additional controls (accessible via the context menu of the 3D annotation) that can be used to change the speed of a running animation. The `Up', `Down' and `Home' keys of the keyboard can also be used. + The views file can easily be populated using a temporarily inserted {\tt \string\movie\-ref} link: + + {\tt% + \string\movieref[3Dgetview]\string{my\_label\string}\string{Click here!\string} + } + + Manipulate the 3D object using the mouse and any of the `Part' and `Viewing' options from the 3D context menu in the Reader. Visibility, lighting, transparency, render mode etc. of individual parts or of the object as a whole can be changed this way. Sometimes you may wish to move the camera target into the centre of a single part or of a group of visible parts. The context menu items `Part Options$\rightarrow$Zoom to Part' and `Part Options$\rightarrow$Fit Visible' can be used for this purpose. - Another useful example file you may want to experiment with is `{\tt{}turn\-table.js}'. It improves the rotational behaviour of the 3D object, because it prevents the object from tilting to the side while dragging the mouse. + When you are done, click the link to get the {\tt VIEW} section, readily formatted for insertion into the views file. Repeat this procedure to get any number of views you want to predefine. The views file can be edited manually to give meaningful names to the views (change the value of the {\tt VIEW} entry) or to further tweak camera settings, opacity etc. - All files in `{\tt{}doc/javascript}' work off-the-shelf and can be copied into a single file in order to combine their effects. + If you are satisfied with the predefined views in the views file, the default view first specified through the options of {\tt\string\includemovie} can be deleted. The first view in the views file becomes the default view then. - \item Create a file with predefined views of the 3D object and attach it to the latter using the `{\tt{}3Dviews}' option: + \item Associate a JavaScript with the 3D object: {\tt% \string\includemovie[\\ - \phantom{xx}..., label=my\_label, 3Dviews=my\_views.vws\\ - ]\string{\\ - \phantom{xx}.5\string\linewidth\\ - \string}\string{\\ - \phantom{xx}.5\string\linewidth\\ - \string}\string{\\ + \phantom{xx}..., 3Djscript=my\_script.js\\ + ]\string{\\ + \phantom{xx}.5\string\linewidth\\ + \string}\string{\\ + \phantom{xx}.5\string\linewidth\\ + \string}\string{\\ \phantom{xx}my\_file.u3d\\ - \string} + \string} } - The views file can easily be populated using a temporarily inserted {\tt \string\movie\-ref} link: + JavaScript is \emph{not} required to make use of \emph{embedded} keyframe animation. Just click the `Play' button in the 3D toolbar of the 3D annotation. However, the example file `{\tt{}animation.js}' in the `{\tt{}doc/javascript}' directory provides additional controls (accessible via the context menu of the 3D annotation) that can be used to change the speed of a running animation. The `Up', `Down' and `Home' keys of the keyboard can also be used. + + Another useful example file you may want to experiment with is `{\tt{}turn\-table.js}'. It improves the rotational behaviour of the 3D object, because it prevents the object from tilting to the side while dragging the mouse. - {\tt% - \string\movieref[3Dgetview]\string{my\_label\string}\string{Click here!\string} - } + All files in `{\tt{}doc/javascript}' work off-the-shelf and can be copied into a single file in order to combine their effects. - Manipulate the 3D object in the Reader by means of the `Rotate', `Pan', `Zoom' and `Walk' tools as well as the `Zoom to Part' action (to be selected from the context menu items `Tools' and `Part Options'). A line, readily formatted for insertion into the views file, that contains the settings according to the current view can be copied from a dialogue box which pops up after clicking the link. \end{enumerate} \section{Media formats} diff --git a/Master/texmf-dist/doc/latex/movie15/turntable.js b/Master/texmf-dist/doc/latex/movie15/turntable.js index d8f5bd93fd1..f839c5c3326 100644 --- a/Master/texmf-dist/doc/latex/movie15/turntable.js +++ b/Master/texmf-dist/doc/latex/movie15/turntable.js @@ -18,6 +18,8 @@ var cos_min_beta = Math.cos(min_beta * Math.PI/180); var tan_min_beta = Math.tan(min_beta * Math.PI/180); var camera = scene.cameras.getByIndex(0); +camera.axis_up = camera.up.subtract(camera.position); +camera.axis_up.normalize(); //updates the vertical axis of rotation whenever a predefined view //is selected from the drop down list in the 3D toolbar @@ -32,6 +34,7 @@ runtime.addEventHandler(cameraEventHandler); var mouseEventHandler = new MouseEventHandler(); mouseEventHandler.onMouseMove = true; mouseEventHandler.onEvent = function (e) { + runtime.setCurrentTool(runtime.TOOL_NAME_ROTATE); var c2c = camera.position.subtract(camera.targetPosition); var roo = c2c.length; c2c.normalize(); diff --git a/Master/texmf-dist/tex/latex/movie15/movie15.sty b/Master/texmf-dist/tex/latex/movie15/movie15.sty index e4e82b40b81..618772a284f 100644 --- a/Master/texmf-dist/tex/latex/movie15/movie15.sty +++ b/Master/texmf-dist/tex/latex/movie15/movie15.sty @@ -9,7 +9,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{movie15}[2008/10/08] +\ProvidesPackage{movie15}[2009/03/23] \RequirePackage{keyval} \RequirePackage{ifthen} \RequirePackage{ifpdf} @@ -83,7 +83,8 @@ %} \AtBeginDocument{% - \provideboolean{Hy@colorlinks}% set by hyperref + \@ifpackageloaded{hyperref}{}{\@MXV@missing{hyperref}}% + \hypersetup{unicode} \ifHy@colorlinks% coloured (movieref-)link text instead of link border \gdef\@MXV@pdfborder{/Border [0 0 0]}% \else% @@ -145,8 +146,6 @@ \expandafter\pdfpageref\csname#1\endcsname\space% \fi% }% -\else% - \PassOptionsToPackage{pdfmark}{hyperref}% \fi %counter for absolute number of inclusions, @@ -259,12 +258,20 @@ \setboolean{@MXV@iiid}{false}% \gdef\@MXV@aac{30}% aperture angle of camera \gdef\@MXV@roll{0}% camera roll angle - \gdef\@MXV@background{}% + \gdef\@MXV@defaultbg{1 1 1}% + \gdef\@MXV@background{/BG<</CS/DeviceRGB/C[1 1 1]>>}% + \gdef\@MXV@defaultlights{}% + \gdef\@MXV@lights{}% + \gdef\@MXV@defaultrender{Solid}% + \gdef\@MXV@render{/RM <</Subtype/Solid>>}% + \gdef\@MXV@naentry{}% %takes array of Node dicts + \gdef\@MXV@saentry{}% %takes array of cross section dicts \gdef\@MXV@jscriptiiidfile{}% \gdef\@MXV@coo{0 0 0}% centre of orbit \gdef\@MXV@ctoc{0 -1 0}% centre of orbit to camera vector \gdef\@MXV@roo{0}% radius of orbit \gdef\@MXV@viewsfile{}% file containing views of the 3D object + \gdef\@MXV@viewsfileii{}%file containing views of the 3D object (new format) \setboolean{@MXV@viewsprovided}{false}% \setboolean{@MXV@defaultviewprovided}{false}% \gdef\@MXV@iiidview{}% @@ -279,8 +286,6 @@ \gdef\@MXV@iiidpalindrome{/Subtype/Linear}% forward \gdef\@MXV@iiidrate{}% animation speed \global\@MXV@iiidrepeat=-1% repeat count - \gdef\@MXV@lights{}% default lighting scheme - \gdef\@MXV@render{}% default render mode scheme }{}% }% @@ -418,12 +423,17 @@ \ifthenelse{\boolean{@MXV@iiiDfeat}}{% 3D related definitions and macros \RequirePackage{fp}% needed for fixed point calculus \newread\@MXV@@viewsfile% file handle for views file + \newboolean{@MXV@eof}% \newcount\@MXV@viewscount%counter for number of 3D views per inclusion \newboolean{@MXV@viewsprovided}%3d views file provided? \newboolean{@MXV@iiidgetview}% print current 3D settings? \newboolean{@MXV@defaultviewprovided}%default 3D view provided? \newboolean{@MXV@resource}%3d resource file provided? - \ifpdf\else\newcount\@MXV@rescount\fi% number of embedded resource files + \ifpdf\else + \newcount\@MXV@rescount% number of embedded resource files + \newcount\@MXV@nodecount% number of node dicts + \newcount\@MXV@cscount% number of cross section dicts + \fi \newcount\@MXV@iiidrepeat% play count \newcount\@MXV@iiidoncurpage%index of 3D annot on current page \global\@MXV@iiidoncurpage=0% @@ -506,25 +516,25 @@ \FPupn\@MXV@upx{\@MXV@upxprime}% \FPupn\@MXV@upy{\@MXV@upyprime}% \FPupn\@MXV@upz{\@MXV@upzprime}% - %rotation matrix - \xdef\@MXV@matrix{\@MXV@leftx\space\@MXV@lefty\space\@MXV@leftz\space% - \@MXV@upx\space\@MXV@upy\space\@MXV@upz\space% - \@MXV@viewx\space\@MXV@viewy\space\@MXV@viewz}% %translation vector \FPupn\@MXV@roo{#7 abs}% - \FPifeq\@MXV@roo{0}\FPupn\@MXV@roo{0.000000000000000001}\fi% + \FPifeq\@MXV@roo{0}\FPupn\@MXV@roo{0.0000001}\fi% \FPupn\@MXV@transx{#1 \@MXV@roo{} \@MXV@viewx{} mul sub}% \FPupn\@MXV@transy{#2 \@MXV@roo{} \@MXV@viewy{} mul sub}% \FPupn\@MXV@transz{#3 \@MXV@roo{} \@MXV@viewz{} mul sub}% + %rotation matrix + \xdef\@MXV@matrix{\@MXV@leftx\space\@MXV@lefty\space\@MXV@leftz\space% + \@MXV@upx\space\@MXV@upy\space\@MXV@upz\space% + \@MXV@viewx\space\@MXV@viewy\space\@MXV@viewz}% %transformation matrix \xdef\@MXV@matrix{% \@MXV@matrix\space\@MXV@transx\space\@MXV@transy\space\@MXV@transz% }% } - %macro for parsing one line of 3D views file + %macro for parsing one line of 3D views file (old format) \newcommand{\@MXV@parseline}[6][]{% - \xdef\@MXV@xname{#1}% name of the view (optional) + \pdfstringdef\@MXV@xname{#1}% name of the view (optional) \ifthenelse{\equal{#2}{}}{% \xdef\@MXV@coo{0 0 0}% }{% @@ -551,18 +561,254 @@ \xdef\@MXV@aac{#6}% }% } + %for parsing lines of views file (new format) + \define@key{MXV@view}{VIEW}[]{% + \ifnum\@MXV@cursection<\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + A VIEW section cannot be nested into another section% + }{}% + \fi% + \def\@MXV@cursection{0}% + \pdfstringdef\@MXV@xname{#1}% name of the view (optional) + %default camera settings + \gdef\@MXV@coo{0 0 0}% + \gdef\@MXV@ctoc{0 -1 0}% + \gdef\@MXV@roo{0}% + \gdef\@MXV@roll{0}% + \gdef\@MXV@aac{30}% + %default background, lights, render mode + \xdef\@MXV@background{/BG <</CS/DeviceRGB/C [\@MXV@defaultbg]>>}% + \xdef\@MXV@lights{/LS <</Subtype/\@MXV@defaultlights>>}% + \gdef\@MXV@render{/RM <</Subtype/\@MXV@defaultrender>>}% + %initialise array of node dicts + \gdef\@MXV@naarray{}% + \ifpdf\else\global\@MXV@nodecount=\z@\fi% + %initialise array of crosssection dicts + \gdef\@MXV@saarray{}% + \ifpdf\else\global\@MXV@cscount=\z@\fi% + } + \define@key{MXV@view}{COO}{% + \ifnum\@MXV@cursection=\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + COO entry not allowed here; must go into a VIEW section% + }{}% + \fi% + \xdef\@MXV@coo{#1}% + } + \define@key{MXV@view}{C2C}{% + \ifnum\@MXV@cursection=\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + C2C entry not allowed here; must go into a VIEW section% + }{}% + \fi% + \xdef\@MXV@ctoc{#1}% + } + \define@key{MXV@view}{ROO}{% + \ifnum\@MXV@cursection=\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + ROO entry not allowed here; must go into a VIEW section% + }{}% + \fi% + \xdef\@MXV@roo{#1}% + } + \define@key{MXV@view}{AAC}{% + \ifnum\@MXV@cursection=\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + AAC entry not allowed here; must go into a VIEW section% + }{}% + \fi% + \xdef\@MXV@aac{#1}% + } + \define@key{MXV@view}{ROLL}{% + \ifnum\@MXV@cursection=\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + ROLL entry not allowed here; must go into a VIEW section% + }{}% + \fi% + \xdef\@MXV@roll{#1}% + } + \define@key{MXV@view}{BGCOLOR}{% + \ifnum\@MXV@cursection=\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + BGCOLOR entry not allowed here; must go into a VIEW section% + }{}% + \fi% + \def\@MXV@background{/BG<</CS/DeviceRGB/C[#1]>>}% + } + \define@key{MXV@view}{LIGHTS}{% + \ifnum\@MXV@cursection=\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + LIGHTS entry not allowed here; must go into a VIEW section% + }{}% + \fi% + \def\@MXV@lights{/LS <</Subtype/#1>>}% + } + \define@key{MXV@view}{RENDERMODE}{% + \ifnum\@MXV@cursection=\z@ + \def\@MXV@render{/RM <</Subtype/#1>>}% + \else% + \ifnum\@MXV@cursection=\@ne + \def\@MXV@nrender{/RM <</Subtype/#1>>}% + \else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + RENDERMODE entry not allowed here; must go into either a VIEW % + or a PART section% + }{}% + \fi% + \fi% + } + \define@key{MXV@view}{PART}[]{% + \ifnum\@MXV@cursection=\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + PART not allowed here; must be a sub-section of a VIEW section% + }{}% + \fi% + \ifthenelse{\equal{#1}{}}{% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + You must provide a valid PART name (PART=<part name>), as shown % + in the model tree of the 3D object (go to `View'->`Navigation % + Panels'->`Model Tree' in Adobe Reader)% + }{}% + }{}% + \def\@MXV@cursection{1}% + \pdfstringdef\@MXV@partname{#1}% name of the part + \gdef\@MXV@nopacity{}% + \gdef\@MXV@nvisibility{}% + \gdef\@MXV@nrender{}% + \gdef\@MXV@ntransform{}% + } + \define@key{MXV@view}{CROSSSECT}[]{% + \ifnum\@MXV@cursection=\z@\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + CROSSSECT not allowed here; must be a sub-section of a VIEW section% + }{}% + \fi% + \ifthenelse{\equal{#1}{}}{}{% + \PackageWarning{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + CROSSECT does not take a value% + }% + }% + \def\@MXV@cursection{2}% + \gdef\@MXV@cscenter{0 0 0}% + \gdef\@MXV@csorient{null 0 0}% + } + \define@key{MXV@view}{OPACITY}{% + \ifnum\@MXV@cursection=\@ne\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + OPACITY entry not allowed here; must go into a PART section% + }{}% + \fi% + \gdef\@MXV@nopacity{/O #1}% + } + \define@key{MXV@view}{VISIBLE}{% + \ifnum\@MXV@cursection=\@ne\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + VISIBLE entry not allowed here; must go into a PART section% + }{}% + \fi% + \gdef\@MXV@nvisibility{/V #1}% + } + \define@key{MXV@view}{MATRIX}{% + \ifnum\@MXV@cursection=\@ne\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + MATRIX entry not allowed here; must go into a PART section% + }{}% + \fi% + \gdef\@MXV@ntransform{/M [#1]}% + } + \define@key{MXV@view}{CENTER}{% + \ifnum\@MXV@cursection=2\relax\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + CENTER entry not allowed here; must go into a CROSSECT section% + }{}% + \fi% + \gdef\@MXV@cscenter{#1}% + } + \define@key{MXV@view}{ORIENTATION}{% + \ifnum\@MXV@cursection=2\relax\else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + ORIENT entry not allowed here; must go into a CROSSECT section% + }{}% + \fi% + \gdef\@MXV@csorient{#1}% + } + \define@key{MXV@view}{END}[]{% + \ifcase\@MXV@cursection% + %END VIEW + \edef\@MXV@args{% + \@MXV@coo\space\@MXV@ctoc\space\@MXV@roo\space\@MXV@roll\space}% + \expandafter\@MXV@ciiwmatrix\@MXV@args% build C2W matrix + \global\advance\@MXV@viewscount by \@ne% + \ifthenelse{\equal{\@MXV@xname}{}}{% default view name + \pdfstringdef\@MXV@xname{View \the\@MXV@viewscount}% + }{}% + \ifthenelse{\equal{\@MXV@naarray}{}}{}{% + \gdef\@MXV@naentry{/NR true/NA [\@MXV@naarray]}% + }% + \ifthenelse{\equal{\@MXV@saarray}{}}{}{% + \gdef\@MXV@saentry{/SA [\@MXV@saarray]}% + }% + \@MXV@viewobj% create pdf object of 3D view + %append current view obj ref to VA array + \xdef\@MXV@varray{\@MXV@varray\space\@MXV@@viewobj}% + \global\@MXV@viewsprovidedtrue% + \def\@MXV@cursection{-1}% + \or% + %END PART + \ifpdf\else\global\advance\@MXV@nodecount by \@ne\fi% + \@MXV@nodeobj% create pdf object of 3D node dict + %append it to node array + \xdef\@MXV@naarray{\@MXV@naarray\space\@MXV@@nodeobj}% + \def\@MXV@cursection{0}% + \or% + %END CROSSSECT + \ifpdf\else\global\advance\@MXV@cscount by \@ne\fi% + \@MXV@csobj% create pdf object of 3D cross section dict + %append it to cross section array + \xdef\@MXV@saarray{\@MXV@saarray\space\@MXV@@csobj}% + \def\@MXV@cursection{0}% + \else% + \PackageError{movie15}{% + File \@MXV@viewsfileii, line \the\@MXV@inputlineno: % + There is nothing to be ENDed here% + }{}% + \fi% + }% %macro for generating an array of 3D views (varray) + \def\@MXV@procinputline#1{\setkeys{MXV@view}{#1}} + \newcount\@MXV@inputlineno \def\@MXV@buildva{% \global\@MXV@viewscount=0% \xdef\@MXV@varray{}% empty varray % - %default view - \edef\@MXV@args{\@MXV@coo\space\@MXV@ctoc\space\@MXV@roo\space\@MXV@roll\space}% + %default view (one of the command options 3Dcoo, 3Dc2c, etc. given) + \edef\@MXV@args{% + \@MXV@coo\space\@MXV@ctoc\space\@MXV@roo\space\@MXV@roll\space}% \expandafter\@MXV@ciiwmatrix\@MXV@args% build C2W matrix - \xdef\@MXV@xname{Default}% - \@MXV@viewobj% create pdf object of 3D view - \edef\@MXV@defaultview{\@MXV@@viewobj}% + \pdfstringdef\@MXV@xname{Default}% + \if@MXV@defaultviewprovided% + \@MXV@viewobj% create pdf object of 3D view + \edef\@MXV@defaultview{/3DV \@MXV@@viewobj}% + \fi% % %read out 3D views file \IfFileExists{\@MXV@viewsfile}{% @@ -577,7 +823,7 @@ \expandafter\@MXV@ciiwmatrix\@MXV@args% build C2W matrix \global\advance\@MXV@viewscount by 1% \ifthenelse{\equal{\@MXV@xname}{}}{% - \xdef\@MXV@xname{View \the\@MXV@viewscount}% + \pdfstringdef\@MXV@xname{View \the\@MXV@viewscount}% }{}% \@MXV@viewobj% create pdf object of 3D view %append current view obj ref to VA array @@ -587,6 +833,33 @@ \closein\@MXV@@viewsfile% \endlinechar=\@MXV@endlinechar% reset endlinechar }{}% + %read out 3D views file (new version) + \def\@MXV@cursection{-1}% views file is devided in sections + \IfFileExists{\@MXV@viewsfileii}{% + \begingroup% + \endlinechar=-1% suppress trailing space at input line end +% \catcode`\#=14\relax% make `#' a comment char +% \catcode`\%=12\relax% make `%' an ordinary char + \@MXV@inputlineno=\z@% + \openin\@MXV@@viewsfile=\@MXV@viewsfileii% + \read\@MXV@@viewsfile to \@MXV@inputline% + \ifeof\@MXV@@viewsfile\setboolean{@MXV@eof}{true}\else% + \setboolean{@MXV@eof}{false}\fi% + \whiledo{\NOT\boolean{@MXV@eof}}{% + \advance\@MXV@inputlineno by \@ne% + %process input line + \edef\@MXV@@inputline{{\@MXV@inputline}}% + \expandafter\@MXV@procinputline\@MXV@@inputline% + \read\@MXV@@viewsfile to \@MXV@inputline% + \ifeof\@MXV@@viewsfile% + \setboolean{@MXV@eof}{true}% + \else% + \setboolean{@MXV@eof}{false}% + \fi% + }% + \closein\@MXV@@viewsfile% + \endgroup% + }{}% % %make the first view in the VA array the default view, if no default one has %explicitly been provided, but if the VA array itself is empty too (no @@ -594,9 +867,12 @@ \ifthenelse{\NOT\boolean{@MXV@defaultviewprovided}% \AND\boolean{@MXV@viewsprovided}}{% \xdef\@MXV@defaultview{/3DV /F}% - }{% - \xdef\@MXV@defaultview{/3DV \@MXV@defaultview}% - }% + }{}% + \ifthenelse{\NOT\boolean{@MXV@defaultviewprovided}% + \AND\NOT\boolean{@MXV@viewsprovided}}{% + \@MXV@viewobj% create pdf object of 3D view + \edef\@MXV@defaultview{/3DV \@MXV@@viewobj}% + }{}% } %following macros, including the 3D inclusion macro have driver specific @@ -618,10 +894,27 @@ \@MXV@background% \@MXV@lights% \@MXV@render% + \@MXV@naentry% node dictionaries + \@MXV@saentry% node dictionaries >>}\pdfrefobj\pdflastobj% \xdef\@MXV@@viewobj{\the\pdflastobj\space 0 R}% }% - + \def\@MXV@nodeobj{% + \pdfobj {<<% + /Type/3DNode% + /N (\@MXV@partname)% + \@MXV@nopacity\@MXV@nvisibility\@MXV@ntransform\@MXV@nrender% + >>}\pdfrefobj\pdflastobj% + \xdef\@MXV@@nodeobj{\the\pdflastobj\space 0 R}% + }% + \def\@MXV@csobj{% + \pdfobj {<<% + /Type/3DCrossSection% + /C [\@MXV@cscenter]% + /O [\@MXV@csorient]% + >>}\pdfrefobj\pdflastobj% + \xdef\@MXV@@csobj{\the\pdflastobj\space 0 R}% + }% %macro for creating resource objects from 3D and image files, to be used %in 3D JavaScript \def\@MXV@addresource#1{% @@ -874,11 +1167,61 @@ \@MXV@background% \@MXV@lights% \@MXV@render% + \@MXV@naentry% + \@MXV@saentry% >>% }% }% \xdef\@MXV@@viewobj{{viewobj\the\@MXV@includes_\the\@MXV@viewscount}}% }% + %3D node object + \def\@MXV@nodeobj{% + \pdfmark{% + pdfmark=/OBJ,% + Raw={% + /type/dict% + /_objdef {nodeobj\the\@MXV@includes_\the\@MXV@viewscount_% + \the\@MXV@nodecount}% + }% + }% + \pdfmark{% + pdfmark=/PUT,% + Raw={% + {nodeobj\the\@MXV@includes_\the\@MXV@viewscount_\the\@MXV@nodecount} + <<% + /Type/3DNode% + /N (\@MXV@partname)% + \@MXV@nopacity\@MXV@nvisibility\@MXV@ntransform% + >>% + }% + }% + \xdef\@MXV@@nodeobj{% + {nodeobj\the\@MXV@includes_\the\@MXV@viewscount_\the\@MXV@nodecount}}% + }% + %3D cross section object + \def\@MXV@csobj{% + \pdfmark{% + pdfmark=/OBJ,% + Raw={% + /type/dict% + /_objdef {csobj\the\@MXV@includes_\the\@MXV@viewscount_% + \the\@MXV@cscount}% + }% + }% + \pdfmark{% + pdfmark=/PUT,% + Raw={% + {csobj\the\@MXV@includes_\the\@MXV@viewscount_\the\@MXV@cscount} + <<% + /Type/3DCrossSection% + /C [\@MXV@cscenter]% + /O [\@MXV@csorient]% + >>% + }% + }% + \xdef\@MXV@@csobj{% + {csobj\the\@MXV@includes_\the\@MXV@viewscount_\the\@MXV@cscount}}% + }% % %macro for creating resource objects from 3D and image files \def\@MXV@addresource#1{% @@ -1124,7 +1467,7 @@ pdfmark=/PUT,% Raw={% {apdict} - <</BBox [0 0 0.001 0.001]>> + <</BBox [0 0 0.001 0.001]>> }% }% \xdef\@MXV@apdict{/AP << /N {apdict}>>}% @@ -1775,11 +2118,6 @@ %definition of user command `\includemovie' \newcommand{\includemovie}[4][]{% - %test for hyperref package - \ifpdf\else% - \ifthenelse{\isundefined{\pdfmark}}{\@MXV@missing{hyperref}}{}% - \fi% - % \leavevmode% \@MXV@reset% all macros and options \setkeys{MXV@user}{#1}% parse options @@ -1875,29 +2213,23 @@ \setboolean{@MXV@externalviewer}{true}% }{}% % - %some link attributes (if hyperref not loaded) - \ifthenelse{\isundefined{\@pdfborder}}{% - \def\@MXV@urlattr{}% - \def\@MXV@runattr{}% - }{% - \edef\@MXV@urlattr{% - \if@MXV@beamer% - /Border [1 1 1]% - \else% - /Border [\@pdfborder]% - \fi% - /C [\@urlbordercolor]% - /H \@pdfhighlight% - }% - \edef\@MXV@runattr{% - \if@MXV@beamer% - /Border [1 1 1]% - \else% - /Border [\@pdfborder]% - \fi% - /C [\@runbordercolor]% - /H \@pdfhighlight% - }% + \edef\@MXV@urlattr{% + \if@MXV@beamer% + /Border [1 1 1]% + \else% + /Border [\@pdfborder]% + \fi% + /C [\@urlbordercolor]% + /H \@pdfhighlight% + }% + \edef\@MXV@runattr{% + \if@MXV@beamer% + /Border [1 1 1]% + \else% + /Border [\@pdfborder]% + \fi% + /C [\@runbordercolor]% + /H \@pdfhighlight% }% % \global\advance\@MXV@includes by 1%increment counter @@ -2015,10 +2347,12 @@ \ifx\@MXV@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@label.3D}{true}% \@MXV@newlabel{@MXV@\@MXV@label.3D}{true}% - \@MXV@labeltoaux{@MXV@\@MXV@label.3Dlights}{\@MXV@lights}% - \@MXV@newlabel{@MXV@\@MXV@label.3Dlights}{\@MXV@lights}% - \@MXV@labeltoaux{@MXV@\@MXV@label.3Drender}{\@MXV@render}% - \@MXV@newlabel{@MXV@\@MXV@label.3Drender}{\@MXV@render}% + \@MXV@labeltoaux{@MXV@\@MXV@label.3Dbg}{\@MXV@defaultbg}% + \@MXV@newlabel{@MXV@\@MXV@label.3Dbg}{\@MXV@defaultbg}% + \@MXV@labeltoaux{@MXV@\@MXV@label.3Dlights}{\@MXV@defaultlights}% + \@MXV@newlabel{@MXV@\@MXV@label.3Dlights}{\@MXV@defaultlights}% + \@MXV@labeltoaux{@MXV@\@MXV@label.3Drender}{\@MXV@defaultrender}% + \@MXV@newlabel{@MXV@\@MXV@label.3Drender}{\@MXV@defaultrender}% \fi% \ifx\@MXV@@label\@empty\else% \@MXV@labeltoaux{@MXV@\@MXV@@label.3Doncurpage}{\the\@MXV@iiidoncurpage}% @@ -2311,9 +2645,6 @@ %for remote control of media \newcommand\movieref[3][]{% - \ifpdf\else% - \ifthenelse{\isundefined{\pdfmark}}{\@MXV@missing{hyperref}}{}% - \fi% \leavevmode% % save text argument \savebox{\@MXV@textbox}{\ifHy@colorlinks\color{\@linkcolor}\fi#3}% @@ -2390,22 +2721,28 @@ % %actions completely different in 3D & 2D context \ifthenelse{\boolean{@MXV@iiid}}{% #### 3D #### + %retrieve default background colour + \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Dbg}}{undefined}}{% + \gdef\@MXV@defaultbg{1 1 1}% + }{% + \xdef\@MXV@defaultbg{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Dbg}}% + }% %retrieve default lighting scheme \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Dlights}}{undefined}}{% - \edef\@MXV@lights{}% + \gdef\@MXV@defaultlights{}% }{% - \edef\@MXV@lights{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Dlights}}% + \xdef\@MXV@defaultlights{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Dlights}}% }% %retrieve default render mode \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Drender}}{undefined}}{% - \edef\@MXV@render{}% + \gdef\@MXV@defaultrender{Solid}% }{% - \edef\@MXV@render{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Drender}}% + \xdef\@MXV@defaultrender{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Drender}}% }% \setkeys{MXV@user}{#1}% \if@MXV@defaultviewprovided% define a new view, %using any of the coo, c2c, roo, caa options - \xdef\@MXV@xname{}% + \pdfstringdef\@MXV@xname{}% \edef\@MXV@args{\@MXV@coo\space\@MXV@ctoc\space\@MXV@roo\space\@MXV@roll\space}% \expandafter\@MXV@ciiwmatrix\@MXV@args% build C2W matrix \@MXV@viewobj% create pdf object of 3D view @@ -2448,21 +2785,24 @@ \@MXV@linkjscriptiiid try{ %JavaScript to print the camera settings of the current view - var camera=annot3D['\@MXV@label'].context3D.scene.cameras.getByIndex(0);% + var scene=annot3D['\@MXV@label'].context3D.scene;% + var camera=scene.cameras.getByIndex(0);% var coo=camera.targetPosition;% var c2c=camera.position.subtract(coo);% var roo=c2c.length;% c2c.normalize();% % %assemble result string - %{<coo_x> <coo_y> <coo_z>}{<c2c_x> <c2c_y> <c2c_z>}{<roo>}{<aac>} var spc=String.fromCharCode(32);% - var res='{';% - var x = (Math.abs(coo.x) < 1e-18 ? 0 : coo.x);% - var y = (Math.abs(coo.y) < 1e-18 ? 0 : coo.y);% - var z = (Math.abs(coo.z) < 1e-18 ? 0 : coo.z);% + var nl=String.fromCharCode(10);% + var charht=2;% + var res='VIEW\%={<insert descriptive name here (optional)>}'+nl;% + 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(Math.sqrt(x*x + y*y + z*z) > 0){% - res+=util.printf('\%s' + spc + '\%s' + spc + '\%s',% + res+=spc+spc;% + res+=util.printf('COO=\%s' + spc + '\%s' + spc + '\%s' +nl,% (Math.abs(x) < 1.001e-6 && Math.abs(x) > 0 ?% util.printf('\%.18f', x): x),% (Math.abs(y) < 1.001e-6 && Math.abs(y) > 0 ?% @@ -2470,13 +2810,14 @@ (Math.abs(z) < 1.001e-6 && Math.abs(z) > 0 ?% util.printf('\%.18f', z): z)% );% + charht+=2;% }% - res+='}{';% - x = (Math.abs(c2c.x) < 1e-18 ? 0 : c2c.x);% - y = (Math.abs(c2c.y) < 1e-18 ? 0 : c2c.y);% - z = (Math.abs(c2c.z) < 1e-18 ? 0 : c2c.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+=util.printf('\%s' + spc + '\%s' + spc + '\%s',% + res += spc + spc;% + res+=util.printf('C2C=\%s' + spc + '\%s' + spc + '\%s' +nl,% (Math.abs(x) < 1.001e-6 && Math.abs(x) > 0 ?% util.printf('\%.18f', x): x),% (Math.abs(y) < 1.001e-6 && Math.abs(y) > 0 ?% @@ -2484,46 +2825,169 @@ (Math.abs(z) < 1.001e-6 && Math.abs(z) > 0 ?% util.printf('\%.18f', z): z)% );% + charht+=2;% }% - res+='}{';% if(roo > 0.11e-17){% - res+=util.printf('\%s',% - (roo < 1.001e-6 ? util.printf('\%.18f', roo): roo)% + res+= spc + spc;% + res+=util.printf('ROO=\%s' + nl,% + (roo < 1.001e-6 ? util.printf('\%.12f', roo): roo)% );% + charht+=2;% }% - res+='}{';% %determine the camera roll (camera.roll is bugged) - %camera up-vector from camera.up, the latter being the positional vector - %of the actual camera up-vector tip - var up = camera.up.subtract(camera.position);% - up.normalize();% - %find the camera up-vector up0, that corresponds to zero roll - %(Gram-Schmitt orthogonalisation) - var worldup=new annot3D['\@MXV@label'].context3D.Vector3();% - worldup.set(0,0,1);% - var out=c2c.scale(-1);% - var up0=worldup.subtract(out.scale(out.dot(worldup)));% - up0.normalize();% - var up0xup=up0.cross(up);% - var roll=0;% - if(up0xup.length>0){% - up0xup.normalize();% - var up0dotup=up.dot(up0);% - up0dotup=(Math.abs(up0dotup) > 1 ? Math.round(up0dotup) : up0dotup);% - %compute the angle between camera up and up0 vectors - roll=Math.acos(up0dotup)*180/Math.PI*out.dot(up0xup);% - }% - if(util.printf('\%.5f', roll)!=0){% - res+=util.printf('\%s', roll);% + %%camera up-vector from camera.up, the latter being the positional vector + %%of the actual camera up-vector tip + %var up = camera.up.subtract(camera.position);% + %up.normalize();% + %%find the camera up-vector up0, that corresponds to zero roll + %%(Gram-Schmitt orthogonalisation) + %var worldup=new annot3D['\@MXV@label'].context3D.Vector3();% + %worldup.set(0,0,1);% + %var out=c2c.scale(-1);% + %var up0=worldup.subtract(out.scale(out.dot(worldup)));% + %up0.normalize();% + %var up0xup=up0.cross(up);% + %var roll=0;% + %if(up0xup.length>0){% + % up0xup.normalize();% + % var up0dotup=up.dot(up0);% + % up0dotup=(Math.abs(up0dotup) > 1 ? Math.round(up0dotup) : up0dotup);% + % %compute the angle between camera up and up0 vectors + % roll=Math.acos(up0dotup)*180/Math.PI*out.dot(up0xup);% + %}% + var roll = camera.roll*180/Math.PI;% + if(util.printf('\%.4f', roll)!=0){% + res+=util.printf(spc +spc + 'ROLL=\%s' + nl, roll);% + charht+=2;% }% - res+='}{';% aac=camera.fov * 180/Math.PI;% if(util.printf('\%.5f', aac)!=30){% - res+=util.printf('\%s',% + res+=util.printf(spc + spc + 'AAC=\%s' + nl,% (Math.abs(aac) < 1.001e-6 ? util.printf('\%.18f', aac): aac)% );% + charht+=2;% }% - res+='}';% + rgb=scene.background.getColor();% + res+=spc + spc;% + res+=util.printf('BGCOLOR=\%f' + spc + '\%f' + spc + '\%f'% + + nl, rgb.r, rgb.g, rgb.b);% + charht+=2;% + switch(scene.lightScheme){% + case scene.LIGHT_MODE_FILE: + curlights='Artwork';break; + case scene.LIGHT_MODE_NONE: + curlights='None';break; + case scene.LIGHT_MODE_WHITE: + curlights='White';break; + case scene.LIGHT_MODE_DAY: + curlights='Day';break; + case scene.LIGHT_MODE_NIGHT: + curlights='Night';break; + case scene.LIGHT_MODE_BRIGHT: + curlights='Hard';break; + case scene.LIGHT_MODE_RGB: + curlights='Primary';break; + case scene.LIGHT_MODE_BLUE: + curlights='Blue';break; + case scene.LIGHT_MODE_RED: + curlights='Red';break; + case scene.LIGHT_MODE_CUBE: + curlights='Cube';break; + case scene.LIGHT_MODE_CAD: + curlights='CAD';break; + case scene.LIGHT_MODE_HEADLAMP: + curlights='Headlamp';break; + }% + res+=spc+spc+'LIGHTS='+curlights+nl;% + charht+=2;% + switch(scene.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; + }% + res+=spc+spc+'RENDERMODE='+currender+nl;% + charht+=2;% + for(var i=0;i<scene.meshes.count;i++){% + var mesh=scene.meshes.getByIndex(i);% + res+=spc+spc+'PART={'+mesh.name+'}'+nl;% + res+=spc+spc+spc+spc+'VISIBLE='+mesh.visible+nl;% + charht+=4;% + if(mesh.visible){% + res+=spc+spc+spc+spc+'OPACITY='+mesh.opacity+nl;% + charht+=2;% + 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!='Default'){% + res+=spc+spc+spc+spc+'RENDERMODE='+currender+nl;% + charht+=2;% + }% + }% + res+=spc+spc+'END'+nl;% + charht+=2;% + }% + res+='END'+nl;% + charht=(charht>40?40:charht);% %open pop-up displaying the result string var settings={% initialize: function(dialog) {% @@ -2536,16 +3000,19 @@ elements: [% {% type: 'static_text',% - name: 'Add' + spc + 'the' + spc + 'following' + spc + 'line' + spc +% + name: 'Add' + spc + 'the' + spc + 'following' + spc + 'VIEW' + spc + 'section' + spc + % 'to' + spc + 'a' + spc + 'file' + spc + 'of' + spc +% 'predefined' + spc + 'views.' + spc +% - '(See' + spc + 'option' + spc + '3Dviews!)'% + '(See' + spc + 'option' + spc + '3Dviews2!)'% },% {% type: 'edit_text',% item_id: 'text',% alignment: 'align_fill',% - readonly: false% + multiline: true,% + char_width: 80,% + char_height: charht,% + readonly: true% },% {% type: 'ok',% @@ -2750,19 +3217,25 @@ };% %create Miniball object var mb=new Miniball();% + %scene object + var scene=annot3D['\@MXV@label'].context3D.scene;% %aperture angle of the virtual camera - var aac=\@MXV@calc;% - %list of mesh nodes - var meshes=annot3D['\@MXV@label'].context3D.scene.meshes;% + var camera=scene.cameras.getByIndex(0);% + if('\@MXV@calc'=='current'){% + var aac=camera.fov*180/Math.PI;% + }else{% + var aac=\@MXV@calc;% + }% %auxiliary vectors var dir=new annot3D['\@MXV@label'].context3D.Vector3();% var up=new annot3D['\@MXV@label'].context3D.Vector3();% var corner=new annot3D['\@MXV@label'].context3D.Vector3();% %auxiliary 4x4 matrix var bbox4x4=new annot3D['\@MXV@label'].context3D.Matrix4x4();% - %iterate over all mesh nodes in the scene - for(i=0;i<meshes.count;i++){% - var mesh=meshes.getByIndex(i);% + %iterate over all visible mesh nodes in the scene + for(i=0;i<scene.meshes.count;i++){% + var mesh=scene.meshes.getByIndex(i);% + if(!mesh.visible) continue; %get the bbox of the mesh (local coordinates) var bbox=mesh.computeBoundingBox();% %local to parent transformation matrix @@ -2836,15 +3309,22 @@ %result string var res='';% var spc=String.fromCharCode(32);% - if(aac!=30){% - res+=util.printf('3Daac=\%s,' + spc,% + var nl=String.fromCharCode(10);% + var charht=2;% + var multiln=false;% + res+=util.printf(% + '3Droo=\%s,',(roo < 1.001e-6 ? util.printf('\%.18f', roo): roo) + );% + if(util.printf('\%.5f', aac)!=30){% + charht+=2;multiln=true; + res+=util.printf(nl+'3Daac=\%s,',% (Math.abs(aac) < 1.001e-6 && Math.abs(aac) > 0 ?% util.printf('\%.18f', aac): aac)% );% }% if(coo.length){% - res+=util.printf( '3Dcoo=\%s' + spc + '\%s' + spc + '\%s,'% - + spc,% + charht+=2;multiln=true; + res+=util.printf(nl+'3Dcoo=\%s' + spc + '\%s' + spc + '\%s,',% (Math.abs(coo.x) < 1.001e-6 && Math.abs(coo.x) > 0 ?% util.printf('\%.18f', coo.x): coo.x),% (Math.abs(coo.y) < 1.001e-6 && Math.abs(coo.y) > 0 ?% @@ -2853,9 +3333,110 @@ util.printf('\%.18f', coo.z): coo.z)% );% }% - res+=util.printf(% - '3Droo=\%s,' + spc, (roo < 1.001e-6 ? util.printf('\%.18f', roo): roo) - );% + % change camera position and target accordingly + camera.fov=aac*Math.PI/180;% + camera.targetPosition.set(coo);% + var c2c=camera.position.subtract(coo);% + c2c.normalize();% + camera.position.set(coo.add(c2c.scale(roo)));% + %output settings + 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)){% + charht+=2;multiln=true; + res+=util.printf(nl+'3Dc2c=\%s' + spc + '\%s' + spc + '\%s,',% + (Math.abs(x) < 1.001e-6 && Math.abs(x) > 0 ?% + util.printf('\%.18f', x): x),% + (Math.abs(y) < 1.001e-6 && Math.abs(y) > 0 ?% + util.printf('\%.18f', y): y),% + (Math.abs(z) < 1.001e-6 && Math.abs(z) > 0 ?% + util.printf('\%.18f', z): z)% + );% + }% + %determine the camera roll + var roll = camera.roll*180/Math.PI;% + if(util.printf('\%.4f', roll)!=0){% + charht+=2;multiln=true; + res+=util.printf(nl+'3Droll=\%s',roll);% + }% + %determine background colour + rgb=scene.background.getColor();% + if(!(rgb.r==1.0&&rgb.g==1.0&&rgb.b==1.0)){% + charht+=2;multiln=true; + res+=util.printf(nl+'3Dbg=\%f' + spc + '\%f' + spc + '\%f,'% + + nl, rgb.r, rgb.g, rgb.b);% + }% + %determine lighting scheme + switch(scene.lightScheme){% + case scene.LIGHT_MODE_FILE: + curlights='Artwork';break; + case scene.LIGHT_MODE_NONE: + curlights='None';break; + case scene.LIGHT_MODE_WHITE: + curlights='White';break; + case scene.LIGHT_MODE_DAY: + curlights='Day';break; + case scene.LIGHT_MODE_NIGHT: + curlights='Night';break; + case scene.LIGHT_MODE_BRIGHT: + curlights='Hard';break; + case scene.LIGHT_MODE_RGB: + curlights='Primary';break; + case scene.LIGHT_MODE_BLUE: + curlights='Blue';break; + case scene.LIGHT_MODE_RED: + curlights='Red';break; + case scene.LIGHT_MODE_CUBE: + curlights='Cube';break; + case scene.LIGHT_MODE_CAD: + curlights='CAD';break; + case scene.LIGHT_MODE_HEADLAMP: + curlights='Headlamp';break; + }% + if(curlights!='Artwork'){% + charht+=2;multiln=true; + res+=util.printf(nl+'3Dlights=\%s,', curlights);% + }% + %determine global render mode + switch(scene.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!='Solid'){% + charht+=2;multiln=true; + res+=util.printf(nl+'3Drender=\%s,', currender);% + }% var settings={% initialize: function(dialog){% dialog.load({% @@ -2876,7 +3457,10 @@ type: 'edit_text',% item_id: 'text',% alignment: 'align_fill',% - readonly: false% + multiline: multiln,% + char_width: 80,% + char_height: charht,% + readonly: true% },% {% type: 'ok',% @@ -3478,6 +4062,7 @@ %3D specific options \define@key{MXV@user}{3Dbg}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% + \def\@MXV@defaultbg{#1}% \def\@MXV@background{/BG<</CS/DeviceRGB/C[#1]>>}% }{\@MXV@neediiiD}% } @@ -3526,6 +4111,7 @@ \define@key{MXV@user}{3Dviews}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \IfFileExists{#1}{% + \def\@MXV@viewsfileii{}% \def\@MXV@viewsfile{#1}% }{% \PackageError{movie15}{3D views file `#1' cannot be opened% @@ -3535,13 +4121,28 @@ }% }{\@MXV@neediiiD}% } +\define@key{MXV@user}{3Dviews2}{% + \ifthenelse{\boolean{@MXV@iiiDfeat}}{% + \IfFileExists{#1}{% + \def\@MXV@viewsfile{}% + \def\@MXV@viewsfileii{#1}% + }{% + \PackageError{movie15}{3D views file `#1' cannot be opened% + }{% + Make sure file `#1' exists and is readable!% + }% + }% + }{\@MXV@neediiiD}% +} \define@key{MXV@user}{3Dlights}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% + \gdef\@MXV@defaultlights{#1}% \gdef\@MXV@lights{/LS <</Subtype/#1>>}% }{\@MXV@neediiiD}% } \define@key{MXV@user}{3Drender}{% \ifthenelse{\boolean{@MXV@iiiDfeat}}{% + \gdef\@MXV@defaultrender{#1}% \gdef\@MXV@render{/RM <</Subtype/#1>>}% }{\@MXV@neediiiD}% } @@ -3619,7 +4220,7 @@ \setboolean{@MXV@defaultviewprovided}{false}% }{\@MXV@neediiiD}% } -\define@key{MXV@user}{3Dcalculate}[30]{% +\define@key{MXV@user}{3Dcalculate}[current]{% %calculate optimal 3D settings for roo and coo for a given aac \ifthenelse{\boolean{@MXV@iiiDfeat}}{% \gdef\@MXV@calc{#1}% @@ -3687,9 +4288,6 @@ %compatibility macros \providecommand\movie[3][]{% - \ifpdf\else% - \ifthenelse{\isundefined{\pdfmark}}{\@MXV@missing{hyperref}}{}% - \fi% \leavevmode% \@MXV@reset% \def\@MXV@autostart{}\def\@MXV@loop{}\def\@MXV@showcontrols{}% @@ -3736,9 +4334,6 @@ } \newcommand\hyperlinkmovie[3][]{% - \ifpdf\else% - \ifthenelse{\isundefined{\pdfmark}}{\@MXV@missing{hyperref}}{}% - \fi% \leavevmode% \@MXV@reset% \def\@MXV@autostart{}\def\@MXV@loop{}\def\@MXV@showcontrols{}% |