summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/movie15
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/movie15
Initial commit
Diffstat (limited to 'macros/latex/contrib/movie15')
-rw-r--r--macros/latex/contrib/movie15/README371
-rw-r--r--macros/latex/contrib/movie15/doc/files/3dsystem.fig273
-rw-r--r--macros/latex/contrib/movie15/doc/files/3dsystem.pdfbin0 -> 4394 bytes
-rw-r--r--macros/latex/contrib/movie15/doc/files/3dsystem.tex29
-rw-r--r--macros/latex/contrib/movie15/doc/files/dice.u3dbin0 -> 160672 bytes
-rw-r--r--macros/latex/contrib/movie15/doc/files/dice.vws23
-rw-r--r--macros/latex/contrib/movie15/doc/files/dice.wrl119
-rw-r--r--macros/latex/contrib/movie15/doc/files/mailto.pngbin0 -> 962 bytes
-rw-r--r--macros/latex/contrib/movie15/doc/files/random.mpgbin0 -> 39869 bytes
-rw-r--r--macros/latex/contrib/movie15/doc/javascript/animation.js100
-rw-r--r--macros/latex/contrib/movie15/doc/javascript/lights.js51
-rw-r--r--macros/latex/contrib/movie15/doc/javascript/turntable.js63
-rw-r--r--macros/latex/contrib/movie15/doc/movie15.pdfbin0 -> 420002 bytes
-rw-r--r--macros/latex/contrib/movie15/doc/movie15.tex751
-rw-r--r--macros/latex/contrib/movie15/doc/overlay-example.pdfbin0 -> 56294 bytes
-rw-r--r--macros/latex/contrib/movie15/doc/overlay-example.tex47
-rw-r--r--macros/latex/contrib/movie15/movie15.sty4390
17 files changed, 6217 insertions, 0 deletions
diff --git a/macros/latex/contrib/movie15/README b/macros/latex/contrib/movie15/README
new file mode 100644
index 0000000000..da337288db
--- /dev/null
+++ b/macros/latex/contrib/movie15/README
@@ -0,0 +1,371 @@
+ =====================
+ The movie15 Package
+ =====================
+
+Author:
+
+ Alexander Grahn
+
+
+Description:
+
+ *
+ * Note:
+ * This package is obsolete now. Consider using package `media9'.
+ *
+
+ This package provides an interface to embed movies, sounds and 3D objects
+ into PDF documents for use with LaTeX as well as pdfLaTeX. It follows the
+ PDF-1.5 and PDF-1.6 specifications for embedding multimedia content. The
+ specification allows media file data to be completely incorporated into the
+ PDF output, thus producing self-contained PDF documents. A number of file
+ formats is supported. For a (possibly incomplete) list see the table at the
+ end of this file or refer to the PDF specification:
+
+ PDF Reference, fifth edition:
+ Adobe Portable Document Format version 1.6,
+ Implementation note 144, Appendix H.3,
+
+ available somewhere on Adobe's web site (http://www.adobe.com).
+
+ Note, this file only gives a summary of usage and available command
+ options. Please refer to the documentation `movie15.pdf' in the `doc/'
+ directory for details and examples.
+
+ Keywords: embed, movie, LaTeX, pdfLaTeX, PDF, 3D, JavaScript, include,
+ sound, video, multimedia, animation
+
+
+Usage:
+
+ \usepackage[<package options>]{movie15}
+
+ Package option `3D' enables the 3D feature from the PDF-1.6 specification.
+ With option `draft' media files are not included. Instead, the file name
+ is printed in a box of size <width>x(<height>+<depth>). `final' does the
+ opposite, overriding a global draft option specified in the \documentclass
+ command.
+
+
+ \includemovie[<options>]{<width>}{<height>}{<media file>}
+
+ <width> and <height> in TeX dimensions, may be left empty, see option `text'
+
+ <media file> file name of the media clip
+
+
+ \movieref[<options>]{<label spec>}{<text>}
+
+ makes <text> a hyperlink to the embedded media file which has been labelled
+ with <label spec> using the `label' option of the inclusion command.
+
+ Provides a means to control the playback state and properties of the
+ referenced media. In 3D context, it can be used to define an additional view
+ of the object, to access a particular view from the list of predefined views
+ by index or to run a JavaScript. Moreover, links can be created for
+ calculating 3D camera settings.
+
+ In addition to `play' (default), `stop', `resume', `pause', `close',
+ `3Dviewindex', `3Dcalculate' and `3Dgetview' it accepts `controls', `repeat',
+ `palindrome', `startat', `endat', `mouse', `rate', `volume', `default',
+ `3Dcoo', '3Droll', `3Dc2c', `3Droo', `3Dcaa' and `3Djscript' from the
+ subsequent list of command options.
+
+
+ Options:
+
+ attach[=false] By default, the embedded data stream is re-used as
+ embedded file attachment, giving the user the
+ opportunity to extract the media file and to save
+ it to disk for later playback with an external
+ player. Re-use as file attachment can be
+ suppressed with `attach=false'.
+
+ autoclose Close the media player when the page is closed.
+ Use of this option may be necessary for streamed
+ media, such as Real Video.
+
+ autopause Pause playback when page is closed.
+
+ autoplay Start playback when page is opened. Useful for
+ side by side movies to be played back
+ simultaneously.
+
+ autostop Stops playing but keeps the media loaded when the
+ page is closed. The media is rewound to its
+ beginning or its `startat' position. This option
+ is set by default if neither of the options
+ `autopause', `autoclose' or `continue' is set.
+
+ autoresume Resume previously paused playback when page
+ is opened.
+
+ continue Continue playback in background on premature page
+ change.
+
+ controls[=true|false] Display player specific controls.
+
+ depth=<depth> Specifies how far the media display area should
+ extend below the reference line of the running
+ text. Any valid TeX dimension will be accepted.
+
+ draft Locally switches to draft mode.
+
+ externalviewer Opens and plays the media in an external
+ application.
+
+ final Locally disables draft mode.
+
+ inline[=false] Movie file data are embedded into the PDF output
+ by default. Embedding can be suppressed using
+ `inline=false'.
+
+ label=<label spec> The media is labelled with <label spec> such that
+ it can be referenced by the `\movieref' command
+ somewhere else in the document.
+
+ mimetype=<mimetype> Mime type of media. Must be specified if
+ <media file> has a non-standard file name
+ extension from which the mimetype cannot be
+ guessed. See table `Known file name extensions'
+ below.
+
+ mouse[=true|false] Enable mouse interaction: Clicking onto the media
+ (giving it the focus) pauses the playback while
+ clicking outside resumes it. In 3D context this
+ option is set to `true' by default, but may be set
+ to `false' in order to make the 3D annotation
+ non-interactive.
+
+ palindrome[=true|false] Play media forward and backward.
+
+ playerid=<playerid> Forces a particular media player plug-in to be
+ used instead of the default one. Currently, the
+ following values are recognised:
+ AAPL_QuickTime, MACR_FlashPlayer, RNWK_RealPlayer,
+ MSFT_WindowsMediaPlayer, ADBE_MCI (Adobe builtin
+ player).
+
+ poster The first frame of the movie or the frame at the
+ beginning of the movie section specified by the
+ `startat' and `endat' options is shown.
+
+ poster=<image> Insert still image from file to be shown when
+ media is not activated. The file type depends on
+ the output driver: PS or EPS when using latex
+ together with dvips; PDF, PNG or JPEG when using
+ pdflatex.
+
+ Deprecated. Use option `text' instead.
+
+ See option `text' for a possibility to scale the
+ media display area according to the poster image
+ dimensions.
+
+ rate=<rate> Playback rate (multiple of original speed).
+
+ repeat[=<repeats>] Number of repeats. Without argument -> repeat
+ forever.
+
+ startat=<offset> Start/stop playback at the specified offsets
+ endat=<offset> (time, frame, named marker). <offset> syntax:
+
+ time:<seconds>
+ frame:<frame number>
+ marker:<quoted string>
+ {marker:<quoted string>, time:<seconds>}
+ {marker:<quoted string>, frame:<frame number>}
+
+ text=<text> <text> is typeset onto the media display area.
+ <text> is centred horizontally and vertically.
+ If either or both of the <width> and <height>
+ arguments are left empty, any unspecified
+ dimension of the media clip is scaled to fit the
+ corresponding dimension, i. e. width or height, of
+ <text>. Likewise, the depth of the media display
+ is adjusted to the depth of <text> if the `depth'
+ option has not been given.
+
+ This option can be used to scale the media display
+ area to the natural or scaled dimensions of the
+ poster image, e. g.:
+
+ \includemovie[text={\includegraphics[scale=2]{
+ path/to/poster}}]{}{}{path/to/movie}
+
+ textoverposter[=false] Set this option to `false' if you wish <text> to
+ be obscured by the external poster image (if
+ specified). Deprecated.
+
+ url Treat <media file> as URL. Sets option `inline'
+ to false automatically.
+
+ volume=<volume> Percentage of original volume.
+
+ 3Daac=<angle> This option sets the aperture angle of the camera,
+ measured in degrees. Fixed point real numbers
+ between 0 and 180 are admissible. A sensible value
+ of 30 is pre-set by default. Larger values can be
+ used to achieve wide-angle or fish-eye effects.
+
+ 3Dc2c=<x> <y> <z> Direction vector C2C of arbitrary length,
+ originating in the centre of orbit and pointing
+ to the virtual camera; cf. option `3Dcoo' for the
+ number format of <x> <y> <z>.
+
+ 3Dcoo=<x> <y> <z> Positional vector COO of the centre of orbit.
+ Only fixed point numbers in the range from
+ -999999999999999999.999999999999999999 to
+ +999999999999999999.999999999999999999 are
+ allowed.
+
+ 3Droll=<roll> Prescribes an initial camera roll around the
+ optical axis (in clockwise direction, if <roll>
+ is greater than zero); measured in degrees.
+
+ 3Droo=<r> Radius of orbit ROO of the virtual camera; cf.
+ option `3Dcoo' for the number format.
+
+ 3Dviews=<views file> Further named, predefined views can be set in an
+ auxiliary file specified by the 3Dviews option.
+ The file <views file> contains lines which obey
+ the syntax:
+
+[<name>]{<coo_x> <coo_y> <coo_z>}{<c2c_x> <c2c_y> <c2c_z>}{<roo>}{<roll>}{<aac>}
+
+ The <name> entry is optional. For <coo_x>,
+ <coo_y>, <coo_z>, <c2c_x>, <c2c_y>, <c2c_z>, <roo>
+ and <aac> the same rules as for the corresponding
+ options `3Dcoo', `3Dc2c', `3Droo' and `3Daac'
+ apply.
+
+ 3Dbg=<r> <g> <b> 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.
+
+ 3Dlights=<lighting scheme> Sets the default lighting scheme. Possible values
+ are: `None', `White', `Day', `Night', `Hard',
+ `Primary', `Blue', `Red', `Cube', `CAD',
+ `HeadLamp'.
+
+ 3Drender=<render mode> Sets the default render mode. Possible values
+ are: `Solid', `SolidWireframe', `Transparent',
+ `TransparentWireframe', `BoundingBox',
+ `TransparentBoundingBox',
+ `TransparentBoundingBoxOutline', `Wireframe',
+ `ShadedWireframe', `HiddenWireframe', `Vertices',
+ `ShadedVertices', `Illustration', `SolidOutline',
+ `ShadedIllustration'.
+
+ 3Djscript=<JavaScript file> Things like animation, lighting, background
+ colour etc. may also be script driven. Option
+ `3Djscript' associates a <JavaScript file> with
+ the 3D object. The script will be executed upon
+ activation of the object.
+
+ 3Dresource=<resource file 1>[, 3Dresource=<resource file 2> [, ...]]
+
+ Embeds additional 3D or rasterized image files for
+ use as resources in the 3D annotation. Possible
+ file types are U3D, Postscript (LaTeX + dvips) and
+ PDF/JPEG/PNG (pdfLaTeX). Embedded resources must
+ be loaded by the JavaScript method
+
+ Resource("pdf://<resource path>")
+
+ where <resource path> stands for the path to the
+ resource file as specified by the `3Dresource'
+ option.
+
+ Additional options for use with `\movieref':
+
+ play (Default) Immediately restarts playback. If new
+ playback settings have been specified through the
+ options given above, they override the original
+ settings being in effect during media inclusion.
+
+ stop Stops and rewinds the media to its beginning or to
+ the `startat' position.
+
+ resume Resumes paused media. In fact, this option makes
+ the hyperlink a toggle switch: repeated clicking
+ switches between paused and resumed state.
+
+ pause Has the same effect as option `resume'. Added for
+ completeness only.
+
+ close Immediately closes the media player.
+
+ default Play the media at the original settings which were in
+ effect during media inclusion.
+
+ 3Dviewindex=<index> Opens the first `F', last `L', next `N' or
+ previous `P' view from the list of additional
+ views, or the one indexed by an integer. `D' gives
+ access to the default view.
+
+ 3Dcalculate[=<aac angle>] Creates a link for calculating `3Droo' and `3Dcoo'
+ settings of the virtual camera. The default
+ aperture angle of 30 degrees is used for the
+ calculation unless an optional <aac angle> has
+ been provided.
+
+ 3Dgetview 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 `3Dviews'.
+
+
+Known file name extensions:
+
+ Extension MIME type Description
+ =============================================================================
+ aif, aifc, aiff audio/aiff Audio Interchange File
+ Format
+ au, snd audio/basic NeXT/Sun Audio Format
+ avi video/avi AVI (Audio/Video Inter-
+ leaved)
+ gif image/gif (animated) GIF
+ mid, rmi audio/midi MIDI (Musical Instrument
+ Digital Interface)
+ mov, qt video/quicktime Apple QuickTime
+ mp3, m3u audio/x-mp3 MPEG Audio Layer-3
+ mp4 video/mp4 MPEG-4 Video/Audio
+ mpeg, mpg video/mpeg MPEG-1 & 2 Video
+ ra audio/vnd.rn-realaudio Real Audio
+ rm, rv application/vnd.rn-realmedia Real Media (video & sound)
+ smil application/smil Synchronized Multimedia
+ Integration Language
+ swf application/x-shockwave-flash (Adobe?) Macromedia Flash
+ u3d model/u3d Universal 3D File Format
+ wav audio/wav MS Audio Format
+ wma audio/x-ms-wma Windows Media Audio Format
+ wmv video/x-ms-wmv Windows Media Video Format
+
+
+Requirements:
+
+ package `fp', if option `3D' is selected
+
+ pdfTeX, version >= 1.20 needed for PDF output
+
+ Adobe Reader, version >=6 for playing movies/sound,
+ Adobe Reader, version >=7 for 3D objects
+
+ Embedded media file data can also be extracted and saved to disk from within
+ Readers which support file attachments. This makes PDF documents a little more
+ portable to Readers which do not ship with a multimedia plugin.
+
+
+Installation:
+
+ Put the file movie15.sty to a place where TeX can find it.
+
+
+License:
+
+ This material is subject to the LaTeX Project Public License. See
+
+ http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
+
+ for the details of that license.
diff --git a/macros/latex/contrib/movie15/doc/files/3dsystem.fig b/macros/latex/contrib/movie15/doc/files/3dsystem.fig
new file mode 100644
index 0000000000..e2273139db
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/files/3dsystem.fig
@@ -0,0 +1,273 @@
+#FIG 3.2
+Landscape
+Center
+Metric
+A4
+100.00
+Single
+-2
+1200 2
+0 32 #9c0000
+0 33 #8c8c8c
+0 34 #8c8c8c
+0 35 #424242
+0 36 #8c8c8c
+0 37 #424242
+0 38 #8c8c8c
+0 39 #424242
+0 40 #8c8c8c
+0 41 #424242
+0 42 #8c8c8c
+0 43 #424242
+0 44 #e2e2ee
+0 45 #94949a
+0 46 #dbdbdb
+0 47 #a1a1b7
+0 48 #ededed
+0 49 #e0e0e0
+0 50 #86acff
+0 51 #7070ff
+0 52 #c6b797
+0 53 #eff8ff
+0 54 #dccba6
+0 55 #404040
+0 56 #808080
+0 57 #c0c0c0
+0 58 #8e8f8e
+0 59 #aaaaaa
+0 60 #555555
+0 61 #8e8e8e
+0 62 #d7d7d7
+0 63 #aeaeae
+0 64 #bebebe
+0 65 #515151
+0 66 #e7e3e7
+0 67 #000049
+0 68 #797979
+0 69 #303430
+0 70 #414141
+0 71 #c7b696
+0 72 #414541
+0 73 #e7e7e7
+0 74 #717571
+0 75 #dd9d93
+0 76 #f1ece0
+0 77 #c3c3c3
+0 78 #e2c8a8
+0 79 #e1e1e1
+0 80 #d2d2d2
+0 81 #da7a1a
+0 82 #f1e41a
+0 83 #887dc2
+0 84 #d6d6d6
+0 85 #8c8ca5
+0 86 #4a4a4a
+0 87 #8c6b6b
+0 88 #5a5a5a
+0 89 #636363
+0 90 #b79b73
+0 91 #4193ff
+0 92 #bf703b
+0 93 #db7700
+0 94 #dab800
+0 95 #006400
+0 96 #5a6b3b
+0 97 #d3d3d3
+0 98 #8e8ea4
+0 99 #f3b95d
+0 100 #89996b
+0 101 #646464
+0 102 #b7e6ff
+0 103 #86c0ec
+0 104 #bdbdbd
+0 105 #d39552
+0 106 #98d2fe
+0 107 #8c9c6b
+0 108 #f76b00
+0 109 #5a6b39
+0 110 #8c9c6b
+0 111 #8c9c7b
+0 112 #184a18
+0 113 #adadad
+0 114 #f7bd5a
+0 115 #636b9c
+0 116 #f7f7f7
+0 117 #de0000
+0 118 #adadad
+0 119 #f7bd5a
+0 120 #adadad
+0 121 #f7bd5a
+0 122 #636b9c
+0 123 #526b29
+0 124 #949494
+0 125 #006300
+0 126 #00634a
+0 127 #7b844a
+0 128 #e7bd7b
+0 129 #a5b5c6
+0 130 #6b6b94
+0 131 #846b6b
+0 132 #529c4a
+0 133 #d6e7e7
+0 134 #526363
+0 135 #186b4a
+0 136 #9ca5b5
+0 137 #ff9400
+0 138 #ff9400
+0 139 #00634a
+0 140 #7b844a
+0 141 #63737b
+0 142 #e7bd7b
+0 143 #184a18
+0 144 #f7bd5a
+0 145 #dedede
+0 146 #f3eed3
+0 147 #f5ae5d
+0 148 #95ce99
+0 149 #b5157d
+0 150 #eeeeee
+0 151 #848484
+0 152 #7b7b7b
+0 153 #005a00
+0 154 #e77373
+0 155 #ffcb31
+0 156 #29794a
+0 157 #de2821
+0 158 #2159c6
+0 159 #f8f8f8
+0 160 #e6e6e6
+0 161 #21845a
+0 162 #cccccc
+0 163 #999999
+0 164 #b2b2b2
+0 165 #c9c9c9
+0 166 #dfd8df
+0 167 #f7f3f7
+0 168 #cdcdcd
+0 169 #6c6c6c
+5 1 0 1 0 7 45 -1 -1 0.000 0 0 1 1 1543.224 2237.643 2833 2393 2598 2996 2143 3390
+ 2 0 1.00 60.00 120.00
+ 2 0 1.00 60.00 120.00
+5 1 2 1 0 7 52 -1 -1 4.000 1 0 1 1 11576.552 9623.869 442 3442 1349 2035 2462 729
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+5 1 2 1 0 7 52 -1 -1 4.000 1 1 1 1 7430.119 -1873.223 802 1109 1315 2055 2088 3055
+ 0 0 1.00 60.00 120.00
+ 0 0 1.00 60.00 120.00
+6 4753 4744 6037 5510
+5 1 0 1 0 7 100 -1 -1 0.000 0 0 0 0 5712.721 5265.408 5756 4952 5978 5093 6024 5322
+5 1 2 1 0 7 100 -1 -1 2.000 1 0 0 0 5442.537 5285.331 4944 5096 5258 4785 5692 4814
+5 1 2 1 0 7 100 -1 -1 2.000 1 1 0 0 5841.704 5281.825 5968 5335 5808 5149 5709 5316
+5 1 2 1 0 7 100 -1 -1 2.000 1 0 0 0 5122.611 5132.487 4986 5129 5207 5025 5230 5217
+5 1 0 1 0 7 98 -1 -1 0.000 1 0 0 0 5468.833 4766.333 5072 5236 5056 5222 5039 5206
+5 1 0 1 0 7 98 -1 -1 0.000 1 1 0 0 5071.511 5140.272 5011 5132 5012 5154 5026 5181
+5 1 0 1 0 7 98 -1 -1 0.000 1 0 0 0 5945.000 5164.000 5794 5382 5778 5370 5760 5354
+5 1 0 1 0 7 50 -1 -1 0.000 1 1 0 0 5659.846 5403.315 5786 5455 5627 5271 5528 5438
+5 1 0 1 0 7 50 -1 -1 0.000 0 0 0 0 5260.632 5406.447 4760 5215 5074 4904 5510 4932
+5 1 0 1 0 7 50 -1 -1 0.000 0 0 0 0 5529.852 5383.891 5574 5071 5795 5212 5841 5439
+5 1 0 1 0 7 50 -1 -1 0.000 1 0 0 0 4941.237 5252.972 4804 5250 5026 5145 5049 5338
+5 1 0 1 0 7 98 -1 -1 0.000 1 0 0 0 5442.380 5294.428 5068 4904 5255 4787 5689 4813
+5 1 0 1 0 7 98 -1 -1 0.000 1 1 0 0 5789.373 5293.415 5732 5285 5733 5307 5747 5333
+5 1 0 1 0 7 98 -1 -1 0.000 1 1 0 0 5825.000 5279.500 5704 5271 5704 5288 5706 5303
+1 3 2 1 0 7 100 -1 -1 2.000 1 6.0772 5123 5130 111 111 5123 5130 5234 5130
+1 3 2 1 0 7 100 -1 -1 2.000 1 6.0772 5844 5281 111 111 5844 5281 5955 5281
+1 3 0 1 0 7 50 -1 -1 0.000 1 6.0772 4940 5254 111 111 4940 5254 5050 5274
+1 3 0 1 0 7 50 -1 -1 0.000 1 6.0772 5662 5402 111 111 5662 5402 5703 5507
+2 1 0 1 0 7 100 -1 -1 0.000 0 0 -1 0 0 2
+ 5692 4814 5756 4952
+2 1 2 1 0 7 100 -1 -1 2.000 0 1 -1 0 0 2
+ 6024 5320 5968 5335
+2 1 2 1 0 7 100 -1 -1 2.000 0 1 -1 0 0 2
+ 4941 5094 4986 5129
+2 1 2 1 0 7 100 -1 -1 2.000 0 1 -1 0 0 2
+ 4761 5215 4944 5096
+2 1 2 1 0 7 98 -1 -1 2.000 0 1 -1 0 0 2
+ 5049 5338 5228 5220
+2 1 2 1 0 7 98 -1 -1 2.000 0 1 -1 0 0 2
+ 5528 5438 5709 5319
+2 1 2 1 0 7 98 -1 -1 2.000 0 1 -1 0 0 2
+ 4806 5250 4989 5131
+2 1 2 1 0 7 98 -1 -1 2.000 0 1 -1 0 0 2
+ 5786 5454 5968 5336
+2 1 0 1 0 7 98 -1 -1 0.000 0 1 -1 0 0 2
+ 4953 5157 4992 5131
+2 1 0 1 0 7 80 -1 -1 0.000 0 0 -1 0 0 2
+ 4971 4954 5153 4835
+2 1 0 1 0 7 50 -1 -1 0.000 0 1 -1 0 0 2
+ 4804 5251 4842 5227
+2 1 0 1 0 7 50 -1 -1 0.000 0 1 -1 0 0 2
+ 4760 5215 4804 5250
+2 1 0 1 0 7 50 -1 -1 0.000 0 1 -1 0 0 2
+ 5049 5338 5528 5438
+2 1 0 1 0 7 50 -1 -1 0.000 0 1 -1 0 0 2
+ 5841 5439 5786 5455
+2 1 0 1 0 7 50 -1 -1 0.000 0 1 -1 0 0 2
+ 5510 4932 5574 5071
+2 1 0 1 0 7 50 -1 -1 0.000 0 1 -1 0 0 2
+ 5528 5438 5565 5413
+2 1 0 1 0 7 50 -1 -1 0.000 0 1 -1 0 0 2
+ 5841 5439 6023 5322
+2 1 0 1 0 7 50 -1 -1 0.000 0 1 -1 0 0 2
+ 5755 4952 5574 5071
+2 1 0 1 0 7 50 -1 -1 0.000 0 1 -1 0 0 2
+ 5690 4814 5510 4932
+2 1 2 1 0 7 100 -1 -1 2.000 0 1 -1 0 0 2
+ 5228 5217 5708 5316
+-6
+6 1009 1590 1714 2595
+6 1399 1782 1714 2435
+5 1 0 0 0 7 55 -1 2 0.000 0 0 0 0 1438.929 2167.804 1604 1949 1708 2220 1500 2435
+2 3 0 0 7 7 55 -1 2 0.000 1 0 -1 0 0 6
+ 1399 1782 1604 1948 1501 2435 1462 2428 1460 1899 1399 1782
+-6
+2 3 0 2 0 7 50 -1 14 0.000 1 0 -1 0 0 5
+ 1300 1607 1613 2067 1322 2533 1024 2058 1300 1607
+2 3 0 2 0 7 54 -1 14 0.000 1 0 -1 0 0 6
+ 1322 2534 1406 2580 1692 2125 1610 2073 1323 2535 1322 2534
+2 3 0 2 0 7 54 -1 10 0.000 1 0 -1 0 0 5
+ 1300 1605 1384 1668 1693 2117 1618 2072 1300 1605
+-6
+1 1 1 1 0 7 50 -1 -1 4.000 1 5.7596 3060 3330 405 900 3060 3330 3465 3337
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 1 3
+ 1 1 2.00 120.00 240.00
+ 1 1 2.00 120.00 240.00
+ 2205 1305 2205 6165 7245 7155
+2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+ 1 1 2.00 120.00 240.00
+ 2205 6165 5985 4095
+2 1 1 1 4 7 50 -1 -1 4.000 0 1 -1 1 0 2
+ 2 0 1.00 60.00 120.00
+ 5440 5973 5440 5112
+2 1 1 1 4 7 50 -1 -1 4.000 0 1 -1 1 0 2
+ 2 0 1.00 60.00 120.00
+ 4331 6582 5440 5973
+2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 1 0 2
+ 2 0 2.00 120.00 240.00
+ 2205 6165 5440 5112
+2 1 1 1 1 7 50 -1 -1 4.000 0 1 -1 1 0 2
+ 2 0 1.00 60.00 120.00
+ 4621 4954 4014 5283
+2 1 1 1 1 7 50 -1 -1 4.000 0 1 -1 1 0 2
+ 2 0 1.00 60.00 120.00
+ 4014 5283 4014 4048
+2 1 0 2 1 7 60 -1 -1 0.000 0 0 -1 1 0 2
+ 2 0 2.00 120.00 240.00
+ 5441 5112 4014 4048
+2 1 1 1 1 7 60 -1 -1 4.000 0 1 -1 1 0 2
+ 2 0 1.00 66.00 130.50
+ 5441 5112 4622 4953
+2 1 1 1 4 7 49 -1 -1 4.000 0 1 -1 1 0 2
+ 2 0 1.00 60.00 120.00
+ 2205 6165 4331 6582
+2 1 3 2 1 7 70 -1 -1 7.500 0 1 -1 0 0 2
+ 5443 5112 1683 2312
+2 1 1 1 0 7 100 -1 -1 4.000 0 0 -1 0 0 3
+ 3465 2532 1335 2060 2532 4025
+4 0 1 50 -1 0 12 0.0000 3 195 1845 4470 4308 $\\overrightarrow{C2C}$\001
+4 0 0 50 -1 0 12 0.0000 3 165 315 6013 4272 $Y$\001
+4 0 0 50 -1 0 12 0.0000 3 165 315 7140 7372 $X$\001
+4 0 0 50 -1 0 12 0.0000 3 165 300 2266 1297 $Z$\001
+4 0 4 50 -1 0 12 0.0000 3 195 1905 4090 5815 $\\overrightarrow{COO}$\001
+4 2 0 50 -1 0 12 0.0000 3 195 690 2160 6210 $(0,0,0)$\001
+4 1 0 50 -1 0 12 0.0000 3 195 1755 2835 2310 $\\sphericalangle AAC$\001
+4 0 1 50 -1 0 12 0.0000 3 165 570 3635 3680 $ROO$\001
diff --git a/macros/latex/contrib/movie15/doc/files/3dsystem.pdf b/macros/latex/contrib/movie15/doc/files/3dsystem.pdf
new file mode 100644
index 0000000000..998f4b622d
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/files/3dsystem.pdf
Binary files differ
diff --git a/macros/latex/contrib/movie15/doc/files/3dsystem.tex b/macros/latex/contrib/movie15/doc/files/3dsystem.tex
new file mode 100644
index 0000000000..d2e23ceac7
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/files/3dsystem.tex
@@ -0,0 +1,29 @@
+\begin{picture}(0,0)%
+\includegraphics[clip, scale=1, viewport=0 3 433 424]{3dsystem}%
+\end{picture}%
+\setlength{\unitlength}{4144sp}%
+%
+\begingroup\makeatletter\ifx\SetFigFont\undefined%
+\gdef\SetFigFont#1#2#3#4#5{%
+ \reset@font\fontsize{#1}{#2pt}%
+ \fontfamily{#3}\fontseries{#4}\fontshape{#5}%
+ \selectfont}%
+\fi\endgroup%
+\begin{picture}(6873.43196911197,6682.94424710425)(435,-6534.37806949807)%
+\put(4471,-3469){\makebox(0,0)[lb]{\smash{{\SetFigFont{12}{14.4}{\familydefault}{\mddefault}{\updefault}{\color[rgb]{0,0,1}$\overrightarrow{C2C}$}%
+}}}}%
+\put(6014,-3433){\makebox(0,0)[lb]{\smash{{\SetFigFont{12}{14.4}{\familydefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$Y$}%
+}}}}%
+\put(7141,-6533){\makebox(0,0)[lb]{\smash{{\SetFigFont{12}{14.4}{\familydefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$X$}%
+}}}}%
+\put(2267,-458){\makebox(0,0)[lb]{\smash{{\SetFigFont{12}{14.4}{\familydefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$Z$}%
+}}}}%
+\put(4091,-4976){\makebox(0,0)[lb]{\smash{{\SetFigFont{12}{14.4}{\familydefault}{\mddefault}{\updefault}{\color[rgb]{1,0,0}$\overrightarrow{COO}$}%
+}}}}%
+\put(2161,-5371){\makebox(0,0)[rb]{\smash{{\SetFigFont{12}{14.4}{\familydefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$(0,0,0)$}%
+}}}}%
+\put(2836,-1471){\makebox(0,0)[b]{\smash{{\SetFigFont{12}{14.4}{\familydefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$\sphericalangle AAC$}%
+}}}}%
+\put(3636,-2841){\makebox(0,0)[lb]{\smash{{\SetFigFont{12}{14.4}{\familydefault}{\mddefault}{\updefault}{\color[rgb]{0,0,1}$ROO$}%
+}}}}%
+\end{picture}%
diff --git a/macros/latex/contrib/movie15/doc/files/dice.u3d b/macros/latex/contrib/movie15/doc/files/dice.u3d
new file mode 100644
index 0000000000..ae14b756a1
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/files/dice.u3d
Binary files differ
diff --git a/macros/latex/contrib/movie15/doc/files/dice.vws b/macros/latex/contrib/movie15/doc/files/dice.vws
new file mode 100644
index 0000000000..3b1bd9a7a4
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/files/dice.vws
@@ -0,0 +1,23 @@
+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/macros/latex/contrib/movie15/doc/files/dice.wrl b/macros/latex/contrib/movie15/doc/files/dice.wrl
new file mode 100644
index 0000000000..23b1ef92a2
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/files/dice.wrl
@@ -0,0 +1,119 @@
+#VRML V1.0 ascii
+
+# dice.wrl
+# based on the work of
+# Peter Whitehouse <pwhitehouse@optusnet.com.au>
+# http://www.wonko.info/vrml/dice.txt
+
+Separator {
+ DEF _dice Shape {
+ geometry Box {
+ size 8 8 8
+ }
+ }
+ DEF _sphere0 Separator {
+ Material { diffuseColor [ 0.2 0.8 0.2 ] }
+ Translation { translation -2 2 -4 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_0 Separator {
+ Material { diffuseColor [ 0.2 0.8 0.2 ] }
+ Translation { translation 2 -2 -4 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1 Separator {
+ Material { diffuseColor [ 1 0.5 0.8 ] }
+ Translation { translation -2 2 4 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_0_1 Separator {
+ Material { diffuseColor [ 1 0.5 0.8 ] }
+ Translation { translation 2 -2 4 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2 Separator {
+ Material { diffuseColor [ 1 0.5 0.8 ] }
+ Translation { translation 0 0 4 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_3 Separator {
+ Material { diffuseColor [ 0.3 0.3 1 ] }
+ Translation { translation -4 2 1.5 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_0_1_3 Separator {
+ Material { diffuseColor [ 0.3 0.3 1 ] }
+ Translation { translation -4 2 -1.5 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_3_4 Separator {
+ Material { diffuseColor [ 0.3 0.3 1 ] }
+ Translation { translation -4 0 1.5 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_0_1_3_4 Separator {
+ Material { diffuseColor [ 0.3 0.3 1 ] }
+ Translation { translation -4 -2 -1.5 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_4 Separator {
+ Material { diffuseColor [ 0.3 0.3 1 ] }
+ Translation { translation -4 -2 1.5 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_5_6 Separator {
+ Material { diffuseColor [ 1 1 0 ] }
+ Translation { translation 0 4 0 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_5_7 Separator {
+ Material { diffuseColor [ 1 1 0 ] }
+ Translation { translation 2 4 -2 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_5_6_7 Separator {
+ Material { diffuseColor [ 1 1 0 ] }
+ Translation { translation 2 4 2 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_5_7_8 Separator {
+ Material { diffuseColor [ 1 0 0 ] }
+ Translation { translation -2 -4 -2 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_5_6_7_8 Separator {
+ Material { diffuseColor [ 1 0 0 ] }
+ Translation { translation -2 -4 2 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_5_7_9 Separator {
+ Material { diffuseColor [ 1 0 0 ] }
+ Translation { translation 2 -4 -2 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_5_6_7_9 Separator {
+ Material { diffuseColor [ 1 0 0 ] }
+ Translation { translation 2 -4 2 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_5_7_8_9 Separator {
+ Material { diffuseColor [ 1 1 0 ] }
+ Translation { translation -2 4 -2 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_2_3_5_6_7_8_9 Separator {
+ Material { diffuseColor [ 1 1 0 ] }
+ Translation { translation -2 4 2 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_3_10 Separator {
+ Material { diffuseColor [ 0 1 1 ] }
+ Translation { translation 4 0 0 }
+ Sphere { radius 1.00000 }
+ }
+ DEF _sphere0_1_3_4_12 Separator {
+ Material { diffuseColor [ 0.3 0.3 1 ] }
+ Translation { translation -4 0 -1.5 }
+ Sphere { radius 1.00000 }
+ }
+}
diff --git a/macros/latex/contrib/movie15/doc/files/mailto.png b/macros/latex/contrib/movie15/doc/files/mailto.png
new file mode 100644
index 0000000000..12831c2410
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/files/mailto.png
Binary files differ
diff --git a/macros/latex/contrib/movie15/doc/files/random.mpg b/macros/latex/contrib/movie15/doc/files/random.mpg
new file mode 100644
index 0000000000..368cd368b6
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/files/random.mpg
Binary files differ
diff --git a/macros/latex/contrib/movie15/doc/javascript/animation.js b/macros/latex/contrib/movie15/doc/javascript/animation.js
new file mode 100644
index 0000000000..f0789891f4
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/javascript/animation.js
@@ -0,0 +1,100 @@
+/////////////////////////////////////////////////////////////////
+//
+// animation.js
+//
+// JavaScript for use with `3Djscript' option of \includemovie
+//
+// * Activates keyframe animation embedded in the u3d file.
+// * Arrow keys `Down', `Up' can be used for speeding up and
+// slowing down a running animation, key `Home' for reverting
+// to the default speed.
+//
+// * Adjustable parameters:
+var rate = 1; // 1 --> use original speed as default
+var palindrome = true; // true --> play forth and back
+//
+/////////////////////////////////////////////////////////////////
+
+//get the first animation in the scene
+var myAnim = scene.animations.getByIndex(0);
+myAnim.wallTime = 0;
+myAnim.speed = 1;
+myAnim.myLength = myAnim.endTime - myAnim.startTime;
+scene.activateAnimation(myAnim);
+
+//method to set animation speed
+myAnim.setSpeed = function (speed) {
+ speed = Math.abs(speed);
+ this.wallTime /= speed/this.speed; //correct the walltime
+ this.speed = speed;
+};
+
+//method to change animation speed by a factor
+myAnim.changeSpeed = function (mult) {
+ this.wallTime /= mult; //correct the walltime
+ this.speed *= mult;
+};
+
+//set default speed
+myAnim.setSpeed(rate);
+
+//menu items
+runtime.addCustomMenuItem("faster", "Faster (Key Up)", "default", 0);
+runtime.addCustomMenuItem("slower", "Slower (Key Down)", "default", 0);
+runtime.addCustomMenuItem("default", "Default Speed (Key Home)", "default", 0);
+
+//menu handler to control speed
+menuEventHandler = new MenuEventHandler();
+menuEventHandler.onEvent = function(e) {
+ if (e.menuItemName == "faster") {
+ myAnim.changeSpeed(1.25);
+ }
+ else if (e.menuItemName == "slower") {
+ myAnim.changeSpeed(1/1.25);
+ }
+ else if (e.menuItemName == "default") {
+ myAnim.setSpeed(rate);
+ }
+};
+runtime.addEventHandler(menuEventHandler);
+
+//key handler to control speed
+keyEventHandler = new KeyEventHandler();
+keyEventHandler.onKeyDown = true;
+keyEventHandler.onEvent = function(e) {
+ switch(e.characterCode) {
+ case 30: //key up
+ myAnim.changeSpeed(1.05);
+ break;
+
+ case 31: //key down
+ myAnim.changeSpeed(1/1.05);
+ break;
+
+ case 4: //key home
+ myAnim.setSpeed(rate);
+ break;
+
+ case 1: //key end
+ myAnim.setSpeed(rate);
+ break;
+ }
+};
+runtime.addEventHandler(keyEventHandler);
+
+//run the animation using a TimeEventHandler
+myTimer = new TimeEventHandler();
+myTimer.onTimeChange = true;
+myTimer.onEvent = function(e) {
+ myAnim.wallTime += e.deltaTime;
+ if (palindrome == true) {
+ myAnim.currentTime =
+ myAnim.startTime
+ + myAnim.myLength/2
+ * (1 - Math.cos(Math.PI * myAnim.speed/myAnim.myLength * myAnim.wallTime));
+ } else {
+ myAnim.currentTime = myAnim.startTime
+ + (myAnim.speed * myAnim.wallTime % myAnim.myLength);
+ }
+};
+runtime.addEventHandler(myTimer);
diff --git a/macros/latex/contrib/movie15/doc/javascript/lights.js b/macros/latex/contrib/movie15/doc/javascript/lights.js
new file mode 100644
index 0000000000..ba367dfbb6
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/javascript/lights.js
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////
+//
+// lights.js
+//
+// example JavaScript for use with `3Djscript' option of \includemovie
+//
+// * Adds light sources around the object for better illumination.
+//
+////////////////////////////////////////////////////////////////////////
+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/macros/latex/contrib/movie15/doc/javascript/turntable.js b/macros/latex/contrib/movie15/doc/javascript/turntable.js
new file mode 100644
index 0000000000..f839c5c332
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/javascript/turntable.js
@@ -0,0 +1,63 @@
+/////////////////////////////////////////////////////////////////////
+//
+// turntable.js
+//
+// JavaScript for use with `3Djscript' option of \includemovie
+//
+// * Greatly improves the rotational behaviour of the 3D object,
+// prevents it from tilting to the side while dragging the mouse.
+// This is achieved by suppressing the rolling of the camera about
+// its optical axis.
+//
+/////////////////////////////////////////////////////////////////////
+
+// maximum pitch (degrees from horizontal) of the camera
+var max_alpha = 88;
+var min_beta = 90 - max_alpha; // the complement
+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
+var cameraEventHandler = new CameraEventHandler();
+cameraEventHandler.onEvent = function (e) {
+ camera.axis_up = camera.up.subtract(camera.position);
+ camera.axis_up.normalize();
+}
+runtime.addEventHandler(cameraEventHandler);
+
+//suppresses camera rolling and limits camera pitch
+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();
+ cos_beta = c2c.dot(camera.axis_up); //cos of enclosed angle
+
+ //correct the camera position if it is too high or too low
+ if(Math.abs(cos_beta) > cos_min_beta) {
+ //auxiliary vectors a & b
+ var a = camera.axis_up.scale(cos_beta);
+ var b = c2c.subtract(a);
+ b.normalize();
+ b.scaleInPlace(tan_min_beta * a.length);
+
+ c2c.set(a.add(b));
+ c2c.normalize();
+
+ camera.position.set(camera.targetPosition.add(c2c.scale(roo)));
+ cos_beta = c2c.dot(camera.axis_up);
+ }
+
+ //suppress rolling
+ camera.up.set(
+ camera.position.add(camera.axis_up).add(c2c.scale(-cos_beta))
+ );
+};
+runtime.addEventHandler(mouseEventHandler);
diff --git a/macros/latex/contrib/movie15/doc/movie15.pdf b/macros/latex/contrib/movie15/doc/movie15.pdf
new file mode 100644
index 0000000000..04cba2380f
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/movie15.pdf
Binary files differ
diff --git a/macros/latex/contrib/movie15/doc/movie15.tex b/macros/latex/contrib/movie15/doc/movie15.tex
new file mode 100644
index 0000000000..1f3ac063a6
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/movie15.tex
@@ -0,0 +1,751 @@
+% Copyright 2004 Alexander Grahn
+%
+% This material is subject to the LaTeX Project Public License. See
+% http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
+% for the details of that license.
+%
+\documentclass[a4paper]{article}
+\pdfpagewidth595bp
+\pdfpageheight842bp
+\frenchspacing
+\usepackage[3D]{movie15}
+\usepackage{ragged2e}
+\usepackage{amssymb}
+\usepackage[UKenglish]{babel}
+\usepackage{color}
+\usepackage{graphicx}
+\usepackage{hyperref}
+\usepackage{textcomp}
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage{float}
+\usepackage{ifpdf}
+\usepackage{parskip}
+\usepackage{animate}
+
+\ifpdf\else
+ \makeatletter
+ \@latex@error{Please use pdfLaTeX to compile this documentation}
+ \makeatother
+\fi
+
+\hypersetup{
+ bookmarksnumbered,linktocpage,breaklinks,
+ pdftitle={The movie15 Package},
+ pdfsubject={Documentation},
+ pdfauthor={Alexander Grahn},
+ pdfkeywords={embed, movie, LaTeX, pdfLaTeX, PDF, 3D, JavaScript, include, sound, video, multimedia, animation},
+ citebordercolor={0 0 1},
+ filebordercolor={0 0 1},
+ linkbordercolor={0 0 1},
+ menubordercolor={0 0 1},
+ pagebordercolor={0 0 1},
+ urlbordercolor={0 0 1}
+}
+
+\begin{document}
+\title{The {\sffamily movie15} Package}
+\author{Alexander Grahn\\[1ex]\includegraphics[height=2.7ex]{mailto}}
+\maketitle
+
+\begin{abstract}\noindent
+A \LaTeX{} package for inclusion of movies, sounds and 3D objects into PDF documents with PDF-1.5/1.6 compatibility.\\[0.2\baselineskip]
+\emph{Keywords}: embed, movie, LaTeX, pdfLaTeX, PDF, 3D, JavaScript, \mbox{include}, sound, video, multimedia, animation
+\end{abstract}
+
+\begin{animateinline}[autoplay,loop]{1.5}\strut{\bf\color{red} Note:}\newframe\newframe[5]\end{animateinline} This package is obsolete now. Consider using package `media9'.
+\tableofcontents
+
+%\newpage
+\section{Introduction}
+
+The way multimedia content, i.\,e. movies and sounds, is included into PDF has changed with Adobe's PDF specification, version 1.5. PDF-1.5 supports a larger variety of movie and sound formats, limited only by the number of plug-ins available for Adobe Reader\textsuperscript{\scriptsize\textregistered}. With PDF-1.6, support for 3D objects, stored in the U3D file format, has been added. See Table \ref{table:mime} for a list of viable media formats. The specification allows media file contents to be completely embedded into the PDF output, thus producing self-contained PDF documents.
+
+This package provides an interface to embed movies, sounds and 3D objects into PDF documents for use with \LaTeX{} as well as pdf\LaTeX. Media file contents is incorporated into PDF output by default. This is done either directly during source processing using pdf\LaTeX{} or during conversion from Postscript to PDF using Ghostscript's \verb+ps2pdf+.
+
+The final PDF output can be viewed with Windows\textsuperscript{\scriptsize\textregistered} and Mac OS\textsuperscript{\scriptsize\textregistered} versions of Adobe Reader. However, embedded media file data can also be extracted and saved to disk from within Readers which support file attachments. This makes PDF documents a little more portable to Readers which do not ship with a multimedia plug-in.
+
+`movie15' works well together with the presentation making package `Beamer'. In particular it supports its overlay concept. See this \href{./overlay-example.pdf}{example}.
+%which uses the `Beamer' class.
+Also read the comments in the example's source file, `\verb+overlay-example.tex+', on how to use `movie15' with `Beamer'.
+
+\section{Installation}
+The file `movie15.sty' should be stored in a place where \LaTeX{} can find it.
+
+\section{Requirements}
+pdf\TeX{}, version $\ge1.20$, is needed for direct PDF output.
+
+If the package option `\verb+3D+' is set, `movie15' loads Michael Mehlich's `fp' package for fixed point arithmetic. Since it does not belong to the core packages of most \TeX{} distributions it must be installed prior to selecting the `\verb+3D+' option.
+
+Adobe Reader, version 6, is required for playing movies and sounds, version 7 for rendering embedded 3D content.
+
+%\newpage
+\section{Using the package}
+Invoke the package by putting the line
+\begin{verbatim}
+ \usepackage[<package options>]{movie15}
+\end{verbatim}
+to the preamble of your document, i.\,e. somewhere between \verb+\documentclass+ and \verb+\begin{document}+.
+
+`movie15' honours the following package options:
+\begin{verbatim}
+3D
+\end{verbatim}
+Enables the 3D feature from the PDF-1.6 specification. Inclusion of 3D files into PDF is discussed separately in section~\ref{sec:3D}.
+
+\begin{verbatim}
+draft
+\end{verbatim}
+Media files are not included. Just the file name is printed in a box of size \verb+<width>+$\times$(\verb+<height>++\verb+<depth>+).
+\begin{verbatim}
+final
+\end{verbatim}
+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' package is required.
+
+Note that several runs may be necessary to resolve internally created cross-references. Appropriate warnings will be issued in such cases.
+
+\section{The user interface}
+\subsection{Media inclusion}\label{usrif}
+Movies, sounds and 3D objects are embedded into the document using the command
+\begin{verbatim}
+ \includemovie[<options>]{<width>}{<height>}{<media file>}
+\end{verbatim}
+Unless left empty, the \verb+<width>+ and \verb+<height>+ arguments must be given in valid \TeX{} dimensions. Horizontal and vertical dimensions of the media clip are scaled independently to fit \verb+<width>+ and \verb+<height>+ or, if the two latter are empty, to fit the size of the text box, given as argument to the `\verb+text+' option; see \hyperlink{lnk:textoption}{below}. \verb+<media file>+ specifies the file name of the media clip. If the media file is embedded as part of the final PDF output, which is the default, it may reside wherever \TeX{} or Ghostscript search for input files, depending on the PDF producing method.
+
+Below, common options to \verb+\includemovie+ are listed. Options specific to embedding of 3D content are discussed separately in section~\ref{sec:3D}. The impatient reader may advance directly to the \hyperlink{sec:3Dtut}{3D quick-start guide}, which summarizes the basic steps for embedding 3D objects.
+\begin{verbatim}
+attach[=false]
+\end{verbatim}
+By default, the embedded data stream is re-used as embedded file attachment. This makes `movie15' a little more portable to PDF Readers which do not have a multimedia plug-in because it gives the user the opportunity to extract the media file and to save it to disk for later playback with an external player. However, support of file attachments is required. Re-use as file attachment can be suppressed with option `\verb+attach=false+'. Note that `\verb+attach=false+' is a poor method to prevent the user from obtaining a copy of the media file. There are several (free) tools for decompressing and extracting stream objects from PDF files.
+\begin{verbatim}
+autoclose
+\end{verbatim}
+Close the media player when the page is closed. Use of this option may be necessary for streamed media, such as Real Video.
+\begin{verbatim}
+autopause
+\end{verbatim}
+Pause playing when the page is closed.
+\begin{verbatim}
+autoplay
+\end{verbatim}
+Start playback of the media clip after the page has opened. This is especially useful if there are multiple movie clips on the current page to be played at the same time. Also resumes playback of previously paused media. In the case of embedded sound being started this way, \verb+<width>+ and \verb+<height>+ can safely be set to `0pt' since no further user interaction is necessary to start playing.
+\begin{verbatim}
+autostop
+\end{verbatim}
+Stops playing but keeps the media loaded when the page is closed. The media is rewound to its beginning or its `\verb+startat+' position. This option is set by default if neither of the options `\verb+autopause+', `\verb+autoclose+' or `\verb+continue+' is set.
+\begin{verbatim}
+autoresume
+\end{verbatim}
+Resume previously paused playback when the page is opened again.
+\begin{verbatim}
+continue
+\end{verbatim}
+Continue playback in background on premature page change. However, paused media remain paused. So do media that have reached the end or that still show the poster.
+\begin{verbatim}
+controls
+toolbar
+\end{verbatim}
+Player specific controls or toolbars are displayed during playback of the media clip, if available. The default is `\verb+false+'; controls are not shown.
+\begin{verbatim}
+depth=<depth>
+\end{verbatim}
+Specifies how far the media display area should extend below the bottom line of the running text. Any valid \TeX{} dimension is accepted.
+\begin{verbatim}
+draft
+\end{verbatim}
+Locally switches to draft mode.
+\begin{verbatim}
+externalviewer
+\end{verbatim}
+Opens and plays the media in an external application.
+\begin{verbatim}
+final
+\end{verbatim}
+Locally disables draft mode.
+\begin{verbatim}
+inline[=false]
+\end{verbatim}
+Media file \emph{data} are embedded into PDF output by default.
+This can be suppressed with option `\verb+inline=false+'.
+\begin{verbatim}
+label=<label spec>
+\end{verbatim}
+The media is labelled with \verb+<label spec>+ such that it can be referenced by the \verb+\movieref+ command elsewhere in the document. The \verb+\movieref+ command creates a hyperlink to either stop, pause, resume the media, to play it with different settings, such as frame rate or volume, or to show a different part of it. See section~\ref{hyperlinks} for details. \verb+<label spec>+ may consist of any sequence of letters, digits or punctuation characters.
+\begin{verbatim}
+mimetype=<mimetype>
+\end{verbatim}
+According to the PDF specification, the viewer application needs to know the MIME type of \verb+<media file>+. Package `movie15' tries to make a guess from the file name extension. If, however, a media file is of unknown type or has a non-standard file name extension, its MIME type must be explicitly specified using this option. See Table \ref{table:mime} for a list of known file name extensions.
+\begin{verbatim}
+mouse[=true|false]
+\end{verbatim}
+Enable mouse interaction: Clicking onto the media (giving it the focus) pauses the playback while clicking outside resumes it. Alternatively, once the media has got the focus, repeated pressing of key `P' on the keyboard switches between Play and Pause (at least with some players). In 3D context it specifies whether the 3D annotation should be interactive, i.\,e. responsive to mouse interaction. 3D annotations are interactive by default.
+\begin{verbatim}
+palindrome[=true|false]
+\end{verbatim}
+The media is played forward and backward, if supported by the media player. In combination with option `\verb+repeat+' this forward-and-reverse playback repeats as many times as specified. Each complete forward and reverse playback counts as one repeat.
+\begin{verbatim}
+playerid=<playerid>
+\end{verbatim}
+Forces a particular media player plug-in to be used instead of the default one. Currently, the following values are recognized:\\[1ex]
+{\tt\phantom{xxxx}AAPL\_QuickTime\\
+\phantom{xxxx}MACR\_FlashPlayer\\
+\phantom{xxxx}RNWK\_RealPlayer\\
+\phantom{xxxx}MSFT\_WindowsMediaPlayer\\
+\phantom{xxxx}ADBE\_MCI} (Adobe builtin player)
+\begin{verbatim}
+poster
+\end{verbatim}
+The first frame of the movie or the frame at the beginning of the movie section specified by the `\verb+startat+' option is shown.
+\begin{verbatim}
+poster=<image>
+\end{verbatim}
+Inserts still image from file \verb+<image>+ to be shown when the media clip is not activated. The file type of \verb+<image>+ depends on the output driver: PS or EPS when using \LaTeX{} together with \verb+dvips+; PDF, PNG or JPEG when using pdf\LaTeX. This option is obsolescent and should not be used any longer. Instead, use option `\verb+text+' if a still image from an external file is to be inserted. See option `\verb+text+' for a possibility to scale the media display area according to the poster image dimensions.
+\begin{verbatim}
+rate=<rate>
+\end{verbatim}
+\verb+<rate>+ specifies the playback rate, where $1$ is normal playback, $0.5$ is half speed, $2$ is double speed, $-1$ is normal speed in reverse etc.
+\begin{verbatim}
+repeat[=<repeats>]
+\end{verbatim}
+Specifies how often the media clip or embedded 3D animation will be played. Without argument this option causes the player to repeat forever.
+\begin{verbatim}
+startat=<offset>
+endat=<offset>
+\end{verbatim}
+Start/stop playback at the specified offsets. \verb+<offset>+ may be an absolute time or frame value, or a named marker, or a marker plus a time or frame. In the latter case, time or frame values are regarded as relative to the named marker. Support of markers, time and frame offsets is media type dependent. Media incompatible offsets are ignored. The following syntax applies to \verb+<offset>+:
+\begin{verbatim}
+ time:<time in seconds>
+ frame:<frame number>
+ marker:<quoted string>
+\end{verbatim}
+Some \verb+<offset>+ examples:
+\begin{verbatim}
+ time:20.5
+ frame:100
+ {marker:'Chapter 1', time:60}
+\end{verbatim}
+\hypertarget{lnk:textoption}{}
+\begin{verbatim}
+text=<text>
+\end{verbatim}
+\verb+<text>+ is typeset onto and centred within the media display area which has been specified by the \verb+<width>+ and \verb+<height>+ arguments as well as the `\verb+depth+' option. If either or both of the \verb+<width>+ and \verb+<height>+ arguments are left empty, any unspecified dimension of the media display is scaled to match the corresponding dimension, i.\,e. width and height, of \verb+<text>+. Likewise, the depth of the media display is adjusted to the depth of \verb+<text>+ if the optional `\verb+depth+' has not been given. Therefore, option `\verb+text+' can be used to scale the media display to the natural or scaled dimensions of a poster image file, such as (requires package `graphicx'; \emph{also note the empty {\tt<width>} and {\tt<height>} arguments!}):
+\begin{verbatim}
+ \includemovie[text={\includegraphics[scale=2]{path/to/poster}}]
+ {}{}{path/to/movie}
+\end{verbatim}
+In combination with the `\verb+poster+' option, which causes the poster image to be rendered from the movie during runtime, the PDF file size can be reduced somewhat by putting \verb+\includegraphics+ into a \verb+\phantom+ box:
+\begin{verbatim}
+ \includemovie[
+ poster,
+ text={\phantom{\includegraphics[scale=2]{path/to/poster}}}
+ ]{}{}{path/to/movie}
+\end{verbatim}
+\begin{verbatim}
+textoverposter[=false]
+\end{verbatim}
+Set this option to `\verb+false+' if you wish \verb+<text>+ to be obscured by the external poster image which has been inserted with the poster option. Deprecated.
+\begin{verbatim}
+url
+\end{verbatim}
+Treat \verb+<media file>+ as URL. Sets option `\verb+inline+' to `\verb+false+' automatically.
+\begin{verbatim}
+volume=<percentage of original volume>
+\end{verbatim}
+The meaning of this option should be self explaining.
+
+\subsection{Inclusion of 3D objects}\label{sec:3D}
+The PDF-1.6 specification, which was introduced with the advent of Adobe Acrobat/Reader 7, allows embedding of 3-dimensional graphic objects, such as CAD models or 3D scientific data, and lets the user interactively manipulate them. At the time of writing this documentation, the only supported file types were U3D~\cite{3diforg} and Adobe's PRC format, and only one commercial software~\cite{dexp} for exporting into the U3D format, yet from a number of CAD and 3D vector formats, including DXF and VRML, was known. Nevertheless, a try-out version of~\cite{dexp} can be downloaded without charge.
+
+Selection of the `\verb+3D+' package option enables the 3D feature. Most of the command options listed in section~\ref{usrif} do what they are supposed to do in the case of embedded 3D as well. Other options are ignored, in particular `\verb+startat+', `\verb+endat+', `\verb+volume+' and `\verb+playerid+'. Options `\verb+inline=false+' and `\verb+url+' are supported, but imply option `{\tt{}ex\-ter\-nal\-view\-er}', because the 3D Reader plug-in handles embedded files only.
+
+There are a few options to \verb+\includemovie+ 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$ around the centre of orbit, specified by the position vector $\overrightarrow{COO}$; $\sphericalangle AAC$ is the camera's aperture angle. In addition, the direction vector $\overrightarrow{C2C}$ is needed to specify the initial camera position.
+\begin{figure}[ht]
+ \resizebox{\linewidth}{!}{\input{3dsystem}}
+ \caption{Camera and 3D object in the World System $XYZ$; centre of orbit position vector $\vec{COO}$, centre of orbit to camera direction vector $\vec{C2C}$, radius of orbit $ROO$, aperture angle of camera $\sphericalangle AAC$.}\label{3dscene}
+\end{figure}
+
+The \emph{default view}, i.\,e. the view that is shown initially after activating the 3D object in the Reader, can be set using the options `\verb+3Dcoo+' for the centre of orbit, `\verb+3Dc2c+' for the centre of orbit to camera vector, `\verb+3Droo+' for the orbital radius and `\verb+3Daac+' for the aperture angle of the camera:
+\begin{verbatim}
+3Daac=<angle>
+\end{verbatim}
+This option sets the aperture angle of the camera, measured in degrees. Fixed point real numbers between 0 and 180 are admissible. A sensible value of 30 is pre-set by default. Larger values can be used to achieve wide-angle or fish-eye effects. See example~\ref{ex3d} in section~\ref{examples}.
+\begin{verbatim}
+3Dc2c=<x> <y> <z>
+\end{verbatim}
+\verb+<x> <y> <z>+ specify a direction vector $\overrightarrow{C2C}$ of arbitrary length, originating in the centre of orbit and pointing to the virtual camera. Only fixed point numbers in the range from\\[1ex]
+\phantom{xxxx}$-999999999999999999.999999999999999999$\\
+to\\
+\phantom{xxxx}$+999999999999999999.999999999999999999$\\[1ex]
+are allowed.
+\begin{verbatim}
+3Dcoo=<x> <y> <z>
+\end{verbatim}
+\verb+<x> <y> <z>+ specify the positional vector $\overrightarrow{COO}$ of the centre of orbit. See option `\verb+3Dc2c+' for the number format of \verb+<x> <y> <z>+.
+\begin{verbatim}
+3Droll=<roll>
+\end{verbatim}
+Prescribes an initial camera roll around the optical axis (in clockwise direction, if \verb+<roll>+ is greater that zero); measured in degrees.
+\begin{verbatim}
+3Droo=<r>
+\end{verbatim}
+\verb+<r>+ (always positive!) specifies the radius of orbit $ROO$ of the virtual camera. See option `\verb+3Dc2c+' for the number format of \verb+<r>+.
+
+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}
+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.
+\begin{verbatim}
+3Dlights=<lighting scheme>
+\end{verbatim}
+Sets the default lighting scheme. The following values are honoured: `\verb+None+', `\verb+White+', `\verb+Day+', `\verb+Night+', `\verb+Hard+', `\verb+Primary+', `\verb+Blue+', `\verb+Red+', `\verb+Cube+', `\verb+CAD+', `\verb+HeadLamp+'. The default is to use the lighting scheme as specified within the 3D artwork.
+\begin{verbatim}
+3Drender=<render mode>
+\end{verbatim}
+\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}
+Things like animation, lighting, background etc. may also be script driven. Option `\verb+3Djscript+' associates \verb+<JavaScript file>+ with the 3D object. The script will be executed upon activation of the object. Refer to the Acrobat 3D JavaScript Reference~\cite{jscript3D} for details. Directory `\verb+doc/javascript+' contains JavaScript example files for animation and rotation control. The files work off-the-shelf with any 3D file and may be concatenated to combine their effects.
+\begin{verbatim}
+3Dresource=<resource file 1>[, 3Dresource=<resource file 2> [, ...]]
+\end{verbatim}
+Embeds additional 3D or \emph{rasterized} image files that can be used as resources while rendering the 3D artwork. Possible file types are U3D, Postscript (\LaTeX{} + \verb+dvips+) and PDF/JPEG/PNG (pdf\LaTeX). Embedded resources must be loaded by the JavaScript method
+\begin{verbatim}
+ Resource('pdf://<resource path>')
+\end{verbatim}
+where {\tt<resource path>} stands for the path to the resource file as specified by the `\verb+3Dresource+' option. (This is just a naming convention; the files are physically embedded in the final PDF.) The following JavaScript loads an image file that was attached by `\verb+3Dresource=images/sunset.jpg+' as the background.
+\begin{verbatim}
+ sunset = new Image(new Resource('pdf://images/sunset.jpg'));
+ reh = new RenderEventHandler();
+ reh.onEvent = function(event) {
+ runtime.removeEventHandler(this);
+ event.canvas.background.setImage(sunset);
+ }
+ runtime.addEventHandler(reh);
+\end{verbatim}
+
+\subsection{Media hyperlinks}\label{hyperlinks}
+A movie, sound or 3D object may serve as the destination of hyperlinks, which are inserted into the document using the command
+\begin{verbatim}
+ \movieref[<options>]{<label spec>}{<text>}
+\end{verbatim}
+It makes \verb+<text>+ a hyperlink to the media that has been labelled with \verb+<label+ \verb+spec>+ using the `\verb+label+' option of the \verb+\includemovie+ command. Media hyperlinks can be inserted at any location within the document. Clicking onto the hyperlink causes the Reader to open the page containing the media it is pointing to. The primary purpose of media hyperlinks, however, is to provide a means to control the playback.
+
+\emph{In 2D context}, clicking onto the hyperlink causes the media to stop, pause or resume, or to restart at different settings, such as frame rate, volume, starting and ending positions, depending on the \verb+<options>+ being in effect.
+
+Options that control the playback \emph{characteristics} are: `\verb+controls+', `\verb+endat+', `\verb+mouse+', `\verb+palindrome+', `\verb+rate+', `\verb+repeat+', `\verb+startat+' and `\verb+volume+'. Their meaning is the same as for the \verb+\includemovie+ command and can be looked up in section~\ref{usrif}. Another option, `\verb+default+' causes the media to play at the original settings which were in effect during media inclusion. These options can be used in combination with the `\verb+play+' option only.
+
+The options which follow let the hyperlink change the playback \emph{state} of media. If none of them is specified, `\verb+play+' is assumed.
+\begin{verbatim}
+play
+\end{verbatim}
+Immediately restarts playback. If new playback settings have been specified through the options given above, they override the original settings being in effect during media inclusion.
+\begin{verbatim}
+stop
+\end{verbatim}
+Stops and rewinds the media to its beginning or to the `\verb+startat+' position.
+\begin{verbatim}
+resume
+\end{verbatim}
+Resumes paused media. In fact, this option makes the hyperlink a toggle switch: repeated clicking switches between paused and resumed state.
+\begin{verbatim}
+pause
+\end{verbatim}
+Has the same effect as option `\verb+resume+'. Added for completeness only.
+\begin{verbatim}
+close
+\end{verbatim}
+Immediately closes the media player.
+
+\emph{In 3D context}, \verb+\movieref+ can be used to define an additional view of the object, to access a particular view from the list of predefined views or to run a JavaScript. Moreover, a link can be created for calculating optimal camera settings `\verb+3Droo+' and `\verb+3Dcoo+', instead of finding them manually. The following options are recognized:
+\begin{verbatim}
+3Dviewindex=<index>
+\end{verbatim}
+Go to a predefined view of the 3D object. \verb+<index>+ can take `\verb+F+', `\verb+L+', `\verb+N+' or `\verb+P+' to access the first, last, next or previous element of the list of additional views, see option `\verb+3Dviews+' of {\tt \string\include\-movie}, or an integer specifying an index into the list. In the case of `\verb+N+' and `\verb+P+', repeated clicking onto the hyperlink allows to cycle through the list in forward or backward direction. `\verb+D+' gives access to the default view.
+\begin{verbatim}
+3Daac=<angle>
+3Dc2c=<x> <y> <z>
+3Dcoo=<x> <y> <z>
+3Droll=<roll>
+3Droo=<r>
+\end{verbatim}
+Instead of referencing an existing view of the 3D object, a new one can be defined using any of these options. See section~\ref{sec:3D}.
+\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 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 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}
+Runs the script \verb+<JavaScript file>+ after clicking the link. Unlike the script that has been associated with the 3D annotation during object embedding, this JavaScript is not directly run by the JavaScript engine of the 3D plug-in, but is run by the Reader's own scripting engine. However, full access to the API of the 3D script engine is provided through the `\verb+context3D+' property of the `\verb+Annot3D+' object. For convenience, an associative array `\verb+annot3D+' has been provided for use within \verb+<JavaScript file>+, in order to easily access the `\verb+Annot3D+' object of the annotation the enclosing link is pointing to. The particular element of the array is referenced by the annotation's label \verb+<label spec>+, enclosed in quotation marks. As an example, the `\verb+scene+' object can be referenced within \verb+<JavaScript file>+ by
+\begin{verbatim}
+ annot3D['<label spec>'].context3D.scene
+\end{verbatim}
+For details about Acrobat JavaScript and its Annot3D object, see \cite{jscript}.
+
+%\newpage
+\subsection{Compatibility commands}
+Two user commands have been provided that make `movie15' a replacement for the `multimedia' package which is part of Till Tantau's `Beamer' Class:
+\begin{verbatim}
+ \movie[<options>]{<poster text>}{<media file>}
+\end{verbatim}
+\begin{verbatim}
+ \hyperlinkmovie[<options>]{<label spec>}{<text>}
+\end{verbatim}
+All of the optional arguments to \verb+\includemovie+ and \verb+\movieref+ can be used with the compatibility macros as well. In addition, they honour the following options:
+\begin{verbatim}
+height=<height of display>
+width=<width of display>
+\end{verbatim}
+Set the horizontal and vertical dimensions of the media display area (\verb+\movie+ only).
+\begin{verbatim}
+autostart
+\end{verbatim}
+The same as `\verb+autoplay+'.
+\begin{verbatim}
+loop[=<repeats>]
+\end{verbatim}
+The same as `\verb+repeat+'.
+\begin{verbatim}
+once
+\end{verbatim}
+The same as `\verb+repeat=1+'.
+\begin{verbatim}
+showcontrols
+\end{verbatim}
+The same as `\verb+controls+'.
+\begin{verbatim}
+start=<offset in seconds>s
+\end{verbatim}
+Start playback at the specified temporal offset. The trailing `\verb+s+' is mandatory.
+\begin{verbatim}
+duration=<duration in seconds>s
+\end{verbatim}
+The duration of the media segment to be played. The trailing `\verb+s+' is mandatory. Note that `\verb+duration+' cannot be used together with option `\verb+startat+' from \verb+\includemovie+. In order to define a media segment options can be combined as follows: `\verb+startat+'/`\verb+endat+', `\verb+start+'/`\verb+endat+', `\verb+start+'/`\verb+duration+'.
+
+%\newpage
+\section{Examples}\label{examples}
+\begin{enumerate}
+\item A short circular MPEG movie, taken from \href{http://www.linux-video.net/Samples/}{\tt http://www.linux-video.net/} \href{http://www.linux-video.net/Samples/}{\tt Samples/}
+
+\begin{minipage}{0.5\linewidth}
+{\tt%
+ \string\includemovie[\\
+ \phantom{xx}poster,\\
+ \phantom{xx}text=(random.mpg),\\
+ \phantom{xx}mouse,\\
+ \phantom{xx}repeat\\
+ ]\string{\\
+ \phantom{xx}.5\string\linewidth\\
+ \string}\string{\\
+ \phantom{xx}.375\string\linewidth\\
+ \string}\string{random.mpg\string}
+}
+\end{minipage}%
+\begin{minipage}{0.5\linewidth}
+\begin{center}
+ \includemovie[poster, text=(random.mpg), mouse, repeat]{\linewidth}{.75\linewidth}{random.mpg}
+\end{center}
+\end{minipage}
+
+%\newpage
+\item Another MPEG movie, loaded on the fly from \href{http://www.linux-video.net/Samples/}{\tt http://www.linux-video} \href{http://www.linux-video.net/Samples/}{\tt .net/Samples/}. Hence, a working Internet connection is required. This time, we force the QuickTime plug-in to be used instead of MediaPlayer (Windows boxes only). Well, the latter seems to be bugged. Quod erat expectandum.
+
+\begin{minipage}{0.5\linewidth}
+{\tt%
+ \string\includemovie[\\
+ \phantom{xx}poster,\\
+ \phantom{xx}label=alien,\\
+ \phantom{xx}text=(AlienSong.mpg),\\
+ \phantom{xx}url,\\
+ \phantom{xx}playerid=AAPL\_QuickTime,\\
+ \phantom{xx}repeat\\
+ ]\string{\\
+ \phantom{xx}.5\string\linewidth\\
+ \string}\string{\\
+ \phantom{xx}.375\string\linewidth\\
+ \string}\string{http://www.linux-video.net/Samples/Mpeg1/AlienSong.mpg\string}\\
+ \string\movieref[rate=0.5]\string{alien\string}\string{Slow\string}\\
+ \string\movieref[default]\string{alien\string}\string{Normal\string}\\
+ \string\movieref[rate=2]\string{alien\string}\string{Fast\string}\\
+ \string\movieref[pause]\string{alien\string}\string{Play/Pause\string}\\
+ \string\movieref[stop]\string{alien\string}\string{Stop\string}
+}
+\end{minipage}%
+\begin{minipage}{0.5\linewidth}
+\begin{center}
+ \includemovie[
+ poster,
+ label=alien,
+ text=(AlienSong.mpg),
+ repeat,
+ playerid=AAPL_QuickTime,
+ url
+ ]{\linewidth}{.75\linewidth}{http://www.linux-video.net/Samples/Mpeg1/AlienSong.mpg}\\
+% ]{\linewidth}{.75\linewidth}{AlienSong.mpg}\\
+\movieref[rate=0.5]{alien}{Slow}\hfill
+\movieref[default]{alien}{Normal}\hfill
+\movieref[rate=2]{alien}{Fast}\hfill
+\movieref[pause]{alien}{Play/Pause}\hfill
+\movieref[stop]{alien}{Stop}\vspace{19 ex}
+\end{center}
+\end{minipage}
+
+%\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}
+{\tt%
+ \string\includemovie[\\
+ \phantom{xx}poster,\\
+ \phantom{xx}toolbar,\\
+ \phantom{xx}label=dice,\\
+ \phantom{xx}text=(dice.u3d),\\
+ \phantom{xx}3Droo=27,\\
+ \phantom{xx}3Dlights=Cube,\\
+ \phantom{xx}3Djscript=turntable.js,\\
+ \phantom{xx}3Dviews2=dice.vws\\
+ ]\string{\\
+ \phantom{xx}.5\string\linewidth\\
+ \string}\string{\\
+ \phantom{xx}.5\string\linewidth\\
+ \string}\string{dice.u3d\string}\\
+ \string\movieref[\\
+ \phantom{xx}3Dviewindex=N\\
+ ]\string{dice\string}\string{Click here\string} \dots\\
+ \string\movieref[\\
+ \phantom{xx}3Dcalculate=60\\
+ ]\string{dice\string}\string{This link\string} \dots
+}
+\end{minipage}%
+\begin{minipage}[b]{0.5\linewidth}
+\begin{center}
+ \includemovie[
+ poster,
+ toolbar, %same as `controls'
+ label=dice,
+ text=(dice.u3d),
+ 3Droo=27,
+ 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.
+\end{minipage}
+
+\end{enumerate}
+
+%\newpage
+\appendix
+\section{3D quick-start guide}\hypertarget{sec:3Dtut}{}
+\begin{enumerate}
+ \item Insert the 3D object with default camera settings and a {\tt \string\movieref} referencing it:
+
+ {\tt%
+ \string\includemovie[poster, label=my\_label]\string{\\
+ \phantom{xx}.5\string\linewidth\\
+ \string}\string{\\
+ \phantom{xx}.5\string\linewidth\\
+ \string}\string{\\
+ \phantom{xx}my\_file.u3d\\
+ \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. 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}my\_file.u3d\\
+ \string}
+ }
+
+ \item Again, compile and recompile the document until no more `movie15' related warnings appear.
+ \xdef\lastcount{\theenumi}
+\end{enumerate}
+
+\emph{Optional steps:}
+
+\begin{enumerate}
+ \setcounter{enumi}{\lastcount}
+ \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}..., 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}
+ }
+
+ 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.
+
+ 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.
+
+ 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 Associate a JavaScript with the 3D object:
+
+ {\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}my\_file.u3d\\
+ \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.
+
+ 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.
+
+ All files in `{\tt{}doc/javascript}' work off-the-shelf and can be copied into a single file in order to combine their effects.
+
+\end{enumerate}
+
+\section{Media formats}
+\begin{table}[H]
+\caption{Media formats for use with Adobe Reader (partially from \cite{pdfspec})}\label{table:mime}
+\RaggedRight
+\begin{tabular}[t]{llp{0.36\linewidth}}\hline
+Extension & MIME type & Description\\\hline\hline\\[-2.5ex]
+aif, aifc, aiff & audio/aiff & Audio Interchange File Format\\
+au, snd & audio/basic & NeXT/Sun Audio Format\\
+avi & video/avi & Audio/Video Interleaved\\
+gif & image/gif & (animated) GIF\\
+mid, rmi & audio/midi & Musical Instrument Digital Interface\\
+mov, qt & video/quicktime & Apple QuickTime\\
+mp3, m3u & audio/x-mp3 & MPEG Audio Layer-3\\
+mp4 & video/mp4 & MPEG-4 Video\\
+mpeg, mpg & video/mpeg & MPEG-1 \& 2 Video\\
+prc & model/prc & Adobe PRC Format (3D), requires Reader-8.1 or higher\\
+ra & audio/vnd.rn-realaudio & Real Audio\\
+rm, rv & application/vnd.rn-realmedia & Real Media (video \& sound)\\
+smil & application/smil & Synchronized Multimedia Integration Language\\
+swf & application/x-shockwave-flash & (Adobe?) Macromedia Flash\\
+u3d & model/u3d & Universal 3D File Format\\
+wav & audio/wav & MS Audio Format\\
+wma & audio/x-ms-wma & Windows Media Audio\\
+wmv & video/x-ms-wmv & Windows Media Video\\\hline
+\end{tabular}
+\end{table}
+
+\begin{thebibliography}{9}
+ \bibitem{pdfspec} Adobe Systems Inc.: \emph{PDF Reference, fifth edition: Adobe Portable Document Format version 1.6}, 2004, Implementation note 144, Appendix H.3, available at \href{http://www.adobe.com/devnet/pdf/pdf_reference.html}{\tt http://www.adobe.com/devnet/pdf/pdf\_reference.html}
+ \bibitem{3diforg} \href{http://www.3dif.org/}{\tt http://www.3dif.org/}
+ \bibitem{dexp} \href{http://www.righthemisphere.com/products/dexp/}{\tt http://www.righthemisphere.com/products/dexp/}
+ \bibitem{jscript3D} Adobe Systems Inc.: \emph{JavaScript for Acrobat\textsuperscript{\scriptsize\textregistered} 3D Annotations API Ref\-er\-ence}, 2006, available at \href{http://www.adobe.com/devnet/acrobat/javascript3d.html}{\tt http://www.adobe.com/devnet/acrobat/} \href{http://www.adobe.com/devnet/acrobat/javascript3d.html}{\tt javascript3d.html}
+ \bibitem{jscript} Adobe Systems Inc.: \emph{JavaScript for Acrobat\textsuperscript{\scriptsize\textregistered} API Reference}, 2006, available at \href{http://www.adobe.com/devnet/acrobat/javascript.html}{\tt http://www.adobe.com/devnet/acrobat/javascript.html}
+\end{thebibliography}
+
+\end{document}
diff --git a/macros/latex/contrib/movie15/doc/overlay-example.pdf b/macros/latex/contrib/movie15/doc/overlay-example.pdf
new file mode 100644
index 0000000000..10aaf5da38
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/overlay-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/movie15/doc/overlay-example.tex b/macros/latex/contrib/movie15/doc/overlay-example.tex
new file mode 100644
index 0000000000..d2c791e256
--- /dev/null
+++ b/macros/latex/contrib/movie15/doc/overlay-example.tex
@@ -0,0 +1,47 @@
+% Copyright 2006 Alexander Grahn
+%
+% This material is subject to the LaTeX Project Public License. See
+% http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
+% for the details of that license.
+%
+\documentclass{beamer}
+\setbeamertemplate{navigation symbols}{}
+\usepackage{movie15}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Some hints on using movie15 with /presentation/ packages
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% 1. Options `autopause' and `autoresume' should be set, as this prevents the
+% movie from being rewound when passing from one overlay to the next.
+
+% 2. Within presentations, \movieref's must be put on the /same/ overlay as
+% their target.
+
+% 3. If the /same/ media file is to be inserted at multiple locations within a
+% presentation, all instances must be given unique labels using the `label'
+% option, even if no \movieref's are associated with the included media.
+
+\begin{document}
+\begin{frame}
+ \begin{itemize}
+ \item<+-> 1st overlay
+ \item<+-> 2nd overlay
+ \begin{center}
+ \includemovie[
+ poster,
+ autopause, autoresume,
+ text={\parbox{0.35\linewidth}{\tiny
+ http://www.linux-video.net/\\Samples/Mpeg1/AlienSong.mpg%
+ }},
+ playerid=AAPL_QuickTime,
+ url
+ ]{0.4\linewidth}{0.3\linewidth}{%
+ http://www.linux-video.net/Samples/Mpeg1/AlienSong.mpg%
+ }
+ \end{center}
+ \item<+-> 3rd overlay
+ \item<+-> 4th overlay
+ \end{itemize}
+\end{frame}
+\end{document}
diff --git a/macros/latex/contrib/movie15/movie15.sty b/macros/latex/contrib/movie15/movie15.sty
new file mode 100644
index 0000000000..eb97c870af
--- /dev/null
+++ b/macros/latex/contrib/movie15/movie15.sty
@@ -0,0 +1,4390 @@
+% Copyright 2004--2008 Alexander Grahn
+%
+% This material is subject to the LaTeX Project Public License. See
+% http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
+% for the details of that license.
+%
+% This package allows inclusion of multimedia content into PDF files
+% following Adobe's PDF-1.5 and 1.6 specifications.
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{movie15}[2012/05/16]
+\RequirePackage{keyval}
+\RequirePackage{ifthen}
+\RequirePackage{ifpdf}
+\RequirePackage{ifdraft}
+
+\AtEndDocument{%
+ \PackageWarningNoLine{movie15}{%
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak
+ @@ Package `movie15' is obsolete and @@\MessageBreak
+ @@ superseded by `media9'.\space\space\space\space\space\space\space\space\space\space\space @@\MessageBreak
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}%
+}%
+
+\newboolean{@MXV@iiiDfeat} % enable 3D features from PDF-1.6 spec?
+\setboolean{@MXV@iiiDfeat}{false}%
+\newboolean{@MXV@iiid} %set to true if a 3D file is being embedded
+\newboolean{@MXV@draft} %according to global setting
+\newboolean{@MXV@@draft} %per inclusion setting
+
+\ifdraft{%globally set by document class
+ \setboolean{@MXV@draft}{true}%
+}{%
+ \setboolean{@MXV@draft}{false}%
+}%
+
+%override global setting
+\DeclareOption{draft}{%
+ \setboolean{@MXV@draft}{true}%
+}
+\DeclareOption{final}{%
+ \setboolean{@MXV@draft}{false}%
+}
+
+\DeclareOption{3D}{%
+ \setboolean{@MXV@iiiDfeat}{true}%
+}
+
+\DeclareOption*{%
+ \PackageWarning{movie15}{Unknown option \CurrentOption}
+}
+
+\ProcessOptions*\relax
+
+%testing for correct TeX version,
+\ifpdf
+ \ifnum\pdftexversion<120
+ \PackageError{movie15}{%
+ pdfeTeX, version >= 1.20, required
+ }{%
+ Install a more recent version!
+ }%
+ \fi
+\fi
+
+\ifx\@undefined\pdfmdfivesum
+ \def\pdfmdfivesum file #1{#1}
+\fi
+
+%for conditionals where \ifthenelse doesn't work
+\gdef\@MXV@if#1{\csname if#1\endcsname}%
+
+\newboolean{@MXV@beamer} %set to true if beamer class has been loaded
+%\newboolean{@MXV@powerdot} %the same for
+\newboolean{@MXV@presentation} %used with presentation making package?
+\newboolean{@MXV@hide} %contents hidden on the current slide?
+\@ifclassloaded{beamer}{%
+ \setboolean{@MXV@beamer}{true}%
+ \setboolean{@MXV@presentation}{true}%
+}{%
+ \setboolean{@MXV@beamer}{false}%
+ \setboolean{@MXV@presentation}{false}%
+}
+%\@ifclassloaded{powerdot}{%
+% \setboolean{@MXV@powerdot}{true}%
+% \setboolean{@MXV@presentation}{true}%
+%}{%
+% \setboolean{@MXV@powerdot}{false}%
+% \setboolean{@MXV@presentation}{false}%
+%}
+
+\AtBeginDocument{%
+ \@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%
+ \gdef\@MXV@pdfborder{}%
+ \fi%
+}
+
+\RequirePackage{everyshi}%
+\newcount\@MXV@page% counter for absolute page number
+\EveryShipout{%
+ \global\advance\@MXV@page by 1%
+}
+
+%define our own label making commands
+\def\@MXV@newlabel#1#2{{%
+ \expandafter\xdef\csname#1\endcsname{#2}}}%
+
+\def\@MXV@getlabelvalue#1{%
+ \expandafter\ifx\csname#1\endcsname\relax%
+ undefined%
+ \else%
+ \csname#1\endcsname%
+ \fi%
+}%
+
+%macro for writing labels to external *.aux file
+\def\@MXV@labeltoaux#1#2{%
+ \@bsphack\protected@write\@auxout{}{%
+ \string\@MXV@newlabel{#1}{#2}%
+ \string\@MXV@newlabel{@#1@}{\@MXV@getlabelvalue{#1}}%
+ }\@esphack%
+ \ifthenelse{%
+ \equal{\@MXV@getlabelvalue{#1}}{undefined}\OR%
+ %double check that the value hasn't changed
+ \NOT\equal{\@MXV@getlabelvalue{#1}}{\@MXV@getlabelvalue{@#1@}}%
+ }{%
+ \ifthenelse{\isundefined{\@MXV@warning}}{% issue warning only once, at end
+ \gdef\@MXV@warning{}% of document
+ \AtEndDocument{%
+ \PackageWarningNoLine{movie15}{%
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak
+ @@ Rerun to get object references right! @@\MessageBreak
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}%
+ }%
+ }{}%
+ }{}%
+}%
+%
+\ifpdf%
+ %for storing pdf object numbers (must be counters)
+ \newcount\@MXV@adict%
+ \newcount\@MXV@aadict%
+ %
+ %returns pdf page object number
+ \def\@MXV@pdfpageref#1{%
+ \expandafter\ifx\csname#1\endcsname\relax%
+ 0%
+ \else%
+ \expandafter\pdfpageref\csname#1\endcsname\space%
+ \fi%
+ }%
+\fi
+
+%counter for absolute number of inclusions,
+%used for labelling each annotation
+\newcount\@MXV@includes
+
+%counter for absolute number of movie players
+\newcount\@MXV@players
+
+%counter for absolute number of movierefs
+\newcount\@MXV@links
+
+%measuring things
+%textbox
+\newdimen\@MXV@width
+\newdimen\@MXV@height
+\newdimen\@MXV@depth
+\newdimen\@MXV@totalheight
+\newdimen\@MXV@@boxdepth
+%for centring the textbox within display box
+\newdimen\@MXV@traiselen
+\newdimen\@MXV@braiselen
+%for compatibility options
+\newdimen\@MXV@start
+\newdimen\@MXV@end
+
+%stores textbox given as argument to text option
+\newsavebox{\@MXV@textbox}
+
+%some booleans we need
+\newboolean{@MXV@autoplay}
+\newboolean{@MXV@autostop}
+\newboolean{@MXV@autoresume}
+\newboolean{@MXV@autoclose}
+\newboolean{@MXV@autopause}
+\newboolean{@MXV@mouse}%mouse interaction
+\newboolean{@MXV@inline}%inline movie data
+\newboolean{@MXV@attachment}%make embedded file extractable?
+\newboolean{@MXV@externalviewer}%if true, screen annot will be removed
+\newboolean{@MXV@url}
+\newboolean{@MXV@boxopt}%true if text option is set
+\newboolean{@MXV@textoverposter}
+\newboolean{@MXV@runposter}% render poster from movie at runtime
+\newboolean{@MXV@linkplay}% for \movieref command
+\newboolean{@MXV@linkpause}
+\newboolean{@MXV@linkresume}
+\newboolean{@MXV@linkstop}
+\newboolean{@MXV@linkclose}
+\newboolean{@MXV@linkreset}
+\newboolean{@MXV@issound}
+
+%macro to reset all macros and booleans
+\def\@MXV@reset{%
+ \setboolean{@MXV@autoplay}{false}%
+ \setboolean{@MXV@autostop}{true}%
+ \setboolean{@MXV@autoresume}{false}%
+ \setboolean{@MXV@autopause}{false}%
+ \setboolean{@MXV@autoclose}{false}%
+ \setboolean{@MXV@mouse}{false}%
+ \setboolean{@MXV@inline}{true}%
+ \setboolean{@MXV@attachment}{true}%
+ \setboolean{@MXV@externalviewer}{false}%
+ \setboolean{@MXV@issound}{false}%
+ \setboolean{@MXV@url}{false}%
+ \setboolean{@MXV@boxopt}{false}%
+ \setboolean{@MXV@textoverposter}{true}%
+ \setboolean{@MXV@runposter}{false}%
+ \setboolean{@MXV@linkplay}{true}%
+ \setboolean{@MXV@linkpause}{false}%
+ \setboolean{@MXV@linkresume}{false}%
+ \setboolean{@MXV@linkstop}{false}%
+ \setboolean{@MXV@linkclose}{false}%
+ \setboolean{@MXV@linkreset}{false}%
+ \setboolean{@MXV@requirereopen}{false}%
+ \ifthenelse{\boolean{@MXV@draft}}{%
+ \setboolean{@MXV@@draft}{true}%
+ }{%
+ \setboolean{@MXV@@draft}{false}%
+ }%
+ %
+ \gdef\@MXV@label{}% for movieref
+ \gdef\@MXV@@label{}% for movieref
+ \gdef\@MXV@mime{@MXV@auto}%
+ \gdef\@MXV@player{}%
+ \gdef\@MXV@fsentry{}%
+ \gdef\@MXV@repeat{}%
+ \gdef\@MXV@@repeat{}%
+ \gdef\@MXV@volume{100}%
+ \gdef\@MXV@@volume{}%
+ \gdef\@MXV@ctrls{}%
+ \gdef\@MXV@@ctrls{}%
+ \gdef\@MXV@palindrome{}%
+ \gdef\@MXV@rate{}%
+ \gdef\@MXV@startat{}%
+ \gdef\@MXV@@startat{}%
+ \gdef\@MXV@endat{}%
+ \gdef\@MXV@poevent{}%
+ \gdef\@MXV@pcevent{}%
+ \gdef\@MXV@box##1##2##3{\raisebox{0pt}[##2][##3]{\makebox[##1]{}}}%
+ \setlength{\@MXV@depth}{0pt}%
+ \setlength{\@MXV@height}{0pt}%
+ \setlength{\@MXV@width}{0pt}%
+ \setlength{\@MXV@braiselen}{0pt}%
+ \setlength{\@MXV@traiselen}{0pt}%
+ \gdef\@MXV@boxdepth{}%
+ \gdef\@MXV@boxheight{}%
+ \gdef\@MXV@boxwidth{}%
+ %
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \setboolean{@MXV@iiid}{false}%
+ \gdef\@MXV@aac{30}% aperture angle of camera
+ \gdef\@MXV@roll{0}% camera roll angle
+ \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{}%
+ \gdef\@MXV@iiidtoolb{/TB false}% don't show toolbar by default
+ \gdef\@MXV@iiidia{}% 3D interactive by default
+ \gdef\@MXV@calc{}% camera aperture for coo and roo calculation
+ \setboolean{@MXV@iiidgetview}{false}%
+ \gdef\@MXV@iiidopt{}% option string to be passed to internal macro
+ \setboolean{@MXV@resource}{false}%
+ \gdef\@MXV@resourcetree{}% name tree of embedded 3D resources
+ \xdef\@MXV@animstyle{}%
+ \gdef\@MXV@iiidpalindrome{/Subtype/Linear}% forward
+ \gdef\@MXV@iiidrate{}% animation speed
+ \global\@MXV@iiidrepeat=-1% repeat count
+ }{}%
+}%
+
+%missing package error message
+\def\@MXV@missing#1{%
+ \PackageError{movie15}{%
+ Package `#1' has not been loaded yet
+ }{%
+ Put the line `\protect\usepackage{#1}' somewhere after
+ `\protect\usepackage{movie15}' to the preamble of your
+ document!
+ }%
+}
+
+%3D-need-be-enabled error message
+\def\@MXV@neediiiD{%
+ \PackageError{movie15}{%
+ If you wish to embed 3D objects, enable the\MessageBreak
+ 3D feature first by passing option `3D' to movie15!\MessageBreak
+ Make sure the `fp' package for fixed point calculus\MessageBreak
+ is installed in your TeX system
+ }{Package `fp' is available from CTAN.}%
+}
+
+%macro to guess the mime type of the media file
+\def\@MXV@guessmime#1#2{%
+ \ifthenelse{\equal{#2}{aiff}\OR\equal{#2}{AIFF}\OR%
+ \equal{#2}{aif}\OR\equal{#2}{AIF}\OR%
+ \equal{#2}{aifc}\OR\equal{#2}{AIFC}}{%
+ \gdef\@MXV@mime{audio/aiff}%
+ }{%
+ \ifthenelse{\equal{#2}{wav}\OR\equal{#2}{WAV}}{%
+ \gdef\@MXV@mime{audio/wav}%
+ }{%
+ \ifthenelse{\equal{#2}{wma}\OR\equal{#2}{WMA}}{%
+ \gdef\@MXV@mime{audio/x-ms-wma}%
+ }{%
+ \ifthenelse{\equal{#2}{wmv}\OR\equal{#2}{WMV}}{%
+ \gdef\@MXV@mime{video/x-ms-wmv}%
+ }{%
+ \ifthenelse{\equal{#2}{au}\OR\equal{#2}{AU}\OR%
+ \equal{#2}{snd}\OR\equal{#2}{SND}}{%
+ \gdef\@MXV@mime{audio/basic}%
+ }{%
+ \ifthenelse{\equal{#2}{mid}\OR\equal{#2}{MID}\OR%
+ \equal{#2}{rmi}\OR\equal{#2}{RMI}}{%
+ \gdef\@MXV@mime{audio/midi}%
+ }{%
+ \ifthenelse{\equal{#2}{mov}\OR\equal{#2}{MOV}\OR%
+ \equal{#2}{qt}\OR\equal{#2}{QT}}{%
+ \gdef\@MXV@mime{video/quicktime}%
+ }{%
+ \ifthenelse{\equal{#2}{mp3}\OR\equal{#2}{MP3}\OR%
+ \equal{#2}{m3u}\OR\equal{#2}{M3U}}{%
+ \gdef\@MXV@mime{audio/x-mp3}%
+ }{%
+ \ifthenelse{\equal{#2}{mp4}\OR\equal{#2}{MP4}}{%
+ \gdef\@MXV@mime{video/mp4}%
+ }{%
+ \ifthenelse{\equal{#2}{avi}\OR\equal{#2}{AVI}}{%
+ \gdef\@MXV@mime{video/avi}%
+ }{%
+ \ifthenelse{\equal{#2}{gif}\OR\equal{#2}{GIF}}{%
+ \gdef\@MXV@mime{image/gif}%
+ }{%
+ \ifthenelse{\equal{#2}{mpeg}\OR\equal{#2}{MPEG}\OR%
+ \equal{#2}{mpg}\OR\equal{#2}{MPG}}{%
+ \gdef\@MXV@mime{video/mpeg}%
+ }{%
+ \ifthenelse{\equal{#2}{smil}\OR\equal{#2}{SMIL}}{%
+ \gdef\@MXV@mime{application/smil}%
+ }{%
+ \ifthenelse{\equal{#2}{swf}\OR\equal{#2}{SWF}}{%
+ \gdef\@MXV@mime{application/x-shockwave-flash}%
+ }{%
+ \ifthenelse{\equal{#2}{prc}\OR\equal{#2}{PRC}}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \setboolean{@MXV@iiid}{true}%
+ \gdef\@MXV@mime{model/prc}% (unofficial)
+ \gdef\@MXV@iiidsubtype{PRC}%
+ }{%
+ \@MXV@neediiiD%
+ }%
+ }{%
+ \ifthenelse{\equal{#2}{u3d}\OR\equal{#2}{U3D}}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \setboolean{@MXV@iiid}{true}%
+ \gdef\@MXV@mime{model/u3d}% (unofficial)
+ \gdef\@MXV@iiidsubtype{U3D}%
+ }{%
+ \@MXV@neediiiD%
+ }%
+ }{%
+ \ifthenelse{\equal{#2}{ra}\OR\equal{#2}{RA}}{
+ \gdef\@MXV@mime{audio/vnd.rn-realaudio}%
+ }{%
+ \ifthenelse{%
+ \equal{#2}{rv}\OR\equal{#2}{RV}\OR
+ \equal{#2}{rm}\OR\equal{#2}{RM}%
+ }{%
+ \gdef\@MXV@mime{application/vnd.rn-realmedia}%
+ }{%
+ \PackageError{movie15}{%
+ I couldn't determine MIME type of file:\MessageBreak`#1':\MessageBreak
+ Unknown file name extension: `#2'
+ }{%
+ When using media files of unknown type or with a\MessageBreak
+ non-standard file name extension, the MIME type must\MessageBreak
+ explicitly be specified. Try option `mimetype=<mime type>'!
+ }%
+ }}}}}}}}}}}}}}}}}}%
+}
+
+%sets @MXV@issound boolean
+\def\@MXV@@issound#1/#2:{% argument: \@MXV@mime.
+ \def\@MXV@firstarg{#1}%
+ \def\@MXV@audio{audio}%
+ \ifx\@MXV@firstarg\@MXV@audio%
+ \setboolean{@MXV@issound}{true}%
+ \fi%
+}
+
+%draft box
+\def\@MXV@draftbox#1#2#3#4{%width height depth filename
+ \edef\@MXV@oldfboxsep{\the\fboxsep}%
+ \setlength{\fboxsep}{-\fboxrule}%
+ \framebox[#1][l]{%
+ \vrule width 0pt height #2 depth #3%
+ \edef\@tempa{#4}%
+ \raisebox{\depth}[0pt][0pt]{ \ttfamily\expandafter\strip@prefix\meaning\@tempa}%
+ }%
+ \setlength{\fboxsep}{\@MXV@oldfboxsep}%
+}
+
+\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% 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%
+ \gdef\@MXV@oldpage{0}% needed together with previous counter
+
+ %macro for building the transformation matrix
+ \def\@MXV@ciiwmatrix#1 #2 #3 #4 #5 #6 #7 #8 {%
+ % #1,#2,#3 centre of orbit coordinates (coo)
+ % #4,#5,#6 centre of orbit to camera direction vector (c2c)
+ % #7 orbital radius (roo)
+ % #8 camera roll (roll)
+ %view vector (opposite to c2c)
+ \FPupn\@MXV@viewx{#4 neg}%
+ \FPupn\@MXV@viewy{#5 neg}%
+ \FPupn\@MXV@viewz{#6 neg}%
+ %normalize view vector
+ \FPupn\@MXV@modulo{\@MXV@viewx{} copy mul %
+ \@MXV@viewy{} copy mul + %
+ \@MXV@viewz{} copy mul + 2 swap root%
+ }%
+ \FPupn\@MXV@viewx{\@MXV@viewx{} \@MXV@modulo{} div}%
+ \FPupn\@MXV@viewy{\@MXV@viewy{} \@MXV@modulo{} div}%
+ \FPupn\@MXV@viewz{\@MXV@viewz{} \@MXV@modulo{} div}%
+ %camera roll
+ \FPupn\@MXV@sinroll{#8 180.0 div \FPpi{} mul sin}%
+ \FPupn\@MXV@cosroll{#8 180.0 div \FPpi{} mul cos}%
+ %
+ %top and bottom views
+ \FPupn\@MXV@leftx{-1.0}%
+ \FPupn\@MXV@lefty{0.0}%
+ \FPupn\@MXV@leftz{0.0}%
+ %
+ \FPifneg\@MXV@viewz% top view
+ %up-vector
+ \FPupn\@MXV@upx{0.0}%
+ \FPupn\@MXV@upy{1.0}%
+ \FPupn\@MXV@upz{0.0}%
+ \else% bottom view
+ %up-vector
+ \FPupn\@MXV@upx{0.0}%
+ \FPupn\@MXV@upy{-1.0}%
+ \FPupn\@MXV@upz{0.0}%
+ \fi%
+ \FPupn\@MXV@sumxy{\@MXV@viewx{} abs \@MXV@viewy{} abs add}%
+ \FPifeq\@MXV@sumxy{0}\else% other views than top and bottom
+ %up-vector = up_world - (up_world dot view) view
+ \FPupn\@MXV@upx{\@MXV@viewz{} \@MXV@viewx{} mul neg}%
+ \FPupn\@MXV@upy{\@MXV@viewz{} \@MXV@viewy{} mul neg}%
+ \FPupn\@MXV@upz{\@MXV@viewz{} \@MXV@viewz{} mul neg 1.0 add}%
+ %normalize up-vector
+ \FPupn\@MXV@modulo{\@MXV@upx{} copy mul \@MXV@upy{} copy %
+ mul + \@MXV@upz{} copy mul + 2 swap root}%
+ \FPupn\@MXV@upx{\@MXV@upx{} \@MXV@modulo{} div}%
+ \FPupn\@MXV@upy{\@MXV@upy{} \@MXV@modulo{} div}%
+ \FPupn\@MXV@upz{\@MXV@upz{} \@MXV@modulo{} div}%
+ %left vector = up x view
+ \FPupn\@MXV@leftx{\@MXV@viewz{} \@MXV@upy{} mul %
+ \@MXV@viewy{} \@MXV@upz{} mul sub}%
+ \FPupn\@MXV@lefty{\@MXV@viewx{} \@MXV@upz{} mul %
+ \@MXV@viewz{} \@MXV@upx{} mul sub}%
+ \FPupn\@MXV@leftz{\@MXV@viewy{} \@MXV@upx{} mul %
+ \@MXV@viewx{} \@MXV@upy{} mul sub}%
+ %normalize left vector
+ \FPupn\@MXV@modulo{\@MXV@leftx{} copy mul \@MXV@lefty{} %
+ copy mul + \@MXV@leftz{} copy mul + 2 swap root}%
+ \FPupn\@MXV@leftx{\@MXV@leftx{} \@MXV@modulo{} div}%
+ \FPupn\@MXV@lefty{\@MXV@lefty{} \@MXV@modulo{} div}%
+ \FPupn\@MXV@leftz{\@MXV@leftz{} \@MXV@modulo{} div}%
+ \fi%
+ %apply camera roll
+ \FPupn\@MXV@leftxprime{\@MXV@leftx{} \@MXV@cosroll{} mul \@MXV@upx{} \@MXV@sinroll{} mul +}%
+ \FPupn\@MXV@leftyprime{\@MXV@lefty{} \@MXV@cosroll{} mul \@MXV@upy{} \@MXV@sinroll{} mul +}%
+ \FPupn\@MXV@leftzprime{\@MXV@leftz{} \@MXV@cosroll{} mul \@MXV@upz{} \@MXV@sinroll{} mul +}%
+ \FPupn\@MXV@upxprime{\@MXV@upx{} \@MXV@cosroll{} mul \@MXV@leftx{} \@MXV@sinroll{} mul sub}%
+ \FPupn\@MXV@upyprime{\@MXV@upy{} \@MXV@cosroll{} mul \@MXV@lefty{} \@MXV@sinroll{} mul sub}%
+ \FPupn\@MXV@upzprime{\@MXV@upz{} \@MXV@cosroll{} mul \@MXV@leftz{} \@MXV@sinroll{} mul sub}%
+ \FPupn\@MXV@leftx{\@MXV@leftxprime}%
+ \FPupn\@MXV@lefty{\@MXV@leftyprime}%
+ \FPupn\@MXV@leftz{\@MXV@leftzprime}%
+ \FPupn\@MXV@upx{\@MXV@upxprime}%
+ \FPupn\@MXV@upy{\@MXV@upyprime}%
+ \FPupn\@MXV@upz{\@MXV@upzprime}%
+ %translation vector
+ \FPupn\@MXV@roo{#7 abs}%
+ \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 (old format)
+ \newcommand{\@MXV@parseline}[6][]{%
+ \pdfstringdef\@MXV@xname{#1}% name of the view (optional)
+ \ifthenelse{\equal{#2}{}}{%
+ \xdef\@MXV@coo{0 0 0}%
+ }{%
+ \xdef\@MXV@coo{#2}%
+ }%
+ \ifthenelse{\equal{#3}{}}{%
+ \xdef\@MXV@ctoc{0 -1 0}%
+ }{%
+ \xdef\@MXV@ctoc{#3}%
+ }%
+ \ifthenelse{\equal{#4}{}}{%
+ \xdef\@MXV@roo{0}%
+ }{%
+ \xdef\@MXV@roo{#4}%
+ }%
+ \ifthenelse{\equal{#5}{}}{%
+ \xdef\@MXV@roll{0}%
+ }{%
+ \xdef\@MXV@roll{#5}%
+ }%
+ \ifthenelse{\equal{#6}{}}{%
+ \xdef\@MXV@aac{30}%
+ }{%
+ \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 (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
+ \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}{%
+ \edef\@MXV@endlinechar{\the\endlinechar}%
+ \endlinechar=-1% suppress trailing space at input line end
+ \openin\@MXV@@viewsfile=\@MXV@viewsfile%
+ \loop%
+ \read\@MXV@@viewsfile to \@MXV@inputline%
+ \if\@MXV@inputline\relax\else%
+ \expandafter\@MXV@parseline\@MXV@inputline%
+ \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 1%
+ \ifthenelse{\equal{\@MXV@xname}{}}{%
+ \pdfstringdef\@MXV@xname{View \the\@MXV@viewscount}%
+ }{}%
+ \@MXV@viewobj% create pdf object of 3D view
+ %append current view obj ref to VA array
+ \xdef\@MXV@varray{\@MXV@varray\space\@MXV@@viewobj}%
+ \setboolean{@MXV@viewsprovided}{true}%
+ \repeat%
+ \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
+ %additional views provided) use our fallback view (c2c=0 -1 0) as default
+ \ifthenelse{\NOT\boolean{@MXV@defaultviewprovided}%
+ \AND\boolean{@MXV@viewsprovided}}{%
+ \xdef\@MXV@defaultview{/3DV /F}%
+ }{}%
+ \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
+ %implementations
+ \ifpdf%
+ %pdfLaTeX versions
+ %macro for creating 3D view object
+ \def\@MXV@viewobj{%
+ %projection dict
+ \pdfobj {<</Subtype/P/FOV \@MXV@aac/PS/Min>>}%
+ \pdfrefobj\pdflastobj%
+ %
+ \pdfobj {<<%
+ /MS/M% define the view as C2W matrix
+ /CO \@MXV@roo% orbital radius
+ /P \the\pdflastobj\space 0 R%
+ /C2W [\@MXV@matrix]%
+ /XN(\@MXV@xname)% name of the view appearing in the drop down list
+ \@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{%
+ %determine file type
+ \filename@parse{#1}%
+ \ifthenelse{%
+ \equal{\filename@ext}{u3d}\OR%
+ \equal{\filename@ext}{U3D}%
+ }{%
+ \def\@MXV@restype{U3D}%
+ }{%
+ \def\@MXV@restype{image}%
+ }%
+ \ifthenelse{\equal{\@MXV@restype}{image}}{%
+ %embed the same image file only once
+ \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}{undefined}}{%
+ \immediate\pdfximage {#1}%
+ \xdef\@MXV@resourcetree{% build name tree for embedded resources
+ \@MXV@resourcetree\space (#1) \the\pdflastximage\space 0 R%
+ }%
+ \@MXV@newlabel{\pdfmdfivesum file {#1}}{\the\pdflastximage}%
+ }{%
+ \xdef\@MXV@resourcetree{%
+ \@MXV@resourcetree\space (#1) \@MXV@getlabelvalue{\pdfmdfivesum file {#1}}\space 0 R%
+ }%
+ }%
+ }{%
+ %embed the same 3D file only once
+ \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}{undefined}}{%
+ \pdfobj stream %
+ attr {%
+ /Subtype/\@MXV@restype%
+ }%
+ file {#1}%
+ \pdfrefobj\pdflastobj%
+ \xdef\@MXV@resourcetree{%
+ \@MXV@resourcetree\space (#1) \the\pdflastobj\space 0 R%
+ }%
+ \@MXV@newlabel{\pdfmdfivesum file {#1}}{\the\pdflastobj}%
+ }{%
+ \xdef\@MXV@resourcetree{%
+ \@MXV@resourcetree\space (#1) \@MXV@getlabelvalue{\pdfmdfivesum file {#1}}\space 0 R%
+ }%
+ }%
+ }%
+ }
+
+ %3D inclusion macro
+ \newcommand{\@MXV@includeiiid}[5][]{%
+ %insert box or poster
+ \@MXV@box{#2}{#3}{#4}%
+ %
+ \if@MXV@externalviewer\else%
+ \setkeys{MXV@iiid}{#1}%process deferred options
+ \ifnum\@MXV@iiidrepeat=0\else%
+ \edef\@MXV@animstyle{% animation style dict
+ /AN <<%
+ \@MXV@iiidpalindrome\@MXV@iiidrate/PC \the\@MXV@iiidrepeat%
+ >>%
+ }%
+ \fi%
+ %java script file, stream object
+ \IfFileExists{\@MXV@jscriptiiidfile}{%
+ \pdfobj stream file {\@MXV@jscriptiiidfile}%
+ \pdfrefobj\pdflastobj%
+ \xdef\@MXV@jscriptiiid{/OnInstantiate \the\pdflastobj\space 0 R}%
+ }{\xdef\@MXV@jscriptiiid{}}%
+ %
+ %build the array of 3D views
+ \@MXV@buildva%
+ \fi%
+ %
+ %3D stream object
+ \if@MXV@inline%
+ \ifthenelse{%
+ \NOT\boolean{@MXV@presentation}\OR%
+ \equal{\@MXV@getlabelvalue{\@MXV@label.3dstream}}{undefined}%
+ }{%
+ \pdfobj stream%
+ attr {%
+ /Subtype/\@MXV@iiidsubtype%
+ \if@MXV@externalviewer\else%
+ /VA [\@MXV@varray]%
+ /DV/F% use first entry in VA as default view
+ \@MXV@animstyle%
+ \@MXV@jscriptiiid%
+ \if@MXV@resource%
+ /Resources <<%
+ /Names [\@MXV@resourcetree]%
+ >>%
+ \fi%
+ \fi%
+ }%
+ file {#5}%
+ \pdfrefobj\pdflastobj%
+ \edef\@MXV@iiidstream{\the\pdflastobj}%
+ \if@MXV@presentation%
+ \@MXV@newlabel{\@MXV@label.3dstream}{\@MXV@iiidstream}%
+ \fi%
+ }{%
+ \edef\@MXV@iiidstream{\@MXV@getlabelvalue{\@MXV@label.3dstream}}%
+ }%
+ \fi%
+ %
+ \makebox[0pt][r]{\makebox[#2][l]{%
+ %insert FileAttachment annotation
+ \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}%
+% since Reader 7.0.7, we cannot place a file attachment annot behind
+% the 3D annot :-(
+% \OR\boolean{@MXV@attachment}
+ }{%
+ \pdfannot width #2 height #3 depth #4 {%
+ /Subtype /FileAttachment%
+ /F 0%
+ /T (\@MXV@filename)%
+ /Contents (3D Object (\@MXV@mime))%
+ \if@MXV@externalviewer%
+ /Name/Paperclip%
+ /C [1 1 1]%
+ \else%
+ /AP <</N<<>>/R<<>>/D<<>>>>%
+ \fi%
+ /FS <<%
+ /F(#5)%
+ /Type/Filespec%
+ /EF << /F \@MXV@iiidstream\space 0 R >>%
+ >>%
+ }%
+ }{%
+ \if@MXV@url%
+ %insert Link annotation, if 3D file is a URL
+ \pdfannot width #2 height #3 depth #4 {%
+ /Subtype /Link%
+ /F 0%
+ \if@MXV@externalviewer%
+ \@MXV@urlattr%
+ \else%
+ /H /N%
+ /Border [0 0 0]%
+ \fi%
+ /A <</URI (#5) /S/URI>>%
+ /Contents (3D Object (\@MXV@mime))%
+ }%
+ \else%
+ %else insert Launch action for local external 3D file
+ \if@MXV@inline\else%
+ \pdfannot width #2 height #3 depth #4 {%
+ /Subtype /Link%
+ /F 0%
+ \if@MXV@externalviewer%
+ \@MXV@runattr%
+ \else%
+ /H /N%
+ /Border [0 0 0]%
+ \fi%
+ /A <<%
+ /F (#5)%
+ /S /Launch%
+ >>%
+ /Contents (3D Object (\@MXV@mime))%
+ }%
+ \fi%
+ \fi%
+ }%
+ %
+ \if@MXV@externalviewer\else%
+ %appearance dict dummy, to be shared by all 3D annots
+ \ifthenelse{\isundefined{\@MXV@apdict}}{%
+ \pdfobj stream attr {/BBox [0 0 0.001 0.001]} {}\pdfrefobj\pdflastobj%
+ \xdef\@MXV@apdict{/AP << /N \the\pdflastobj\space 0 R >>}%
+ }{}%
+ %3D reference dict
+ \if@MXV@presentation%
+ \ifthenelse{%
+ \equal{\@MXV@getlabelvalue{\@MXV@label.3dref}}{undefined}%
+ }{%
+ \pdfobj {<<%
+ /Type/3DRef%
+ /3DD \@MXV@iiidstream\space 0 R% 3D stream object
+ >>}\pdfrefobj\pdflastobj%
+ \edef\@MXV@iiidstreamorref{\the\pdflastobj}%
+ \@MXV@newlabel{\@MXV@label.3dref}{\the\pdflastobj}%
+ }{%
+ \edef\@MXV@iiidstreamorref{\@MXV@getlabelvalue{\@MXV@label.3dref}}%
+ }%
+ \else%
+ \edef\@MXV@iiidstreamorref{\@MXV@iiidstream}%
+ \fi%
+ %annotation object of subtype `3D'
+ \pdfannot width #2 height #3 depth #4 {%
+ /Subtype/3D%
+ /F 4% we cannot put F 5 here; bug in Reader; 3D annot would be
+ /T (\@MXV@filename)% disabled even if plugin were available
+ /Contents (3D Object (\@MXV@mime))%
+ \ifx\@MXV@@label\@empty\else%
+ /NM (\@MXV@@label)%
+ \fi%
+ /P \@MXV@pdfpageref{@MXV@annot\the\@MXV@includes.page} 0 R%
+ \@MXV@apdict% /AP <</N<<>>/R<<>>/D<<>>>> doesn't work here
+ \@MXV@defaultview%
+ \@MXV@iiidia%
+ /3DD \@MXV@iiidstreamorref\space 0 R% 3D stream or reference object
+ /3DA << \@MXV@activation\@MXV@deactivation\@MXV@iiidtoolb >>%
+ }%
+ %label for later annot obj number determination, to be used in
+ %movieref's
+ \ifx\@MXV@@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@@label.annot}{\the\pdflastannot}%
+ \@MXV@newlabel{@MXV@\@MXV@@label.annot}{\the\pdflastannot}%
+ \fi%
+ \fi}}%
+ }%
+ \else%
+ %dvips versions
+ %macro for creating 3D view object and associated projection dict
+ \def\@MXV@viewobj{%
+ %projection dict
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {pdict\the\@MXV@includes_\the\@MXV@viewscount}%
+ /type/dict%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {pdict\the\@MXV@includes_\the\@MXV@viewscount} <<%
+ /Subtype/P/FOV \@MXV@aac/PS/Min%
+ >>%
+ }%
+ }%
+ %
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /type/dict%
+ /_objdef {viewobj\the\@MXV@includes_\the\@MXV@viewscount}%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {viewobj\the\@MXV@includes_\the\@MXV@viewscount} <<%
+ /MS/M%
+ /CO \@MXV@roo%
+ /P {pdict\the\@MXV@includes_\the\@MXV@viewscount}%
+ /C2W[\@MXV@matrix]%
+ /XN(\@MXV@xname)%
+ \@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{%
+ %determine file type
+ \filename@parse{#1}%
+ \ifthenelse{%
+ \equal{\filename@ext}{u3d}\OR%
+ \equal{\filename@ext}{U3D}%
+ }{%
+ \def\@MXV@restype{U3D}%
+ }{%
+ \def\@MXV@restype{image}%
+ }%
+ \ifthenelse{\equal{\@MXV@restype}{image}}{%
+ %embed the same image file only once
+ \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}{undefined}}{%
+ %increment counter of embedded resource files
+ \global\advance\@MXV@rescount by 1%
+ %create Image XObject from next raster image
+ \special{ps:% read image resource from file
+ [ /_objdef {resource\the\@MXV@rescount} /NI pdfmark
+ save gsave
+ {
+ /showpage {} def
+ /setpagedevice /pop load def
+ newpath clip
+ (#1) run
+ } ?pdfmark
+ 0 0 1 [1 0 0 1 0 0] {} image %empty dummy, in case #1 is not
+ grestore restore %a valid image file
+ }%
+ \xdef\@MXV@resourcetree{% build name tree for embedded resources
+ \@MXV@resourcetree\space (#1) {resource\the\@MXV@rescount}%
+ }%
+ \@MXV@newlabel{\pdfmdfivesum file {#1}}{resource\the\@MXV@rescount}%
+ }{%
+ \xdef\@MXV@resourcetree{%
+ \@MXV@resourcetree\space (#1) {\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}%
+ }%
+ }%
+ }{%
+ %embed the same 3D file only once
+ \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}{undefined}}{%
+ \global\advance\@MXV@rescount by 1%
+ \special{ps:
+ [ /_objdef {resource\the\@MXV@rescount} /type/stream /OBJ pdfmark
+ [ {resource\the\@MXV@rescount} <<%
+ /Subtype/\@MXV@restype%
+ >> /PUT pdfmark%
+ [ {resource\the\@MXV@rescount} (#1) (r) file /PUT pdfmark
+ }%
+ \xdef\@MXV@resourcetree{%
+ \@MXV@resourcetree\space (#1) {resource\the\@MXV@rescount}%
+ }%
+ \@MXV@newlabel{\pdfmdfivesum file {#1}}{resource\the\@MXV@rescount}%
+ }{%
+ \xdef\@MXV@resourcetree{%
+ \@MXV@resourcetree\space (#1) {\@MXV@getlabelvalue{\pdfmdfivesum file {#1}}}%
+ }%
+ }%
+ }%
+ }
+ %
+ %3D inclusion macro
+ \newcommand{\@MXV@includeiiid}[5][]{%
+ %
+ \if@MXV@externalviewer\else%
+ \setkeys{MXV@iiid}{#1}%process deferred options
+ \ifnum\@MXV@iiidrepeat=0\else%
+ \edef\@MXV@animstyle{% animation style dict
+ /AN <<%
+ \@MXV@iiidpalindrome\@MXV@iiidrate/PC \the\@MXV@iiidrepeat%
+ >>%
+ }%
+ \fi%
+ %java script file, stream object
+ \IfFileExists{\@MXV@jscriptiiidfile}{%
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {jscriptiiid\the\@MXV@includes}%
+ /type/stream%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {jscriptiiid\the\@MXV@includes}%
+ (\@MXV@jscriptiiidfile) (r) file%
+ }%
+ }%
+ \xdef\@MXV@jscriptiiid{%
+ /OnInstantiate {jscriptiiid\the\@MXV@includes}%
+ }%
+ }{\def\@MXV@jscriptiiid{}}%
+ %
+ %build the array of 3D views
+ \@MXV@buildva%
+ \fi%
+ %
+ %3D stream object
+ \if@MXV@inline%
+ \ifthenelse{%
+ \NOT\boolean{@MXV@presentation}\OR%
+ \equal{\@MXV@getlabelvalue{\@MXV@label.3dstream}}{undefined}%
+ }{%
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {iiiDfile\the\@MXV@includes}%
+ /type/stream%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {iiiDfile\the\@MXV@includes} <<%
+ /Subtype/\@MXV@iiidsubtype%
+ \if@MXV@externalviewer\else%
+ /VA [\@MXV@varray]%
+ /DV/F% use first entry in VA as default view
+ \@MXV@animstyle%
+ \if@MXV@resource%
+ /Resources <<%
+ /Names [\@MXV@resourcetree]%
+ >>%
+ \fi%
+ \@MXV@jscriptiiid%
+ \fi%
+ >>%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {iiiDfile\the\@MXV@includes}%
+ (#5) (r) file%
+ }%
+ }%
+ \edef\@MXV@iiidstream{iiiDfile\the\@MXV@includes}%
+ \if@MXV@presentation%
+ \@MXV@newlabel{\@MXV@label.3dstream}{\@MXV@iiidstream}%
+ \fi%
+ }{%
+ \edef\@MXV@iiidstream{\@MXV@getlabelvalue{\@MXV@label.3dstream}}%
+ }%
+ \fi%
+ %
+ %insert FileAttachment annotation
+ \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}%
+% \OR\boolean{@MXV@attachment}
+ }{%
+ \makebox[0pt][l]{%
+ \pdfmark[\phantom{\@MXV@box{#2}{#3}{#4}}]{%
+ pdfmark=/ANN,%
+ Subtype=/FileAttachment,%
+ Raw={%
+ /F 0%
+ /T (\@MXV@filename)%
+ /Contents (3D Object (\@MXV@mime))%
+ \if@MXV@externalviewer%
+ /Name/Paperclip%
+ /C [1 1 1]%
+ \else%
+ /AP <</N<<>>/R<<>>/D<<>>>>%
+ \fi%
+ /FS <<%
+ /F(#5)%
+ /Type/Filespec%
+ /EF <</F {\@MXV@iiidstream}>>%
+ >>%
+ }%
+ }%
+ }%
+ }{%
+ \if@MXV@url%
+ %insert Link annotation, if 3D file is a URL
+ \makebox[0pt][l]{%
+ \pdfmark[\phantom{\@MXV@box{#2}{#3}{#4}}]{%
+ pdfmark=/ANN,%
+ Subtype=/Link,%
+ Raw={%
+ /F 0%
+ \if@MXV@externalviewer%
+ /C [\@urlbordercolor]%
+ /H \@pdfhighlight%
+ \else%
+ /H /N%
+ /Border [0 0 0]%
+ \fi%
+ /Action <</URI (#5) /S/URI>>%
+ /Contents (3D Object (\@MXV@mime))%
+ }%
+ }%
+ }%
+ \else%
+ %else insert Launch action for local external 3D file
+ \if@MXV@inline\else%
+ \makebox[0pt][l]{%
+ \pdfmark[\phantom{\@MXV@box{#2}{#3}{#4}}]{%
+ pdfmark=/ANN,%
+ Subtype=/Link,%
+ Raw={%
+ /F 0%
+ \if@MXV@externalviewer%
+ /C [\@urlbordercolor]%
+ /H \@pdfhighlight%
+ \else%
+ /H /N%
+ /Border [0 0 0]%
+ \fi%
+ /Action <<%
+ /F (#5)%
+ /S /Launch%
+ >>%
+ /Contents (3D Object (\@MXV@mime))%
+ }%
+ }%
+ }%
+ \fi%
+ \fi%
+ }%
+ \if@MXV@externalviewer%
+ \phantom{\@MXV@box{#2}{#3}{#4}}%
+ \else%
+ %appearance dict dummy, to be shared by all 3D annots
+ \ifthenelse{\isundefined{\@MXV@apdict}}{%
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {apdict}%
+ /type/stream%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {apdict}%
+ ()%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {apdict}
+ <</BBox [0 0 0.001 0.001]>>
+ }%
+ }%
+ \xdef\@MXV@apdict{/AP << /N {apdict}>>}%
+ }{}%
+ %3D reference dict
+ \if@MXV@presentation%
+ \ifthenelse{%
+ \equal{\@MXV@getlabelvalue{\@MXV@label.3dref}}{undefined}%
+ }{%
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {iiiDref\the\@MXV@includes}%
+ /type/dict%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {iiiDref\the\@MXV@includes} <<%
+ /Type/3DRef%
+ /3DD {\@MXV@iiidstream}% 3D stream object
+ >>%
+ }%
+ }%
+ \edef\@MXV@iiidstreamorref{iiiDref\the\@MXV@includes}%
+ \@MXV@newlabel{\@MXV@label.3dref}{\@MXV@iiidstreamorref}%
+ }{%
+ \edef\@MXV@iiidstreamorref{\@MXV@getlabelvalue{\@MXV@label.3dref}}%
+ }%
+ \else%
+ \edef\@MXV@iiidstreamorref{\@MXV@iiidstream}%
+ \fi%
+ %annotation object of subtype `3D'
+ \pdfmark[\phantom{\@MXV@box{#2}{#3}{#4}}]{%
+ pdfmark=/ANN,%
+ Subtype=/3D,%
+ Raw={%
+ /_objdef {3Dannot\the\@MXV@includes}%
+ /F 4%
+ /T (\@MXV@filename)%
+ \ifx\@MXV@@label\@empty\else%
+ /NM (\@MXV@@label)%
+ \fi%
+ /Contents (3D Object (\@MXV@mime))%
+ /P {ThisPage}%
+ \@MXV@apdict% /AP <</N<<>>/R<<>>/D<<>>>> doesn't work here
+ \@MXV@defaultview%
+ \@MXV@iiidia%
+ /3DD {\@MXV@iiidstreamorref}% 3D stream or reference object
+ /3DA <<\@MXV@activation\@MXV@deactivation\@MXV@iiidtoolb>>%
+ }%
+ }%
+ \ifx\@MXV@@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@@label.annot}{\the\@MXV@includes}%
+ \@MXV@newlabel{@MXV@\@MXV@@label.annot}{\the\@MXV@includes}%
+ \fi%
+ \fi%
+ }%
+ \fi%
+}{}
+
+%settings for newly opened media players
+\def\@MXV@settings#1#2#3#4#5#6#7{%
+ var settings={%
+ privateData: {%
+ paused: false
+ },
+ autoPlay: false,
+ visible: false,
+ volume: #7
+ #1% showUI (controls)
+ #2% palindrome
+ #3% repeat
+ #4% rate
+ #5% startAt
+ #6% endAt
+ };
+}
+
+%JavaScript event handler routines for 2D media activation
+\def\@MXV@events#1#2#3{% #1: playerid, #2: mouse?, #3: autoplay?
+ var events=new app.media.Events({%
+ %on focus change from one movie to another, events are fired in the
+ %following order: (1) onBlur, (2) onFocus, (3) afterBlur, (4) afterFocus
+ onBlur: function (e) {%
+ if(focusonplayer > 0){%
+ focusonplayer=0;
+ }
+ },
+ afterBlur: function (e) {%
+ %only resume if we click outside of any media
+ if(focusonplayer==0){%
+ try{
+ e.target.settings.privateData.paused=false;
+ e.target.play();
+ }catch(e){}
+ }
+ },
+ onFocus: function (e) {%
+ focusonplayer=#1;
+ },
+ afterFocus: function (e) {%
+ if(!e.target.isPlaying){%play on click if paused
+ try{
+ e.target.settings.privateData.paused=false;
+ e.target.play();
+ if(!e.target.isPlaying){%still not playing?!
+ %sometimes play() fails, in particular if the movie has reached
+ %its end before getting the focus; but this works:
+ if(
+ e.target.settings.startAt.time
+ || e.target.settings.startAt.frame
+ || e.target.settings.startAt.marker
+ || e.target.id == 'vnd.adobe.swname:AAPL_QuickTime'
+ ){
+ e.target.seek(e.target.settings.startAt);
+ }else{
+ e.target.stop();
+ }
+ e.target.play();
+ }
+ }
+ catch (e){}
+ }
+ \@MXV@if{#2}%
+ else{%
+ %media can only be paused if mouse option is set
+ try{
+ e.target.pause();
+ e.target.settings.privateData.paused=true;
+ }catch (e){}
+ }
+ \fi%
+ \if@MXV@issound\else e.target.visible=true;\fi%
+ },
+ onPlay: function (e) {%
+ e.target.settings.privateData.paused=false;
+ },
+ onPause: function (e) {%
+ e.target.settings.privateData.paused=true;
+ },
+ afterReady: function (e) {%
+ try{
+ if(
+ e.target.settings.startAt.time
+ || e.target.settings.startAt.frame
+ || e.target.settings.startAt.marker
+ ){
+ e.target.play();
+ e.target.pause();
+ e.target.stop();
+ e.target.settings.privateData.paused=false;
+ e.target.seek(e.target.settings.startAt);
+ }
+ \if@MXV@issound\else e.target.visible=true;\fi%
+ \@MXV@if{#3}
+ e.target.settings.privateData.paused=false;
+ e.target.play();
+ \fi
+ }
+ catch (e){}
+ }
+ });
+}%
+
+%output driver specific implementations of the 2D inclusion macro
+\ifpdf%
+ %pdfLaTeX version
+ \def\@MXV@includemovie#1#2#3#4{%
+ %insert box or poster
+ \@MXV@box{#1}{#2}{#3}%
+ %
+ \if@MXV@externalviewer\else%
+ %new action dict
+ \pdfobj reserveobjnum%
+ \@MXV@adict=\pdflastobj%
+ %
+ %new additional actions dict
+ \pdfobj reserveobjnum%
+ \@MXV@aadict=\pdflastobj%
+ %
+ \fi%
+ %embedded file entry `/EF'
+ \if@MXV@inline%
+ %embed the same media file only once
+ \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#4}}}{undefined}}{%
+ \pdfobj stream %
+ attr {%
+ /Type/EmbeddedFile%
+ /Subtype (\@MXV@mime)%
+ }%
+ file {#4}%
+ \pdfrefobj\pdflastobj%
+ \edef\@MXV@efentry{%
+ /EF << /F \the\pdflastobj\space 0 R >>%
+ }%
+ \@MXV@newlabel{\pdfmdfivesum file {#4}}{\the\pdflastobj}%
+ }{%
+ \edef\@MXV@efentry{%
+ /EF << /F \@MXV@getlabelvalue{\pdfmdfivesum file {#4}}\space 0 R >>%
+ }%
+ }%
+ \else\def\@MXV@efentry{}\fi%
+ %
+ \ifthenelse{\boolean{@MXV@externalviewer}\AND\NOT\boolean{@MXV@inline}}{}{%
+ %new file specification object
+ \pdfobj {<<%
+ /F(#4)%
+ \@MXV@fsentry%
+ \@MXV@efentry%
+ /Type/Filespec%
+ >>}\pdfrefobj\pdflastobj%
+ \edef\@MXV@filespec{\the\pdflastobj}%
+ }%
+ %
+ \makebox[0pt][r]{\makebox[#1][l]{%
+ %insert FileAttachment annotation
+ \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}\OR%
+ \boolean{@MXV@attachment}%
+ }{%
+ \pdfannot width #1 height #2 depth #3 {%
+ /Subtype /FileAttachment%
+ /F 0%
+ /T (\@MXV@filename)%
+ /Contents (Media File (\@MXV@mime))%
+ \if@MXV@externalviewer%
+ %a coloured border, as with external links, would be much nicer
+ /Name/Paperclip%
+ /C [1 1 1]%
+ \else%
+ /AP <</N<<>>/R<<>>/D<<>>>>%
+ \fi%
+ /FS \@MXV@filespec\space 0 R%
+ }%
+ }{%
+ \if@MXV@url%
+ %insert Link annotation, if media file is a URL
+ \pdfannot width #1 height #2 depth #3 {%
+ /Subtype /Link%
+ /F 0%
+ \if@MXV@externalviewer%
+ \@MXV@urlattr%
+ \else%
+ /H /N%
+ /Border [0 0 0]%
+ \fi%
+ /A <</URI (#4) /S/URI>>%
+ /Contents (Media File (\@MXV@mime))%
+ }%
+ \else%
+ %else insert Launch action for local external media file
+ \if@MXV@inline\else%
+ \pdfannot width #1 height #2 depth #3 {%
+ /Subtype /Link%
+ /F 0%
+ \if@MXV@externalviewer%
+ \@MXV@runattr%
+ \else%
+ /H /N%
+ /Border [0 0 0]%
+ \fi%
+ /A <<%
+ /F (#4)%
+ /S /Launch%
+ >>%
+ /Contents (Media File (\@MXV@mime))%
+ }%
+ \fi%
+ \fi%
+ }%
+ %
+ \if@MXV@externalviewer\else%
+ %annotation object of subtype `Screen'
+ \pdfannot width #1 height #2 depth #3 {%
+ /Subtype /Screen%
+ /Border [0 0 0]% no border (PDF-1.1)
+ /BS <</S/S/W 0>>% no border (PDF-1.5)
+ /F 5% disable annot if multimedia is not available
+ /T (\@MXV@filename)%
+ /Contents (Media File (\@MXV@mime))%
+ /P \@MXV@pdfpageref{@MXV@annot\the\@MXV@includes.page} 0 R%
+ /A \the\@MXV@adict\space 0 R%
+ /AA \the\@MXV@aadict\space 0 R%
+ /AP <</N<<>>/R<<>>/D<<>>>>%
+ }\edef\@MXV@screenannot{\the\pdflastannot}%
+ %label for later annot obj number determination, to be used in
+ %movieref's only
+ \ifx\@MXV@@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@@label.annot}{\@MXV@screenannot}%
+ \@MXV@newlabel{@MXV@\@MXV@@label.annot}{\@MXV@screenannot}%
+ \fi%
+ %
+ %new media clip object of subtype `Media Clip Data' (/S/MCD)
+ \pdfobj {<<%
+ /D \@MXV@filespec\space 0 R%
+ /P <</TF(TEMPACCESS)>>%
+ /S/MCD%
+ /CT (\@MXV@mime)%
+ >>}\pdfrefobj\pdflastobj%
+ %
+ %new rendition object of subtype `Media Rendition' (/S/MR)
+ \pdfobj {<<%
+ /C \the\pdflastobj\space 0 R%
+ /S/MR%
+ /SP <</BE<</O 0.0>>>>%
+ /P <<%
+ \@MXV@player%
+ /BE <<%
+ /F 2%
+ \@MXV@@repeat\@MXV@@volume\@MXV@@ctrls%
+ /D <</S /F>>%
+ \if@MXV@autoplay/A true\else/A false\fi%
+ >>%
+ >>%
+ >>}\edef\@MXV@mediarendition{\the\pdflastobj}\pdfrefobj\pdflastobj%
+ %label for later rendition obj number determination
+ \ifx\@MXV@@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@@label.rendition}{\@MXV@mediarendition}%
+ \@MXV@newlabel{@MXV@\@MXV@@label.rendition}{\@MXV@mediarendition}%
+ \fi%
+ %
+ %action dictionary
+ \pdfobj useobjnum \@MXV@adict {<<%
+ /R \@MXV@mediarendition\space 0 R%
+ /S/Rendition%
+ /OP 0% fallback if /JS doesn't work or is empty
+ \@MXV@activationjsentry%
+ /AN \@MXV@screenannot\space 0 R%
+ >>}\pdfrefobj\pdflastobj%
+ %
+ %create play/stop/resume/pause actions
+ \pdfobj {<<%
+ /R \@MXV@mediarendition\space 0 R%
+ /S/Rendition%
+ \@MXV@pageopenopentry% /OP fallback if /JS doesn't work
+ \@MXV@pageopenjsentry%
+ /AN \@MXV@screenannot\space 0 R%
+ >>}\edef\@MXV@pageopenaction{\the\pdflastobj}\pdfrefobj\pdflastobj%
+ %
+ \pdfobj {<<%
+ /R \@MXV@mediarendition\space 0 R%
+ /S/Rendition%
+ \@MXV@pagecloseopentry%
+ \@MXV@pageclosejsentry%
+ /AN \@MXV@screenannot\space 0 R%
+ >>}\edef\@MXV@pagecloseaction{\the\pdflastobj}\pdfrefobj\pdflastobj%
+ %
+ %populate additional actions dictionary
+ \pdfobj useobjnum \@MXV@aadict {<<%
+ /PO \@MXV@pageopenaction\space 0 R%
+ /PC \@MXV@pagecloseaction\space 0 R%
+ >>}\pdfrefobj\pdflastobj%
+ \fi}}%
+ }%
+\else%
+ %dvips version
+ \def\@MXV@includemovie#1#2#3#4{%
+ %insert FileAttachment annotation
+ \ifthenelse{\boolean{@MXV@inline}\AND\boolean{@MXV@externalviewer}\OR%
+ \boolean{@MXV@attachment}%
+ }{%
+ \makebox[0pt][l]{%
+ \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{%
+ pdfmark=/ANN,%
+ Subtype=/FileAttachment,%
+ Raw={%
+ /F 0%
+ /T (\@MXV@filename)%
+ /Contents (Media File (\@MXV@mime))%
+ \if@MXV@externalviewer%
+ /Name/Paperclip%
+ /C [1 1 1]%
+ \else%
+ /AP <</N<<>>/R<<>>/D<<>>>>%
+ \fi%
+ /FS {filespec\the\@MXV@includes}%
+ }%
+ }%
+ }%
+ }{%
+ \if@MXV@url%
+ %insert Link annotation, if media file is a URL
+ \makebox[0pt][l]{%
+ \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{%
+ pdfmark=/ANN,%
+ Subtype=/Link,%
+ Raw={%
+ /F 0%
+ \if@MXV@externalviewer%
+ /C [\@urlbordercolor]%
+ /H \@pdfhighlight%
+ \else%
+ /H /N%
+ /Border [0 0 0]%
+ \fi%
+ /Action <</URI (#4) /S/URI>>%
+ /Contents (Media File (\@MXV@mime))%
+ }%
+ }%
+ }%
+ \else%
+ %else insert Launch action for local external media file
+ \if@MXV@inline\else%
+ \makebox[0pt][l]{%
+ \pdfmark[\phantom{\@MXV@box{#1}{#2}{#3}}]{%
+ pdfmark=/ANN,%
+ Subtype=/Link,%
+ Raw={%
+ /F 0%
+ \if@MXV@externalviewer%
+ /C [\@urlbordercolor]%
+ /H \@pdfhighlight%
+ \else%
+ /H /N%
+ /Border [0 0 0]%
+ \fi%
+ /Action <<%
+ /F (#4)%
+ /S /Launch%
+ >>%
+ /Contents (Media File (\@MXV@mime))%
+ }%
+ }%
+ }%
+ \fi%
+ \fi%
+ }%
+ %
+ \if@MXV@externalviewer%
+ \@MXV@box{#1}{#2}{#3}%
+ \else%
+ %annotation object of subtype `Screen'
+ \pdfmark[\@MXV@box{#1}{#2}{#3}]{%
+ pdfmark=/ANN,%
+ Subtype=/Screen,%
+ Border={0 0 0},%
+ Raw={%
+ /_objdef {screenannot\the\@MXV@includes}%
+ /F 5%
+ /T (\@MXV@filename)%
+ /Contents (Media File (\@MXV@mime))%
+ /BS <</S/S/W 0>>% no border (PDF-1.5)
+ /P {ThisPage}%
+ /AA {aadict\the\@MXV@includes}%
+ /AP <</N<<>>/R<<>>/D<<>>>>%
+ }%
+ }%
+ \ifx\@MXV@@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@@label.annot}{\the\@MXV@includes}%
+ \@MXV@newlabel{@MXV@\@MXV@@label.annot}{\the\@MXV@includes}%
+ \fi%
+ %
+ %entire action entry moved outside screen annotation
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {screenannot\the\@MXV@includes} <<%
+ /A <<%
+ /R {mediarendition\the\@MXV@includes}%
+ /S/Rendition%
+ /OP 0% fallback, if /JS doesn't work or is empty
+ \@MXV@activationjsentry%
+ /AN {screenannot\the\@MXV@includes}%
+ >>%
+ >>%
+ }%
+ }%
+ %
+ %new rendition object of subtype `Media Rendition' (/S/MR)
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /type/dict%
+ /_objdef {mediarendition\the\@MXV@includes}%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {mediarendition\the\@MXV@includes} <<%
+ /C {mediaclipdata\the\@MXV@includes}%
+ /S/MR%
+ %screen parameters: fully transparent, hidden if audio mime type
+ /SP <</BE<</O 0.0>>>>%
+ /P <<%Media Play Parameters
+ \@MXV@player%
+ /BE <<%Parameters need only be honored by the player in
+ %the best effort sense
+ /F 2%scale media's width and height to fit the
+ %annotation rectangle
+ \@MXV@@repeat\@MXV@@volume\@MXV@@ctrls%
+ /D <</S /F>>%movie remains opened
+ \if@MXV@autoplay/A true\else/A false\fi%
+ >>%
+ >>%
+ >>%
+ }%
+ }%
+ %
+ %new media clip object of subtype `Media Clip Data' (/S/MCD)
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {mediaclipdata\the\@MXV@includes}%
+ /type/dict%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {mediaclipdata\the\@MXV@includes} <<%
+ /D {filespec\the\@MXV@includes}%
+ /P <</TF(TEMPACCESS)>>%
+ /S/MCD%
+ /CT (\@MXV@mime)% mime type
+ >>%
+ }%
+ }%
+ \fi%
+ %
+ %new file specification object
+ \ifthenelse{\boolean{@MXV@externalviewer}\AND\NOT\boolean{@MXV@inline}}{}{%
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {filespec\the\@MXV@includes}%
+ /type/dict%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {filespec\the\@MXV@includes} <<%
+ \@MXV@fsentry
+ /F(#4)% file name
+ /Type/Filespec%
+ >>%
+ }%
+ }%
+ }%
+ %
+ %embedded file entry `/EF'
+ \if@MXV@inline%
+ %embed the same media file only once
+ \ifthenelse{\equal{\@MXV@getlabelvalue{\pdfmdfivesum file {#4}}}{undefined}}{%
+ %new stream object
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {fstream\the\@MXV@includes}%
+ /type/stream%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {fstream\the\@MXV@includes}%
+ (#4) (r) file% read in file contents
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {fstream\the\@MXV@includes} <<%
+ /Type/EmbeddedFile%
+ /Subtype(\@MXV@mime)%
+ >>%
+ }%
+ }%
+ \edef\@MXV@moviestream{fstream\the\@MXV@includes}%
+ \@MXV@newlabel{\pdfmdfivesum file {#4}}{fstream\the\@MXV@includes}%
+ }{%
+ \edef\@MXV@moviestream{\@MXV@getlabelvalue{\pdfmdfivesum file {#4}}}%
+ }%
+ % put the embedded file entry into file spec object
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {filespec\the\@MXV@includes} <<%
+ /EF << /F {\@MXV@moviestream} >>%
+ >>%
+ }%
+ }%
+ \fi%
+ %
+ \if@MXV@externalviewer\else%
+ %create actions for page open/close events
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {pageopenaction\the\@MXV@includes}%
+ /type/dict%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {pageopenaction\the\@MXV@includes} <<%
+ /R {mediarendition\the\@MXV@includes}%
+ /S/Rendition%
+ \@MXV@pageopenopentry% /OP fallback, if /JS doesn't work
+ \@MXV@pageopenjsentry%
+ /AN {screenannot\the\@MXV@includes}%
+ >>%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {pagecloseaction\the\@MXV@includes}%
+ /type/dict%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {pagecloseaction\the\@MXV@includes} <<%
+ /R {mediarendition\the\@MXV@includes}%
+ /S/Rendition%
+ \@MXV@pagecloseopentry%
+ \@MXV@pageclosejsentry%
+ /AN {screenannot\the\@MXV@includes}%
+ >>%
+ }%
+ }%
+ %
+ %create and populate additional actions dictionary, always add entries
+ %for page open/close events
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /type/dict%
+ /_objdef {aadict\the\@MXV@includes}%
+ }%
+ }%
+ %
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {aadict\the\@MXV@includes} <<%
+ /PO {pageopenaction\the\@MXV@includes}%
+ /PC {pagecloseaction\the\@MXV@includes}%
+ >>%
+ }%
+ }%
+ \fi%
+ }%
+\fi
+
+%definition of user command `\includemovie'
+\newcommand{\includemovie}[4][]{%
+ \leavevmode%
+ \@MXV@reset% all macros and options
+ \setkeys{MXV@user}{#1}% parse options
+ %
+ %total height of text
+ \@MXV@totalheight=\@MXV@height%
+ \advance\@MXV@totalheight by \@MXV@depth%
+ %traiselen=distance at which text is to be raised to centre it vertically
+ %braiselen=vertical centre of media box (auxiliary measure)
+ \@MXV@traiselen=0.5\@MXV@height%
+ \advance\@MXV@traiselen by -0.5\@MXV@depth%
+ %
+ \ifthenelse{\equal{#3}{}}{% no height argument
+ \@MXV@braiselen=0.5\@MXV@height%
+ }{%override height of text, height argument given
+ \@MXV@braiselen=#3%
+ \@MXV@braiselen=0.5\@MXV@braiselen%
+ \setlength{\@MXV@height}{#3}%
+ }%
+ %
+ \ifthenelse{\equal{\@MXV@boxdepth}{}}{% no depth option given
+ \ifthenelse{\lengthtest{\@MXV@totalheight>\@MXV@height}}{%
+ %depth of text only taken into account, if the total height
+ %is smaller than the height of the display box
+ \advance\@MXV@braiselen by -0.5\@MXV@depth%
+ }{%
+ \@MXV@depth=0pt%
+ }%
+ }{%override depth of text, depth option given
+ \setlength{\@MXV@@boxdepth}{\@MXV@boxdepth}%
+ \advance\@MXV@braiselen by -0.5\@MXV@@boxdepth%
+ \setlength{\@MXV@depth}{\@MXV@boxdepth}%
+ }%
+ %finally centre text vertically
+ \ifthenelse{\NOT\equal{#3}{}\OR\NOT\equal{\@MXV@boxdepth}{}}{%
+ \advance\@MXV@traiselen by -\@MXV@braiselen%
+ \@MXV@traiselen=-\@MXV@traiselen%
+ \savebox{\@MXV@textbox}{\raisebox{\@MXV@traiselen}[0pt][0pt]{%
+ \usebox{\@MXV@textbox}}}%
+ }{}%
+ \ifthenelse{\equal{#2}{}}{}{%override horiz. dimension of text
+ \setlength{\@MXV@width}{#2}%
+ %centre text horizontally
+ \savebox{\@MXV@textbox}{\makebox[\@MXV@width][c]{\usebox{\@MXV@textbox}}}%
+ }%
+ %
+ %find out whether the contents should be hidden or not (for presentations)
+ \setboolean{@MXV@hide}{false}%
+% \ifthenelse{\boolean{@MXV@powerdot}}{%
+% \ifthenelse{\boolean{pd@overlay}}{}{%
+% \ifthenelse{\pd@method=2}{}{%
+% \setboolean{@MXV@hide}{true}%
+% }%
+% }%
+% }{}%
+ \ifthenelse{\boolean{@MXV@beamer}}{%
+ \ifthenelse{\boolean{beamer@anotherslide}}{%
+ \setboolean{@MXV@hide}{true}%
+ }{}%
+ }{}%
+ %
+ \ifthenelse{\boolean{@MXV@hide}}{%
+ %insert whitespace instead of annot
+ \phantom{\vrule width \@MXV@width height \@MXV@height depth \@MXV@depth}%
+ }{%
+ \ifthenelse{\NOT\boolean{@MXV@url}\AND\boolean{@MXV@inline}}{%
+ \IfFileExists{#4}{}{%
+ \PackageError{movie15}{%
+ File `#4' cannot be opened for embedding.\MessageBreak
+ Did you forget to set option `url' or `inline=false'?
+ }{%
+ Try any of the options `url' or `inline=false'!
+ }%
+ }%
+ }{}%
+ %
+ %guess the mime type based on the filename extension
+ \filename@parse{#4}%
+ \ifthenelse{\equal{\@MXV@mime}{@MXV@auto}}{%
+ \@MXV@guessmime{#4}{\filename@ext}}{}%
+ \if\filename@ext\relax%
+ \xdef\@MXV@filename{\filename@base}%
+ \else%
+ \xdef\@MXV@filename{\filename@base.\filename@ext}%
+ \fi%
+ \expandafter\@MXV@@issound\@MXV@mime:%
+ %
+ %if 3D object is not embedded inline we must use some external player :(
+ \ifthenelse{%
+ \boolean{@MXV@iiid}%
+ \AND\NOT\boolean{@MXV@inline}%
+ }{%
+ \setboolean{@MXV@externalviewer}{true}%
+ }{}%
+ %
+ \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
+ %
+ %label this annotation for later page number determination
+ \@MXV@labeltoaux{@MXV@annot\the\@MXV@includes.page}{%
+ \noexpand\the\@MXV@page}%
+ %
+ %label this annotation for later annot id number determination &
+ %check for multiply-defined labels
+ % \@MXV@label --> automatic (presentation mode) or user defined label
+ % \@MXV@@label = \@MXV@label (non presentation doc classes)
+ % \@MXV@@label = \@MXV@label + physical page No. (presentation mode)
+ \ifx\@MXV@label\@empty%
+ %when used with presentation packages, annots must be labelled,
+ %use the media file name, if no label provided
+ \ifthenelse{\boolean{@MXV@presentation}}{%
+ \xdef\@MXV@label{#4}%
+ }{}%
+ \fi%
+ \ifx\@MXV@label\@empty\else%
+ \ifthenelse{\boolean{@MXV@presentation}}{%
+ %in presentation mode, the label must be extended by the physical page No.
+ \xdef\@MXV@@label{\@MXV@label.\@MXV@getlabelvalue{@MXV@annot\the\@MXV@includes.page}}%
+ }{%
+ \xdef\@MXV@@label{\@MXV@label}%
+ }%
+ \fi%
+ \ifx\@MXV@@label\@empty\else%
+ \ifthenelse{%
+ \NOT\equal{\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}}{undefined}%
+ \AND%
+ \NOT\equal{\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}}{%
+ \the\@MXV@includes}%
+ }{%
+ \PackageWarning{movie15}{%
+ Label `\@MXV@label' multiply defined%
+ }%
+ \ifthenelse{\isundefined{\@MXV@multiwarning}}{%
+ \gdef\@MXV@multiwarning{}%
+ \AtEndDocument{%
+ \PackageWarningNoLine{movie15}{%
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak
+ @@ There were multiply-defined labels! @@\MessageBreak
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}%
+ }%
+ }{}%
+ }{}%
+ \if@MXV@@draft%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.draft}{true}%
+ \else%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.draft}{false}%
+ \fi%
+ \@MXV@labeltoaux{@MXV@\@MXV@@label.annotid}{\the\@MXV@includes}%
+ \if@MXV@presentation\else%
+ \@MXV@newlabel{@MXV@\@MXV@@label.annotid}{\the\@MXV@includes}%
+ \fi%
+ \fi%
+ %
+ \ifthenelse{\boolean{@MXV@@draft}}{}{%
+ \ifthenelse{\boolean{@MXV@externalviewer}}{%
+ \ifx\@MXV@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.externalviewer}{true}%
+ \@MXV@newlabel{@MXV@\@MXV@label.externalviewer}{true}%
+ \fi%
+ }{%
+ %what is to be put into movie link annot depends on the following
+ \ifx\@MXV@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.externalviewer}{false}%
+ \@MXV@newlabel{@MXV@\@MXV@label.externalviewer}{false}%
+ \fi%
+ %
+ %depending on options do content specific stuff
+ \ifthenelse{\boolean{@MXV@iiid}}{%
+ % #### 3D ####
+ \if@MXV@externalviewer\else%
+ \ifthenelse{\equal{\@MXV@iiidpalindrome}{/Subtype/Oscillating}}{%
+ \global\multiply\@MXV@iiidrepeat by 2%
+ }{}%
+ \ifthenelse{\boolean{@MXV@autoplay}\OR\boolean{@MXV@autoresume}}{%
+ \def\@MXV@activation{/A/PV/AIS/L}% open 3D object, run animation
+ }{%
+ \if@MXV@runposter%
+ \def\@MXV@activation{/A/PV/AIS/I}%open 3D obj but don't run animation
+ \else%
+ \def\@MXV@activation{/A/XA}% explicit activation by user
+ \fi%
+ }%
+ \if@MXV@autostop%
+ \def\@MXV@deactivation{/D/PI/DIS/I}%
+ \else%
+ \if@MXV@autopause%
+ \def\@MXV@deactivation{/D/PI/DIS/I}%
+ \else%
+ \if@MXV@autoclose%
+ \def\@MXV@deactivation{/D/PI/DIS/U}%
+ \else%@MXV@continue
+ \def\@MXV@deactivation{/D/PI/DIS/L}%
+ \fi%
+ \fi%
+ \fi%
+ %counter for 3D inclusion on current page
+ \ifthenelse{%
+ \equal{%
+ \@MXV@getlabelvalue{@MXV@annot\the\@MXV@includes.page}%
+ }{\@MXV@oldpage}%
+ }{%
+ \global\advance\@MXV@iiidoncurpage by 1%
+ }{%
+ \global\@MXV@iiidoncurpage=1%
+ }%
+ \xdef\@MXV@oldpage{\@MXV@getlabelvalue{%
+ @MXV@annot\the\@MXV@includes.page}}%
+ \fi%
+ \ifx\@MXV@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.3D}{true}%
+ \@MXV@newlabel{@MXV@\@MXV@label.3D}{true}%
+ \@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}%
+ \@MXV@newlabel{@MXV@\@MXV@@label.3Doncurpage}{\the\@MXV@iiidoncurpage}%
+ \fi%
+ }{%#### 2D ####
+ %get the player ID
+ \if@MXV@presentation%
+ \ifthenelse{%
+ \equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}}{undefined}%
+ }{%
+ \global\advance\@MXV@players by 1%increment counter
+ }{%
+ \global\@MXV@players=\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}%
+ }%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.playerid}{\the\@MXV@players}%
+ \@MXV@newlabel{@MXV@\@MXV@label.playerid}{\the\@MXV@players}%
+ \edef\@MXV@currplayer{\the\@MXV@players}%
+ \else%
+ \ifx\@MXV@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.playerid}{\the\@MXV@includes}%
+ \@MXV@newlabel{@MXV@\@MXV@label.playerid}{\the\@MXV@includes}%
+ \fi%
+ \edef\@MXV@currplayer{\the\@MXV@includes}%
+ \fi%
+ %
+ \ifx\@MXV@startat\@empty% default start position
+ \gdef\@MXV@startat{, startAt: 0}%
+ \fi%
+ %write player settings to aux file
+ \ifx\@MXV@label\@empty\else%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.mouse}{%
+ \if@MXV@mouse true\else false\fi}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.showUI}{\@MXV@ctrls}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.palindrome}{\@MXV@palindrome}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.repeat}{\@MXV@repeat}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.rate}{\@MXV@rate}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.startAt}{\@MXV@startat}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.endAt}{\@MXV@endat}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.volume}{\@MXV@volume}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.autoplay}{%
+ \if@MXV@autoplay true\else false\fi}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.3D}{false}%
+ \@MXV@labeltoaux{@MXV@\@MXV@label.issound}{%
+ \if@MXV@issound true\else false\fi}%
+ %
+ \@MXV@newlabel{@MXV@\@MXV@label.mouse}{%
+ \if@MXV@mouse true\else false\fi}%
+ \@MXV@newlabel{@MXV@\@MXV@label.showUI}{\@MXV@ctrls}%
+ \@MXV@newlabel{@MXV@\@MXV@label.palindrome}{\@MXV@palindrome}%
+ \@MXV@newlabel{@MXV@\@MXV@label.repeat}{\@MXV@repeat}%
+ \@MXV@newlabel{@MXV@\@MXV@label.rate}{\@MXV@rate}%
+ \@MXV@newlabel{@MXV@\@MXV@label.startAt}{\@MXV@startat}%
+ \@MXV@newlabel{@MXV@\@MXV@label.endAt}{\@MXV@endat}%
+ \@MXV@newlabel{@MXV@\@MXV@label.volume}{\@MXV@volume}%
+ \@MXV@newlabel{@MXV@\@MXV@label.autoplay}{%
+ \if@MXV@autoplay true\else false\fi}%
+ \@MXV@newlabel{@MXV@\@MXV@label.3D}{false}%
+ \@MXV@newlabel{@MXV@\@MXV@label.issound}{%
+ \if@MXV@issound true\else false\fi}%
+ %
+ \fi%
+ %
+ \ifthenelse{\boolean{@MXV@autoplay}\OR\boolean{@MXV@runposter}}{%
+ \xdef\@MXV@pageopenopentry{/OP 4}%
+ }{%
+ \if@MXV@autoresume%
+ \xdef\@MXV@pageopenopentry{/OP 3}%
+ \else%
+ \xdef\@MXV@pageopenopentry{/OP 2}%
+ \fi%
+ }%
+ %
+ \if@MXV@autostop%
+ \xdef\@MXV@pagecloseopentry{/OP 1}%
+ \else%
+ \if@MXV@autopause%
+ \xdef\@MXV@pagecloseopentry{/OP 2}%
+ \else%
+ \if@MXV@autoclose%
+ \xdef\@MXV@pagecloseopentry{/OP 1}%
+ \else% @MXV@continue
+ \xdef\@MXV@pagecloseopentry{/OP 3}%
+ \fi%
+ \fi%
+ \fi%
+ %
+ %JavaScripts for playback control
+ %script for page invisible event
+ \if@MXV@autopause%
+ \xdef\@MXV@pageclosejsentry{%
+ /JS (
+ try{%
+ if(player\@MXV@currplayer.isPlaying){%
+ player\@MXV@currplayer.pause();
+ player\@MXV@currplayer.settings.privateData.paused=true;
+ }
+ focusonplayer=-1; %page change
+ player\@MXV@currplayer.visible=false;
+ }
+ catch(e){}
+ )%
+ }%
+ \else%
+ \if@MXV@autostop%
+ \xdef\@MXV@pageclosejsentry{%
+ /JS (
+ try{%
+ player\@MXV@currplayer.settings.privateData.paused=false;
+ %players tend to be bugged, always stop from playing state
+ if(!player\@MXV@currplayer.isPlaying){
+ player\@MXV@currplayer.play();
+ }
+ player\@MXV@currplayer.stop();
+ if(
+ player\@MXV@currplayer.settings.startAt.time
+ || player\@MXV@currplayer.settings.startAt.frame
+ || player\@MXV@currplayer.settings.startAt.marker
+ || player\@MXV@currplayer.id ==
+ 'vnd.adobe.swname:AAPL_QuickTime'
+ ){
+ player\@MXV@currplayer.seek(%
+ player\@MXV@currplayer.settings.startAt);
+ }
+ focusonplayer=-1;
+ player\@MXV@currplayer.visible=false;
+ }
+ catch(e){}
+ )%
+ }%
+ \else%
+ \if@MXV@autoclose%
+ \xdef\@MXV@pageclosejsentry{%
+ /JS (
+ try{%
+ player\@MXV@currplayer.close(app.media.closeReason.general);
+ focusonplayer=-1; %page change
+ player\@MXV@currplayer.visible=false;
+ }
+ catch(e){}
+ )%
+ }%
+ \else%
+ \xdef\@MXV@pageclosejsentry{%@MXV@continue
+ /JS (
+ try{%
+ focusonplayer=-1; %page change
+ player\@MXV@currplayer.visible=false;
+ }
+ catch(e){}
+ )%
+ }%
+ \fi%
+ \fi%
+ \fi%
+ %
+ %script for activation/resume on page open event
+ \xdef\@MXV@pageopenjsentry{%
+ /JS (
+ try{%
+ if(player\@MXV@currplayer.isOpen){%
+ %drag the player on the current slide (presentation mode)
+ player\@MXV@currplayer.page=this.pageNum;
+ %... and make it visible
+ \if@MXV@issound\else player\@MXV@currplayer.visible=true;\fi%
+ %
+ %start or resume media which have autoplay option set;
+ %also resume paused media which have autoresume option set
+ \if@MXV@autoplay%
+ player\@MXV@currplayer.settings.privateData.paused=false;
+ player\@MXV@currplayer.play();
+ if(!player\@MXV@currplayer.isPlaying){% still not playing?!
+ if(
+ player\@MXV@currplayer.settings.startAt.time
+ || player\@MXV@currplayer.settings.startAt.frame
+ || player\@MXV@currplayer.settings.startAt.marker
+ || player\@MXV@currplayer.id=='vnd.adobe.swname:AAPL_QuickTime'
+ ){
+ player\@MXV@currplayer.seek(
+ player\@MXV@currplayer.settings.startAt);
+ }else{
+ player\@MXV@currplayer.stop();
+ }
+ player\@MXV@currplayer.play();
+ }
+ \else%
+ \if@MXV@autoresume%
+ if(player\@MXV@currplayer.settings.privateData.paused){%
+ player\@MXV@currplayer.settings.privateData.paused=false;
+ player\@MXV@currplayer.play();
+ if(!player\@MXV@currplayer.isPlaying){%
+ if(
+ player\@MXV@currplayer.settings.startAt.time
+ || player\@MXV@currplayer.settings.startAt.frame
+ || player\@MXV@currplayer.settings.startAt.marker
+ || player\@MXV@currplayer.id ==
+ 'vnd.adobe.swname:AAPL_QuickTime'
+ ){
+ player\@MXV@currplayer.seek(%
+ player\@MXV@currplayer.settings.startAt);
+ }else{
+ player\@MXV@currplayer.stop();%
+ }
+ player\@MXV@currplayer.play();
+ }
+ }
+ \fi%
+ \fi%
+ }
+ else{%
+ throw 'isClosed';
+ }
+ }
+ catch(e){%
+ \@MXV@if{\if@MXV@autoplay true\else\if@MXV@runposter true\else %
+ false\fi\fi}%
+ if(focusonplayer==undefined){%
+ var focusonplayer=0; %shared by all annots
+ }
+ \@MXV@settings{\@MXV@ctrls}{\@MXV@palindrome}{\@MXV@repeat}%
+ {\@MXV@rate}{\@MXV@startat}{\@MXV@endat}{\@MXV@volume}%
+ \@MXV@events{\@MXV@currplayer}%
+ {\if@MXV@mouse true\else false\fi}%
+ {\if@MXV@autoplay true\else false\fi}%
+ var player\@MXV@currplayer=app.media.openPlayer({%
+ settings: settings,
+ events: events
+ });
+ \fi%
+ }%
+ )
+ }%
+ %
+ %script for normal activation by mouse click
+ \xdef\@MXV@activationjsentry{%
+ /JS (
+ app.focusRect=true;%
+ if(focusonplayer==undefined){%
+ var focusonplayer=0; %shared by all annots
+ }
+ \@MXV@settings{\@MXV@ctrls}{\@MXV@palindrome}{\@MXV@repeat}%
+ {\@MXV@rate}{\@MXV@startat}{\@MXV@endat}{\@MXV@volume}%
+ \@MXV@events{\@MXV@currplayer}{\if@MXV@mouse true\else false\fi}%
+ {true}%
+ var player\@MXV@currplayer=app.media.openPlayer({%
+ settings: settings,
+ events: events
+ });
+ )
+ }%
+ }%
+ }%
+ }% draft?
+ %
+ %insert link target, if media has been labelled
+ \ifthenelse{\NOT\equal{\@MXV@@label}{}}{%
+ \raisebox{\@MXV@height}{%
+ \ifpdf%
+ \pdfdest name {@MXV@\@MXV@@label} xyz %
+ \else%
+ \hypertarget{@MXV@\@MXV@@label}{}%
+ \fi%
+ }%
+ }{}%
+ %
+ \ifthenelse{\boolean{@MXV@@draft}}{%
+ \makebox[0pt][l]{\usebox{\@MXV@textbox}}%
+ \@MXV@draftbox{\@MXV@width}{\@MXV@height}{\@MXV@depth}{#4}%
+ }{%
+ %insert textbox, obscured by poster
+ \ifthenelse{\boolean{@MXV@boxopt}\AND\NOT\boolean{@MXV@textoverposter}}{%
+ \makebox[0pt][l]{\usebox{\@MXV@textbox}}%
+ }{}%
+ %
+ %insert annotation
+ \ifthenelse{\boolean{@MXV@iiid}}{%
+ \edef\@MXV@iiidopt{[\@MXV@iiidopt]}%
+ \expandafter\@MXV@includeiiid\@MXV@iiidopt{\@MXV@width}{\@MXV@height}{\@MXV@depth}{#4}%
+ }{%
+ \@MXV@includemovie{\@MXV@width}{\@MXV@height}{\@MXV@depth}{#4}%
+ }%
+ %
+ %insert textbox, overprinting the poster
+ \ifthenelse{\boolean{@MXV@boxopt}\AND\boolean{@MXV@textoverposter}}{%
+ \makebox[0pt][r]{\usebox{\@MXV@textbox}}%
+ }{}%
+ }%
+ }%
+}
+
+%for remote control of media
+\newcommand\movieref[3][]{%
+ \leavevmode%
+ % save text argument
+ \savebox{\@MXV@textbox}{\ifHy@colorlinks\color{\@linkcolor}\fi#3}%
+ %
+ %find out whether the contents should be hidden or not (for presentations)
+ \setboolean{@MXV@hide}{false}%
+% \ifthenelse{\boolean{@MXV@powerdot}}{%
+% \ifthenelse{\boolean{pd@overlay}}{}{%
+% \ifthenelse{\pd@method=2}{}{%
+% \setboolean{@MXV@hide}{true}%
+% }%
+% }%
+% }{}%
+ \ifthenelse{\boolean{@MXV@beamer}}{%
+ \ifthenelse{\boolean{beamer@anotherslide}}{%
+ \setboolean{@MXV@hide}{true}%
+ }{}%
+ }{}%
+ %
+ \ifthenelse{\boolean{@MXV@hide}}{%
+ %put whitespace instead of link annot
+ \phantom{\usebox{\@MXV@textbox}}%
+ }{%
+ \@MXV@reset%
+ %
+ \xdef\@MXV@label{#2}%
+ %
+ \global\advance\@MXV@links by 1%increment link counter
+ %
+ %label this link for later page number determination
+ \@MXV@labeltoaux{@MXV@link\the\@MXV@links.page}{\noexpand\the\@MXV@page}%
+ %
+ \ifthenelse{\boolean{@MXV@presentation}}{%
+ %in presentation mode the label must be extended by the physical page No.
+ \xdef\@MXV@@label{\@MXV@label.\@MXV@getlabelvalue{@MXV@link\the\@MXV@links.page}}%
+ }{%
+ \xdef\@MXV@@label{\@MXV@label}%
+ }%
+ %
+ %check if label is defined at all
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}}{undefined}}{%
+ \usebox{\@MXV@textbox}% write out text box
+ \PackageWarning{movie15}{%
+ Reference `\@MXV@label' on page \thepage \space undefined%
+ }%
+ \ifthenelse{\isundefined{\@MXV@undefwarning}}{%
+ \gdef\@MXV@undefwarning{}%
+ \AtEndDocument{%
+ \PackageWarningNoLine{movie15}{%
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\MessageBreak%
+ @@ There were undefined references! @@\MessageBreak%
+ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@}%
+ }%
+ }{}%
+ }{%
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.draft}}{true}}{%
+ \setboolean{@MXV@@draft}{true}% if the screen annotation is in draft mode
+ }{}%
+ \if@MXV@@draft\else%
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.externalviewer}}{true}}{%
+ \setboolean{@MXV@externalviewer}{true}%
+ }{%
+ \setboolean{@MXV@externalviewer}{false}%
+ }%
+ \if@MXV@externalviewer\else%
+ %movieref used in 3D context?
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.3D}}{true}}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \setboolean{@MXV@iiid}{true}%
+ }{%
+ \@MXV@neediiiD%
+ }%
+ }{}%
+ %
+ %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}}{%
+ \gdef\@MXV@defaultlights{}%
+ }{%
+ \xdef\@MXV@defaultlights{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Dlights}}%
+ }%
+ %retrieve default render mode
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.3Drender}}{undefined}}{%
+ \gdef\@MXV@defaultrender{Solid}%
+ }{%
+ \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
+ \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
+ \edef\@MXV@iiidview{\@MXV@@viewobj}%
+ %else use the indexed view specified by option `3Dviewindex'
+ \fi%
+ %
+ %create JavaScript (options 3Djscript, 3Dcalculate, 3Dgetview)
+ \ifthenelse{\NOT\equal{\@MXV@jscriptiiidfile}{}%
+ \OR\NOT\equal{\@MXV@calc}{}%
+ \OR\boolean{@MXV@iiidgetview}%
+ }{%
+ \edef\@MXV@linkjscriptiiid{%
+ try{%
+ %fill hash (annot3D) with refs to Annot3D objects
+ annot3D['\@MXV@label']=getAnnots3D(%
+ \@MXV@getlabelvalue{%
+ @MXV@annot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}.page%
+ }-1%
+ )[\@MXV@getlabelvalue{@MXV@\@MXV@@label.3Doncurpage}-1];%
+ annot3D['\@MXV@label'].activated=true;%
+ }catch(e){%
+ try{%
+ annot3D=new Array;%
+ annot3D['\@MXV@label']=getAnnots3D(%
+ \@MXV@getlabelvalue{%
+ @MXV@annot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}.page%
+ }-1%
+ )[\@MXV@getlabelvalue{@MXV@\@MXV@@label.3Doncurpage}-1];%
+ annot3D['\@MXV@label'].activated=true;%
+ }catch(e){%
+ var spc=String.fromCharCode(32);%
+ app.alert('3D' + spc + 'annotation' + spc + 'could' + spc +%
+ 'not' + spc + 'be' + spc + 'activated!');%
+ }%
+ }%
+ }%
+ \if@MXV@iiidgetview%
+ \edef\@MXV@linkjscriptiiid{%
+ \@MXV@linkjscriptiiid
+ try{
+ %JavaScript to print the camera settings of the current view
+ 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
+ var spc=String.fromCharCode(32);%
+ var nl=String.fromCharCode(10);%
+ var charht=2;%
+ var res='VIEW\%={<insert'+spc+'descriptive'+spc+'name'+spc+
+ 'here'+spc+'(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+=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 ?%
+ util.printf('\%.18f', y): y),%
+ (Math.abs(z) < 1.001e-6 && Math.abs(z) > 0 ?%
+ util.printf('\%.18f', z): z)%
+ );%
+ charht+=2;%
+ }%
+ 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 += 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 ?%
+ util.printf('\%.18f', y): y),%
+ (Math.abs(z) < 1.001e-6 && Math.abs(z) > 0 ?%
+ util.printf('\%.18f', z): z)%
+ );%
+ charht+=2;%
+ }%
+ if(roo > 0.11e-17){%
+ res+= spc + spc;%
+ res+=util.printf('ROO=\%s' + nl,%
+ (roo < 1.001e-6 ? util.printf('\%.12f', roo): roo)%
+ );%
+ charht+=2;%
+ }%
+ %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);%
+ %}%
+ var roll = camera.roll*180/Math.PI;%
+ if(util.printf('\%.4f', roll)!=0){%
+ res+=util.printf(spc +spc + 'ROLL=\%s' + nl, roll);%
+ charht+=2;%
+ }%
+ aac=camera.fov * 180/Math.PI;%
+ if(util.printf('\%.5f', aac)!=30){%
+ res+=util.printf(spc + spc + 'AAC=\%s' + nl,%
+ (Math.abs(aac) < 1.001e-6 ? util.printf('\%.18f', aac): aac)%
+ );%
+ charht+=2;%
+ }%
+ 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:
+ defaultrender='BoundingBox';break;
+ case scene.RENDER_MODE_TRANSPARENT_BOUNDING_BOX:
+ defaultrender='TransparentBoundingBox';break;
+ case scene.RENDER_MODE_TRANSPARENT_BOUNDING_BOX_OUTLINE:
+ defaultrender='TransparentBoundingBoxOutline';break;
+ case scene.RENDER_MODE_VERTICES:
+ defaultrender='Vertices';break;
+ case scene.RENDER_MODE_SHADED_VERTICES:
+ defaultrender='ShadedVertices';break;
+ case scene.RENDER_MODE_WIREFRAME:
+ defaultrender='Wireframe';break;
+ case scene.RENDER_MODE_SHADED_WIREFRAME:
+ defaultrender='ShadedWireframe';break;
+ case scene.RENDER_MODE_SOLID:
+ defaultrender='Solid';break;
+ case scene.RENDER_MODE_TRANSPARENT:
+ defaultrender='Transparent';break;
+ case scene.RENDER_MODE_SOLID_WIREFRAME:
+ defaultrender='SolidWireframe';break;
+ case scene.RENDER_MODE_TRANSPARENT_WIREFRAME:
+ defaultrender='TransparentWireframe';break;
+ case scene.RENDER_MODE_ILLUSTRATION:
+ defaultrender='Illustration';break;
+ case scene.RENDER_MODE_SOLID_OUTLINE:
+ defaultrender='SolidOutline';break;
+ case scene.RENDER_MODE_SHADED_ILLUSTRATION:
+ defaultrender='ShadedIllustration';break;
+ case scene.RENDER_MODE_HIDDEN_WIREFRAME:
+ defaultrender='HiddenWireframe';break;
+ }%
+ res+=spc+spc+'RENDERMODE='+defaultrender+nl;%
+ charht+=2;%
+ for(var i=0;i<scene.meshes.count;i++){%
+ var mesh=scene.meshes.getByIndex(i);%
+ respart=spc+spc+'PART={'+mesh.name+'}'+nl;%
+ charhtpart=2;
+ defaultvals=true;%
+ if(!mesh.visible){%
+ respart+=spc+spc+spc+spc+'VISIBLE=false'+nl;%
+ charhtpart+=2;%
+ defaultvals=false;%
+ }
+ if(mesh.visible){%
+ if(mesh.opacity<1.0){%
+ respart+=spc+spc+spc+spc+'OPACITY='+mesh.opacity+nl;%
+ charhtpart+=2;%
+ 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+=spc+spc+spc+spc+'RENDERMODE='+currender+nl;%
+ charhtpart+=2;%
+ defaultvals=false;%
+ }%
+ }%
+ respart+=spc+spc+'END'+nl;%
+ charhtpart+=2;%
+ if(!defaultvals){%
+ res+=respart;
+ charht+=charhtpart;
+ }%
+ }%
+ res+='END'+nl;%
+ charht=(charht>40?40:charht);%
+ %open pop-up displaying the result string
+ var settings={%
+ initialize: function(dialog) {%
+ dialog.load({%
+ 'text': res%
+ });%
+ },%
+ description: {%
+ name: 'Current' + spc + '3D' + spc + 'Camera' + spc + 'Settings',%
+ elements: [%
+ {%
+ type: 'static_text',%
+ 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 + '3Dviews2!)'%
+ },%
+ {%
+ type: 'edit_text',%
+ item_id: 'text',%
+ alignment: 'align_fill',%
+ multiline: true,%
+ char_width: 80,%
+ char_height: charht,%
+ readonly: true%
+ },%
+ {%
+ type: 'ok',%
+ ok_name: 'Close'%
+ }%
+ ]%
+ }%
+ };%
+ app.execDialog(settings);%
+ }catch(e){%
+ var spc=String.fromCharCode(32);%
+ app.alert('Error' + spc + 'while' + spc + 'executing' + spc +%
+ '3Dgetview:' + spc + e);%
+ }%
+ }%
+ \fi%
+ \ifx\@MXV@calc\@empty\else%
+ \edef\@MXV@linkjscriptiiid{%
+ \@MXV@linkjscriptiiid
+ try{
+% console.show();
+% console.clear();
+ %constructor for doubly linked list
+ function List(){%
+ this.first_node=null;%
+ this.last_node=new Node(undefined);%
+ }%
+ List.prototype.push_back=function(x){%
+ var new_node=new Node(x);%
+ if(this.first_node==null){%
+ this.first_node=new_node;%
+ new_node.prev=null;%
+ }else{%
+ new_node.prev=this.last_node.prev;%
+ new_node.prev.next=new_node;%
+ }%
+ new_node.next=this.last_node;%
+ this.last_node.prev=new_node;%
+ };%
+ List.prototype.move_to_front=function(it){%
+ var node=it.get();%
+ if(node.next!=null && node.prev!=null){%
+ node.next.prev=node.prev;%
+ node.prev.next=node.next;%
+ node.prev=null;%
+ node.next=this.first_node;%
+ this.first_node.prev=node;%
+ this.first_node=node;%
+ }%
+ };%
+ List.prototype.begin=function(){%
+ var i=new Iterator();%
+ i.target=this.first_node;%
+ return(i);%
+ };%
+ List.prototype.end=function(){%
+ var i=new Iterator();%
+ i.target=this.last_node;%
+ return(i);%
+ };%
+ function Iterator(it){%
+ if( it!=undefined ){%
+ this.target=it.target;%
+ }else {%
+ this.target=null;%
+ }%
+ }%
+ Iterator.prototype.set=function(it){this.target=it.target;};%
+ Iterator.prototype.get=function(){return(this.target);};%
+ Iterator.prototype.deref=function(){return(this.target.data);};%
+ Iterator.prototype.incr=function(){%
+ if(this.target.next!=null){this.target=this.target.next;}%
+ };%
+ %constructor for node objects that populate the linked list
+ function Node(x){%
+ this.prev=null;%
+ this.next=null;%
+ this.data=x;%
+ }%
+ function sqr(r){return(r*r);}%helper function
+ %The following code borrows heavily from Bernd Gaertners `Miniball' software,
+ %originally written in C++, for computing the smallest enclosing ball of a
+ %set of points; see: http://www.inf.ethz.ch/personal/gaertner/miniball.html
+ function Basis(){%
+ this.m=0;%
+ this.q0=new Array(3);%
+ this.z=new Array(4);%
+ this.f=new Array(4);%
+ this.v=new Array(new Array(3), new Array(3), new Array(3), new Array(3));%
+ this.a=new Array(new Array(3), new Array(3), new Array(3), new Array(3));%
+ this.c=new Array(new Array(3), new Array(3), new Array(3), new Array(3));%
+ this.sqr_r=new Array(4);%
+ this.current_c=this.c[0];%
+ this.current_sqr_r=0;%
+ this.reset();%
+ }%
+ Basis.prototype.center=function(){return(this.current_c);};%
+ Basis.prototype.size=function(){return(this.m);};%
+ Basis.prototype.pop=function(){--this.m;};%
+ Basis.prototype.excess=function(p){%
+ var e=-this.current_sqr_r;%
+ for(var k=0;k<3;++k){%
+ e+=sqr(p[k]-this.current_c[k]);%
+ }%
+ return(e);%
+ };%
+ Basis.prototype.reset=function(){%
+ this.m=0;%
+ for(var j=0;j<3;++j){%
+ this.c[0][j]=0;%
+ }%
+ this.current_c=this.c[0];%
+ this.current_sqr_r=-1;%
+ };%
+ Basis.prototype.push=function(p){%
+ var i, j;%
+ var eps=1e-32;%
+ if(this.m==0){%
+ for(i=0;i<3;++i){%
+ this.q0[i]=p[i];%
+ }%
+ for(i=0;i<3;++i){%
+ this.c[0][i]=this.q0[i];%
+ }%
+ this.sqr_r[0]=0;%
+ }else {%
+ for(i=0;i<3;++i){%
+ this.v[this.m][i]=p[i]-this.q0[i];%
+ }%
+ for(i=1;i<this.m;++i){%
+ this.a[this.m][i]=0;%
+ for(j=0;j<3;++j){%
+ this.a[this.m][i]+=this.v[i][j]*this.v[this.m][j];%
+ }%
+ this.a[this.m][i]*=(2/this.z[i]);%
+ }%
+ for(i=1;i<this.m;++i){%
+ for(j=0;j<3;++j){%
+ this.v[this.m][j]-=this.a[this.m][i]*this.v[i][j];%
+ }%
+ }%
+ this.z[this.m]=0;%
+ for(j=0;j<3;++j){%
+ this.z[this.m]+=sqr(this.v[this.m][j]);%
+ }%
+ this.z[this.m]*=2;%
+ if(this.z[this.m]<eps*this.current_sqr_r){%
+ return(false);%
+ }%
+ var e=-this.sqr_r[this.m-1];%
+ for(i=0;i<3;++i){%
+ e+=sqr(p[i]-this.c[this.m-1][i]);%
+ }%
+ this.f[this.m]=e/this.z[this.m];%
+ for(i=0;i<3;++i){%
+ this.c[this.m][i]=this.c[this.m-1][i]+this.f[this.m]*this.v[this.m][i];%
+ }%
+ this.sqr_r[this.m]=this.sqr_r[this.m-1]+e*this.f[this.m]/2;%
+ }%
+ this.current_c=this.c[this.m];%
+ this.current_sqr_r=this.sqr_r[this.m];%
+ ++this.m;%
+ return(true);%
+ };%
+ function Miniball(){%
+ this.L=new List();%
+ this.B=new Basis();%
+ this.support_end=new Iterator();%
+ }%
+ Miniball.prototype.mtf_mb=function(it){%
+ var i=new Iterator(it);%
+ this.support_end.set(this.L.begin());%
+ if((this.B.size())==4){return;}%
+ for(var k=new Iterator(this.L.begin());k.get()!=i.get();){%
+ var j=new Iterator(k);%
+ k.incr();%
+ if(this.B.excess(j.deref()) > 0){%
+ if(this.B.push(j.deref())){%
+ this.mtf_mb(j);%
+ this.B.pop();%
+ if(this.support_end.get()==j.get()){%
+ this.support_end.incr();%
+ }%
+ this.L.move_to_front(j);%
+ }%
+ }%
+ }%
+ };%
+ Miniball.prototype.check_in=function(b){%
+ this.L.push_back(b);%
+ };%
+ Miniball.prototype.build=function(){%
+ this.B.reset();%
+ this.support_end.set(this.L.begin());%
+ this.mtf_mb(this.L.end());%
+ };%
+ Miniball.prototype.center=function(){%
+ return(this.B.center());%
+ };%
+ Miniball.prototype.radius=function(){%
+ return(Math.sqrt(this.B.current_sqr_r));%
+ };%
+ %create Miniball object
+ var mb=new Miniball();%
+ %scene object
+ var scene=annot3D['\@MXV@label'].context3D.scene;%
+ %aperture angle of the virtual camera
+ 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 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
+ var trans=mesh.transform.transpose;%
+ %build local to world transformation matrix by recursively
+ %multiplying the parent's transf. matrix on the left
+ var parent=mesh.parent;%
+ while(parent.transform){%
+ trans=parent.transform.transpose.multiply(trans);%
+ parent=parent.parent;%
+ }%
+ %transform the local bounding box corner coordinates to
+ %world coordinates for bounding sphere determination;
+ %Matrix4x4 method transformDirection(<Vector3>) seems
+ %to be bugged, therefore we must resort to the
+ %multiply(<Matrix4x4>) method using an auxiliary matrix
+ %which contains the local bounding box corner coordinates
+ %
+ %auxiliary matrix from bbox.min coordinates
+ bbox4x4.setView(bbox.min, dir, up);%
+ %transform to world coordinates
+ bbox4x4=trans.multiply(bbox4x4.transpose);%
+ %extract the transformed coordinates
+ corner.set(bbox4x4.transpose.translation);%
+ %check-in corner position into Miniball
+ mb.check_in(new Array(corner.x, corner.y, corner.z));%
+ %the same procedure with bbox.max
+ bbox4x4.setView(bbox.max, dir, up);%
+ bbox4x4=trans.multiply(bbox4x4.transpose);%
+ corner.set(bbox4x4.transpose.translation);%
+ mb.check_in(new Array(corner.x, corner.y, corner.z));%
+ %and with all remaining 6 bbox corners
+ corner.set(bbox.min.x, bbox.max.y, bbox.max.z);%
+ bbox4x4.setView(corner, dir, up);%
+ bbox4x4=trans.multiply(bbox4x4.transpose);%
+ corner.set(bbox4x4.transpose.translation);%
+ mb.check_in(new Array(corner.x, corner.y, corner.z));%
+ corner.set(bbox.min.x, bbox.min.y, bbox.max.z);%
+ bbox4x4.setView(corner, dir, up);%
+ bbox4x4=trans.multiply(bbox4x4.transpose);%
+ corner.set(bbox4x4.transpose.translation);%
+ mb.check_in(new Array(corner.x, corner.y, corner.z));%
+ corner.set(bbox.min.x, bbox.max.y, bbox.min.z);%
+ bbox4x4.setView(corner, dir, up);%
+ bbox4x4=trans.multiply(bbox4x4.transpose);%
+ corner.set(bbox4x4.transpose.translation);%
+ mb.check_in(new Array(corner.x, corner.y, corner.z));%
+ corner.set(bbox.max.x, bbox.min.y, bbox.min.z);%
+ bbox4x4.setView(corner, dir, up);%
+ bbox4x4=trans.multiply(bbox4x4.transpose);%
+ corner.set(bbox4x4.transpose.translation);%
+ mb.check_in(new Array(corner.x, corner.y, corner.z));%
+ corner.set(bbox.max.x, bbox.min.y, bbox.max.z);%
+ bbox4x4.setView(corner, dir, up);%
+ bbox4x4=trans.multiply(bbox4x4.transpose);%
+ corner.set(bbox4x4.transpose.translation);%
+ mb.check_in(new Array(corner.x, corner.y, corner.z));%
+ corner.set(bbox.max.x, bbox.max.y, bbox.min.z);%
+ bbox4x4.setView(corner, dir, up);%
+ bbox4x4=trans.multiply(bbox4x4.transpose);%
+ corner.set(bbox4x4.transpose.translation);%
+ mb.check_in(new Array(corner.x, corner.y, corner.z));%
+ }%
+ %compute the smallest enclosing bounding sphere
+ mb.build();%
+ %bounding sphere centre
+ var coo=new annot3D['\@MXV@label'].context3D.Vector3();%
+ coo.set((mb.center())[0], (mb.center())[1], (mb.center())[2]);%
+ %radius of orbit
+ var roo=mb.radius()/ Math.sin(aac * Math.PI/ 360.);%
+ %result string
+ var res='';%
+ var spc=String.fromCharCode(32);%
+ 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){%
+ 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 ?%
+ util.printf('\%.18f', coo.y): coo.y),%
+ (Math.abs(coo.z) < 1.001e-6 && Math.abs(coo.z) > 0 ?%
+ util.printf('\%.18f', coo.z): coo.z)%
+ );%
+ }%
+ % 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,',%
+ 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;
+ }%
+ if(currender!='Solid'){%
+ charht+=2;multiln=true;
+ res+=util.printf(nl+'3Drender=\%s,', currender);%
+ }%
+ var settings={%
+ initialize: function(dialog){%
+ dialog.load({%
+ 'text': res%
+ });%
+ },%
+ description: {%
+ name: '3D' + spc + 'Camera' + spc + 'Settings',%
+ elements: [%
+ {%
+ type: 'static_text',%
+ name: 'Copy' + spc + 'and' + spc + 'paste' + spc +%
+ 'the' + spc + 'following' + spc + 'to' + spc +%
+ 'the' + spc + 'option' + spc + 'list' + spc +%
+ 'of' + spc + spc + '\string\\\string\\includemovie!'%
+ },%
+ {%
+ type: 'edit_text',%
+ item_id: 'text',%
+ alignment: 'align_fill',%
+ multiline: multiln,%
+ char_width: 80,%
+ char_height: charht,%
+ readonly: true%
+ },%
+ {%
+ type: 'ok',%
+ ok_name: 'Close'%
+ }%
+ ]%
+ }%
+ };%
+ app.execDialog(settings);%
+ }catch(e){%
+ var spc=String.fromCharCode(32);%
+ app.alert('Error' + spc + 'while' + spc + 'executing' + spc +%
+ '3Dcalculate:' + spc + e);%
+ }%
+ }%
+ \fi%
+ %create stream from user provided JavaScript file
+ \ifx\@MXV@jscriptiiidfile\@empty\else%
+ \ifthenelse{% create only once
+ \equal{\@MXV@getlabelvalue{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}}{undefined}%
+ }{%
+ \ifpdf%
+ \pdfobj stream file {\@MXV@jscriptiiidfile}%
+ \pdfrefobj\pdflastobj%
+ \edef\@MXV@userjscriptiiidstream{\the\pdflastobj\space 0 R}%
+ \@MXV@newlabel{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}{\the\pdflastobj}%
+ \else%
+ \pdfmark{%
+ pdfmark=/OBJ,%
+ Raw={%
+ /_objdef {linkuserjscriptiiid\the\@MXV@links}%
+ /type/stream%
+ }%
+ }%
+ \pdfmark{%
+ pdfmark=/PUT,%
+ Raw={%
+ {linkuserjscriptiiid\the\@MXV@links}%
+ (\@MXV@jscriptiiidfile) (r) file%
+ }%
+ }%
+ \edef\@MXV@userjscriptiiidstream{%
+ {linkuserjscriptiiid\the\@MXV@links}%
+ }%
+ \@MXV@newlabel{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}%
+ {linkuserjscriptiiid\the\@MXV@links}%
+ \fi%
+ }{%
+ \ifpdf%
+ \edef\@MXV@userjscriptiiidstream{%
+ \@MXV@getlabelvalue{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}\space 0 R%
+ }%
+ \else%
+ \edef\@MXV@userjscriptiiidstream{%
+ {\@MXV@getlabelvalue{\pdfmdfivesum file {\@MXV@jscriptiiidfile}}}%
+ }%
+ \fi%
+ }%
+ \fi%
+ \edef\@MXV@jscriptiiidaction{%
+ /Next <<%
+ /S/JavaScript%
+ /JS (\@MXV@linkjscriptiiid)%
+ \ifx\@MXV@jscriptiiidfile\@empty\else%
+ /Next <<%
+ /S/JavaScript%
+ /JS \@MXV@userjscriptiiidstream% user provided script
+ >>%
+ \fi%
+ >>%
+ }%
+ }{\edef\@MXV@jscriptiiidaction{}}%
+ }{% #### 2D ####
+ \setkeys{MXV@user}{#1}%
+ %retrieve original settings
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.mouse}}{true}}{%
+ \setboolean{@MXV@mouse}{true}%
+ }{%
+ \setboolean{@MXV@mouse}{false}%
+ }%
+ \edef\@MXV@ctrls{\@MXV@getlabelvalue{@MXV@\@MXV@label.showUI}}%
+ \edef\@MXV@palindrome{\@MXV@getlabelvalue{@MXV@\@MXV@label.palindrome}}%
+ \edef\@MXV@repeat{\@MXV@getlabelvalue{@MXV@\@MXV@label.repeat}}%
+ \edef\@MXV@rate{\@MXV@getlabelvalue{@MXV@\@MXV@label.rate}}%
+ \edef\@MXV@startat{\@MXV@getlabelvalue{@MXV@\@MXV@label.startAt}}%
+ \edef\@MXV@endat{\@MXV@getlabelvalue{@MXV@\@MXV@label.endAt}}%
+ \edef\@MXV@volume{\@MXV@getlabelvalue{@MXV@\@MXV@label.volume}}%
+ \if@MXV@linkreset\else%
+ \setkeys{MXV@user}{#1}%override with new settings
+ \fi%
+ %
+ \edef\@MXV@operation{}%
+ %
+ %get the player ID
+ \edef\@MXV@currplayer{\@MXV@getlabelvalue{@MXV@\@MXV@label.playerid}}%
+ %
+ %see whether a sound inclusion is being referenced
+ \ifthenelse{\equal{\@MXV@getlabelvalue{@MXV@\@MXV@label.issound}}{true}}{%
+ \setboolean{@MXV@issound}{true}%
+ }{%
+ \setboolean{@MXV@issound}{false}%
+ }%
+ %
+ %create /OP and /JS entries
+ \if@MXV@linkplay%
+ \edef\@MXV@operation{%
+ /OP 0%
+ /JS (%
+ if(focusonplayer==undefined){%
+ var focusonplayer=0; %shared by all annots
+ }%
+ \@MXV@settings{\@MXV@ctrls}{\@MXV@palindrome}{\@MXV@repeat}%
+ {\@MXV@rate}{\@MXV@startat}{\@MXV@endat}{\@MXV@volume}%
+ \@MXV@events{\@MXV@currplayer}%
+ {\if@MXV@mouse true\else false\fi}%
+ {true}%
+ \if@MXV@requirereopen\else
+ try{%
+ \ifx\@MXV@@startat\@empty
+ player\@MXV@currplayer.seek(%
+ player\@MXV@currplayer.settings.startAt%
+ );
+ \else
+ player\@MXV@currplayer.seek(\@MXV@@startat);
+ \fi
+ player\@MXV@currplayer.play();
+ \ifx\@MXV@@startat\@empty
+ player\@MXV@currplayer.seek(%
+ player\@MXV@currplayer.settings.startAt%
+ );
+ \else
+ player\@MXV@currplayer.seek(\@MXV@@startat);
+ \fi
+ }%
+ catch(e)\@charlb%
+ \fi%
+ try{%
+ if(player\@MXV@currplayer.isOpen){%
+ player\@MXV@currplayer.close(%
+ app.media.closeReason.general);
+ player\@MXV@currplayer=null;
+ }%
+ }%
+ catch(e){}%
+ %
+ try{%
+ var player\@MXV@currplayer=app.media.openPlayer({%
+ settings: settings,%
+ events: events%
+ });%
+ }%
+ catch (e){}%
+ \if@MXV@requirereopen\else
+ \@charrb%
+ \fi%
+ )%
+ }%
+ \fi%
+ \if@MXV@linkresume% resume/pause
+ \edef\@MXV@operation{%
+ /OP 3%
+ /JS (%
+ try{%
+ \if@MXV@issound\else player\@MXV@currplayer.visible=true;\fi%
+ if(!player\@MXV@currplayer.isPlaying){%
+ player\@MXV@currplayer.settings.privateData.paused=false;
+ player\@MXV@currplayer.play();
+ if(!player\@MXV@currplayer.isPlaying){%
+ %media at end will restart from beginning
+ if(
+ player\@MXV@currplayer.settings.startAt.time
+ || player\@MXV@currplayer.settings.startAt.frame
+ || player\@MXV@currplayer.settings.startAt.marker
+ || player\@MXV@currplayer.id ==
+ 'vnd.adobe.swname:AAPL_QuickTime'
+ ){
+ player\@MXV@currplayer.seek(
+ player\@MXV@currplayer.settings.startAt);
+ }else{
+ player\@MXV@currplayer.stop();
+ }
+ player\@MXV@currplayer.play();
+ }%
+ }%
+ else{%
+ player\@MXV@currplayer.pause();
+ player\@MXV@currplayer.settings.privateData.paused=true;
+ }%
+ }%
+ catch(e){% open new player if not yet open
+ if(focusonplayer==undefined){%
+ var focusonplayer=0; %shared by all annots
+ }%
+ \@MXV@settings{\@MXV@ctrls}{\@MXV@palindrome}{\@MXV@repeat}%
+ {\@MXV@rate}{\@MXV@startat}{\@MXV@endat}{\@MXV@volume}%
+ \@MXV@events{\@MXV@currplayer}%
+ {\if@MXV@mouse true\else false\fi}%
+ {true}%
+ try{%
+ var player\@MXV@currplayer=app.media.openPlayer({%
+ settings: settings,%
+ events: events%
+ });
+ }%
+ catch (e){}%
+ }%
+ )%
+ }%
+ \fi%
+ \if@MXV@linkstop%
+ \edef\@MXV@operation{%
+ /OP 1%
+ /JS (%
+ try{%
+ if(!player\@MXV@currplayer.isPlaying){%
+ player\@MXV@currplayer.settings.privateData.paused=false;
+ player\@MXV@currplayer.play();
+ }%
+ player\@MXV@currplayer.stop();
+ if(
+ player\@MXV@currplayer.settings.startAt.time
+ || player\@MXV@currplayer.settings.startAt.frame
+ || player\@MXV@currplayer.settings.startAt.marker
+ || player\@MXV@currplayer.id ==
+ 'vnd.adobe.swname:AAPL_QuickTime'
+ ){
+ player\@MXV@currplayer.seek(%
+ player\@MXV@currplayer.settings.startAt);
+ }
+ }%
+ catch(e){}%
+ )%
+ }%
+ \fi%
+ \if@MXV@linkpause% pause/resume
+ \edef\@MXV@operation{%
+ /OP 2%
+ /JS (%
+ try{%
+ \if@MXV@issound\else player\@MXV@currplayer.visible=true;\fi%
+ if(!player\@MXV@currplayer.isPlaying){%
+ player\@MXV@currplayer.settings.privateData.paused=false;
+ player\@MXV@currplayer.play();
+ if(!player\@MXV@currplayer.isPlaying){%
+ %media at end will restart from beginning
+ if(
+ player\@MXV@currplayer.settings.startAt.time
+ || player\@MXV@currplayer.settings.startAt.frame
+ || player\@MXV@currplayer.settings.startAt.marker
+ || player\@MXV@currplayer.id ==
+ 'vnd.adobe.swname:AAPL_QuickTime'
+ ){
+ player\@MXV@currplayer.seek(
+ player\@MXV@currplayer.settings.startAt);
+ }else{
+ player\@MXV@currplayer.stop();
+ }
+ player\@MXV@currplayer.play();
+ }%
+ }%
+ else{%
+ player\@MXV@currplayer.pause();
+ player\@MXV@currplayer.settings.privateData.paused=true;
+ }%
+ }%
+ catch(e){% open new player if not yet open
+ if(focusonplayer==undefined){%
+ var focusonplayer=0; %shared by all annots
+ }%
+ \@MXV@settings{\@MXV@ctrls}{\@MXV@palindrome}{\@MXV@repeat}%
+ {\@MXV@rate}{\@MXV@startat}{\@MXV@endat}{\@MXV@volume}%
+ \@MXV@events{\@MXV@currplayer}%
+ {\if@MXV@mouse true\else false\fi}%
+ {true}%
+ try{%
+ var player\@MXV@currplayer=app.media.openPlayer({%
+ settings: settings,%
+ events: events%
+ });
+ }%
+ catch (e){}%
+ }%
+ )%
+ }%
+ \fi%
+ \if@MXV@linkclose%
+ \edef\@MXV@operation{%
+ /OP 1%
+ /JS (%
+ try{%
+ player\@MXV@currplayer.close(%
+ app.media.closeReason.general);
+ player\@MXV@currplayer=null;
+ }%
+ catch(e){}%
+ )%
+ }%
+ \fi%
+ }%
+ \fi%
+ \fi%
+ %
+ \ifpdf%
+ \ifthenelse{\isundefined{\@pdfborder}}{%
+ \def\@MXV@linkattr{}%
+ }{%
+ \edef\@MXV@linkattr{%
+ \if@MXV@beamer%
+ \@MXV@pdfborder%
+ \else%
+ /Border [\@pdfborder]%
+ \fi%
+ /C [\@linkbordercolor]%
+ /H \@pdfhighlight%
+ }%
+ }%
+ %
+ \pdfstartlink%
+ attr{\@MXV@linkattr}%
+ user{%
+ /Subtype /Link%
+ /A <<%
+ /S/GoTo%
+ /D (@MXV@\@MXV@@label)%
+ \if@MXV@@draft\else%
+ \if@MXV@externalviewer\else%
+ \if@MXV@iiid%
+ \ifx\@MXV@iiidview\@empty\else%
+ /Next <<%
+ /S/GoTo3DView%
+ /TA \@MXV@getlabelvalue{@MXV@\@MXV@@label.annot}\space 0 R%
+ /V \@MXV@iiidview%
+ \fi%
+ \@MXV@jscriptiiidaction%
+ \ifx\@MXV@iiidview\@empty\else%
+ >>%
+ \fi%
+ \else%
+ /Next <<%
+ /S/Rendition%
+ /R \@MXV@getlabelvalue{@MXV@\@MXV@@label.rendition}\space 0 R%
+ /AN \@MXV@getlabelvalue{@MXV@\@MXV@@label.annot}\space 0 R%
+ \@MXV@operation%
+ >>%
+ \fi%
+ \fi%
+ \fi%
+ >>%
+ }%
+ \usebox{\@MXV@textbox}% write out text box
+ \pdfendlink%
+ \else%
+ \pdfmark[{\usebox{\@MXV@textbox}}]{%
+ pdfmark=/ANN,%
+ Subtype=/Link,%
+ Color=\@linkbordercolor,%
+ AcroHighlight=\@pdfhighlight,%
+ Raw={%
+ \@MXV@pdfborder%
+ /_objdef {linkannot\the\@MXV@links}%
+ /Action <<%
+ /S/GoTo%
+ /D/@MXV@\@MXV@@label%
+ \if@MXV@@draft\else%
+ \if@MXV@externalviewer\else%
+ \if@MXV@iiid%
+ \ifx\@MXV@iiidview\@empty\else%
+ /Next <<%
+ /S/GoTo3DView%
+ /TA {3Dannot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annot}}%
+ /V \@MXV@iiidview%
+ \fi%
+ \@MXV@jscriptiiidaction%
+ \ifx\@MXV@iiidview\@empty\else%
+ >>%
+ \fi%
+ \else%
+ /Next <<%
+ /S /Rendition%
+ /R {mediarendition\@MXV@getlabelvalue{@MXV@\@MXV@@label.annotid}}%
+ /AN {screenannot\@MXV@getlabelvalue{@MXV@\@MXV@@label.annot}}%
+ \@MXV@operation%
+ >>%
+ \fi%
+ \fi%
+ \fi%
+ >>%
+ }%
+ }%
+ \fi%
+ }%
+ }%
+}
+
+%set to true for certain \movieref options, which require the media player to
+%be re-opened
+\newboolean{@MXV@requirereopen}
+
+%standard keys to be processed first
+%key definitions for options to \includemovie
+\define@key{MXV@user}{draft}[true]{%
+ \setboolean{@MXV@@draft}{#1}%
+}
+\define@key{MXV@user}{final}[true]{%
+ \ifthenelse{\equal{#1}{true}}{%
+ \setboolean{@MXV@@draft}{false}%
+ }{%
+ \setboolean{@MXV@@draft}{true}%
+ }%
+}
+\define@key{MXV@user}{label}{%for use with movieref
+ \gdef\@MXV@label{#1}%
+}
+\define@key{MXV@user}{controls}[true]{%
+ \setboolean{@MXV@requirereopen}{true}%
+ \xdef\@MXV@ctrls{, showUI: #1}%
+ \xdef\@MXV@@ctrls{/C #1}%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \gdef\@MXV@iiidtoolb{/TB #1}%
+ }{}%
+}
+\define@key{MXV@user}{toolbar}[true]{%
+ \xdef\@MXV@ctrls{, showUI: #1}%
+ \xdef\@MXV@@ctrls{/C #1}%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \gdef\@MXV@iiidtoolb{/TB #1}%
+ }{}%
+}
+\define@key{MXV@user}{volume}{%
+ \def\@MXV@@volume{/V #1}%
+ \def\@MXV@volume{#1}%
+ \setboolean{@MXV@requirereopen}{true}%
+}
+\define@key{MXV@user}{mimetype}{%
+ \ifthenelse{\equal{#1}{model/u3d}}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \setboolean{@MXV@iiid}{true}%
+ \xdef\@MXV@iiidsubtype{U3D}%
+ }{\@MXV@neediiiD}%
+ }{}%
+ \def\@MXV@mime{#1}%
+}
+\define@key{MXV@user}{playerid}{%
+ \def\@MXV@player{%
+ /PL<</MU [<</PID<</U (vnd.adobe.swname:#1)>>>>]>>%
+ }%
+}
+\define@key{MXV@user}{autoplay}[true]{%
+ \setboolean{@MXV@autoplay}{#1}%
+ \if@MXV@autoplay%
+ \setboolean{@MXV@autoresume}{false}%
+ \fi%
+}
+\define@key{MXV@user}{autostop}[true]{%
+ \setboolean{@MXV@autostop}{#1}%
+ \if@MXV@autostop%
+ \setboolean{@MXV@autopause}{false}%
+ \fi%
+}
+\define@key{MXV@user}{autoresume}[true]{%
+ \setboolean{@MXV@autoresume}{#1}%
+ \if@MXV@autoresume%
+ \setboolean{@MXV@autoplay}{false}%
+ \setboolean{@MXV@autoclose}{false}%
+ \fi%
+}
+\define@key{MXV@user}{autopause}[true]{%
+ \setboolean{@MXV@autopause}{#1}%
+ \if@MXV@autopause%
+ \setboolean{@MXV@autostop}{false}%
+ \setboolean{@MXV@autoclose}{false}%
+ \fi%
+}
+\define@key{MXV@user}{autoclose}[true]{%
+ \setboolean{@MXV@autoclose}{#1}%
+ \if@MXV@autoclose%
+ \setboolean{@MXV@autostop}{false}%
+ \setboolean{@MXV@autopause}{false}%
+ \fi%
+}
+\define@key{MXV@user}{continue}[true]{%
+ \setboolean{@MXV@autostop}{false}%
+ \setboolean{@MXV@autopause}{false}%
+ \setboolean{@MXV@autoclose}{false}%
+}
+\define@key{MXV@user}{open}[true]{%
+ %no longer supported; once open, media remains loaded
+ %to avoid reloading when media is to be played again
+}
+\define@key{MXV@user}{mouse}[true]{%
+ \setboolean{@MXV@mouse}{#1}%
+ \setboolean{@MXV@requirereopen}{true}%
+ \ifthenelse{\equal{false}{#1}\AND\boolean{@MXV@iiiDfeat}}{%
+ \def\@MXV@iiidia{/3DI #1}%
+ }{}%
+}
+\define@key{MXV@user}{palindrome}[true]{%
+ \xdef\@MXV@palindrome{, palindrome: #1}%
+ \setboolean{@MXV@requirereopen}{true}%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \gdef\@MXV@iiidpalindrome{/Subtype/Oscillating}%
+ }{}%
+}
+\define@key{MXV@user}{rate}{%
+ \setboolean{@MXV@requirereopen}{true}%
+ \xdef\@MXV@rate{, rate: #1}%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \gdef\@MXV@iiidrate{/TM #1}%
+ }{}%
+}
+\define@key{MXV@user}{repeat}[Infinity]{%
+ \setboolean{@MXV@requirereopen}{true}%
+ \ifthenelse{%
+ \equal{#1}{Infinity}\OR%
+ \equal{#1}{0}%
+ }{%
+ \xdef\@MXV@repeat{, repeat: Infinity}%
+ \xdef\@MXV@@repeat{/RC 0}%
+ }{%
+ \xdef\@MXV@repeat{, repeat: #1}%
+ \xdef\@MXV@@repeat{/RC #1}%
+ }%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \ifthenelse{\equal{#1}{Infinity}}{%
+ \global\@MXV@iiidrepeat=-1%
+ }{%
+ \global\@MXV@iiidrepeat=#1%
+ }%
+ }{}%
+}
+\define@key{MXV@user}{startat}{%
+ \xdef\@MXV@startat{, startAt: {#1}}%
+ \xdef\@MXV@@startat{{#1}}%
+}
+\define@key{MXV@user}{endat}{%
+ \setboolean{@MXV@requirereopen}{true}%
+ \xdef\@MXV@endat{, endAt: {#1}}%
+}
+\define@key{MXV@user}{poster}[true]{%
+ \ifthenelse{\equal{#1}{true}}{% option without arg
+ \setboolean{@MXV@runposter}{true}%
+ }{%
+ \def\@MXV@box##1##2##3{%
+ \ifpdf%
+ \mbox{\pdfximage width ##1 height ##2 depth ##3 {#1}}%
+ \pdfrefximage\pdflastximage%
+ \else%
+ \ifthenelse{\isundefined{\includegraphics}}{\@MXV@missing{graphics}}{}%
+ \@MXV@totalheight=##2%
+ \advance\@MXV@totalheight by ##3%
+ \raisebox{-##3}[##2][##3]{%
+ \includegraphics[%
+ width=##1,height=##2,totalheight=\@MXV@totalheight,clip]{#1}%
+ }%
+ \fi%
+ }%
+ }%
+}
+\define@key{MXV@user}{externalviewer}[true]{%
+ \setboolean{@MXV@externalviewer}{#1}%
+}
+\define@key{MXV@user}{inline}[true]{%
+ \if@MXV@url%
+ \setboolean{@MXV@inline}{false}%
+ \else%
+ \setboolean{@MXV@inline}{#1}%
+ \fi%
+ \if@MXV@inline\else%
+ \setboolean{@MXV@attachment}{false}%
+ \fi%
+}
+\define@key{MXV@user}{url}[true]{%
+ \setboolean{@MXV@url}{#1}%
+ \if@MXV@url%
+ \setboolean{@MXV@inline}{false}%
+ \setboolean{@MXV@attachment}{false}%
+ \def\@MXV@fsentry{/FS /URL}%
+ \fi%
+}
+\define@key{MXV@user}{attach}[true]{%
+ \setboolean{@MXV@attachment}{#1}%
+ \if@MXV@attachment%
+ \setboolean{@MXV@inline}{true}%
+ \fi%
+}
+\define@key{MXV@user}{text}{%
+ \setboolean{@MXV@boxopt}{true}%
+ \savebox{\@MXV@textbox}{#1}%
+ \@MXV@width=\wd\@MXV@textbox%
+ \@MXV@height=\ht\@MXV@textbox%
+ \@MXV@depth=\dp\@MXV@textbox%
+}
+\define@key{MXV@user}{textoverposter}[true]{%
+ \setboolean{@MXV@textoverposter}{#1}%
+}
+\define@key{MXV@user}{depth}{%set depth of display area
+ \gdef\@MXV@boxdepth{#1}%
+}
+%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}%
+}
+\define@key{MXV@user}{3Djscript}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \IfFileExists{#1}{%
+ \def\@MXV@jscriptiiidfile{#1}%
+ }{%
+ \PackageError{movie15}{Script file `#1' cannot be opened for embedding%
+ }{%
+ Make sure file `#1' exists and is readable!%
+ }%
+ }%
+ }{\@MXV@neediiiD}%
+}
+\define@key{MXV@user}{3Dcoo}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \def\@MXV@coo{#1}%
+ \setboolean{@MXV@defaultviewprovided}{true}%
+ }{\@MXV@neediiiD}%
+}
+\define@key{MXV@user}{3Dc2c}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \def\@MXV@ctoc{#1}%
+ \setboolean{@MXV@defaultviewprovided}{true}%
+ }{\@MXV@neediiiD}%
+}
+\define@key{MXV@user}{3Droo}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \def\@MXV@roo{#1}%
+ \setboolean{@MXV@defaultviewprovided}{true}%
+ }{\@MXV@neediiiD}%
+}
+\define@key{MXV@user}{3Daac}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \def\@MXV@aac{#1}%
+ \setboolean{@MXV@defaultviewprovided}{true}%
+ }{\@MXV@neediiiD}%
+}
+\define@key{MXV@user}{3Droll}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \def\@MXV@roll{#1}%
+ \setboolean{@MXV@defaultviewprovided}{true}%
+ }{\@MXV@neediiiD}%
+}
+\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%
+ }{%
+ Make sure file `#1' exists and is readable!%
+ }%
+ }%
+ }{\@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}%
+}
+%options for \movieref command
+\define@key{MXV@user}{play}[true]{%
+ \setboolean{@MXV@linkplay}{#1}%
+ \if@MXV@linkplay%
+ \setboolean{@MXV@linkpause}{false}%
+ \setboolean{@MXV@linkresume}{false}%
+ \setboolean{@MXV@linkstop}{false}%
+ \setboolean{@MXV@linkclose}{false}%
+ \fi%
+}
+\define@key{MXV@user}{pause}[true]{%
+ \setboolean{@MXV@linkpause}{#1}%
+ \if@MXV@linkpause%
+ \setboolean{@MXV@linkresume}{false}%
+ \setboolean{@MXV@linkstop}{false}%
+ \setboolean{@MXV@linkclose}{false}%
+ \setboolean{@MXV@linkplay}{false}%
+ \fi%
+}
+\define@key{MXV@user}{resume}[true]{%
+ \setboolean{@MXV@linkresume}{#1}%
+ \if@MXV@linkresume%
+ \setboolean{@MXV@linkpause}{false}%
+ \setboolean{@MXV@linkstop}{false}%
+ \setboolean{@MXV@linkclose}{false}%
+ \setboolean{@MXV@linkplay}{false}%
+ \fi%
+}
+\define@key{MXV@user}{stop}[true]{%
+ \setboolean{@MXV@linkstop}{#1}%
+ \if@MXV@linkstop%
+ \setboolean{@MXV@linkpause}{false}%
+ \setboolean{@MXV@linkresume}{false}%
+ \setboolean{@MXV@linkclose}{false}%
+ \setboolean{@MXV@linkplay}{false}%
+ \fi%
+}
+\define@key{MXV@user}{close}[true]{%
+ \setboolean{@MXV@linkclose}{#1}%
+ \if@MXV@linkclose%
+ \setboolean{@MXV@linkpause}{false}%
+ \setboolean{@MXV@linkresume}{false}%
+ \setboolean{@MXV@linkstop}{false}%
+ \setboolean{@MXV@linkplay}{false}%
+ \fi%
+}
+\define@key{MXV@user}{reset}[true]{%
+ \setboolean{@MXV@linkreset}{#1}%
+ \if@MXV@linkreset%
+ \setboolean{@MXV@requirereopen}{true}%
+ \fi%
+}
+\define@key{MXV@user}{default}[true]{% synonyme for `reset'
+ \setboolean{@MXV@linkreset}{#1}%
+ \if@MXV@linkreset%
+ \setboolean{@MXV@requirereopen}{true}%
+ \fi%
+}
+\define@key{MXV@user}{3Dviewindex}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \ifthenelse{%
+ \equal{#1}{F}%
+ \OR\equal{#1}{L}%
+ \OR\equal{#1}{N}%
+ \OR\equal{#1}{P}%
+ \OR\equal{#1}{D}%
+ }{%
+ \gdef\@MXV@iiidview{/#1}% any of F, L, N, P, D
+ }{%
+ \gdef\@MXV@iiidview{#1}% number (index)
+ }%
+ \setboolean{@MXV@defaultviewprovided}{false}%
+ }{\@MXV@neediiiD}%
+}
+\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}%
+ }{\@MXV@neediiiD}%
+}
+\define@key{MXV@user}{3Dgetview}[true]{%
+ %print current 3D camera settings
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \setboolean{@MXV@iiidgetview}{#1}%
+ }{\@MXV@neediiiD}%
+}
+\define@key{MXV@user}{3Dresource}{%
+ \ifthenelse{\boolean{@MXV@iiiDfeat}}{%
+ \IfFileExists{#1}{%
+ \setboolean{@MXV@resource}{true}%
+ \xdef\@MXV@iiidopt{3Dresource=#1, \@MXV@iiidopt}%
+ }{%
+ \PackageError{movie15}{3D resource file `#1' cannot be opened%
+ }{%
+ Make sure file `#1' exists and is readable!%
+ }%
+ }%
+ }{\@MXV@neediiiD}%
+}
+
+%compatibility options for \movie and \hyperlinkmovie commands
+\define@key{MXV@user}{borderwidth}{%
+ %ignored; acroread doesn't draw borders around screen annots anyway
+}
+\define@key{MXV@user}{height}{%set height of display area
+ \gdef\@MXV@boxheight{#1}%
+}
+\define@key{MXV@user}{width}{%set width of display area
+ \gdef\@MXV@boxwidth{#1}%
+}
+\define@key{MXV@user}{autostart}[true]{%
+ \xdef\@MXV@autostart{, autoplay=#1}%
+}
+\define@key{MXV@user}{loop}[Infinity]{%
+ \xdef\@MXV@loop{, repeat=#1}%
+}
+\define@key{MXV@user}{once}[]{%
+ \xdef\@MXV@loop{, repeat=1}%
+}
+\define@key{MXV@user}{showcontrols}[true]{%
+ \xdef\@MXV@showcontrols{, controls=#1}%
+}
+\define@key{MXV@user}{start}{%
+ \gdef\@MXV@starttime##1s{%
+ \global\@MXV@start=##1pt%
+ }%
+ \@MXV@starttime #1%
+}
+\define@key{MXV@user}{duration}{%
+ \gdef\@MXV@durationtime##1s{%
+ \global\@MXV@end=##1pt%
+ }%
+ \@MXV@durationtime #1%
+}
+
+%options to be passed to internal macro \@MXV@includeiiid
+\define@key{MXV@iiid}{3Dresource}{%
+ \@MXV@addresource{#1}%
+}
+
+%compatibility macros
+\providecommand\movie[3][]{%
+ \leavevmode%
+ \@MXV@reset%
+ \def\@MXV@autostart{}\def\@MXV@loop{}\def\@MXV@showcontrols{}%
+ \def\@MXV@starttime{}\def\@MXV@durationtime{}%
+ \setkeys{MXV@user}{#1}%
+ %
+ %sanity checks
+ \if@MXV@boxopt%
+ \PackageError{movie15}{%
+ Option `text' cannot be used with command `\string\movie'.\MessageBreak
+ Instead, put text into the 1st argument of `\string\movie'
+ }{}%
+ \fi%
+ %
+ \ifx\@MXV@durationtime\@empty\else\ifx\@MXV@startat\@empty\else%
+ \PackageError{movie15}{%
+ Options `startat' and `duration' cannot be used\MessageBreak
+ together.\MessageBreak
+ Possible combinations are `startat'/`endat',\MessageBreak
+ `start'/`endat' or `start'/`duration'
+ }{}%
+ \fi\fi%
+ %
+ %option list
+ \edef\@MXV@movieoptions{#1\@MXV@autostart\@MXV@loop\@MXV@showcontrols}%
+ %
+ %determine playback section
+ \ifx\@MXV@starttime\@empty\else%
+ \edef\@MXV@movieoptions{\@MXV@movieoptions, %
+ startat=time:\strip@pt\@MXV@start}%
+ \fi%
+ \ifx\@MXV@durationtime\@empty\else%
+ \advance\@MXV@end by \@MXV@start%
+ \edef\@MXV@movieoptions{\@MXV@movieoptions, %
+ endat=time:\strip@pt\@MXV@end}%
+ \fi%
+ %
+ %text option from 2nd argument
+ \savebox{\@MXV@textbox}{#2}%
+ \edef\@MXV@movieoptions{[\@MXV@movieoptions, text={\noexpand\usebox{%
+ \noexpand\@MXV@textbox}}]}%
+ \expandafter%
+ \includemovie\@MXV@movieoptions{\@MXV@boxwidth}{\@MXV@boxheight}{#3}%
+}
+
+\newcommand\hyperlinkmovie[3][]{%
+ \leavevmode%
+ \@MXV@reset%
+ \def\@MXV@autostart{}\def\@MXV@loop{}\def\@MXV@showcontrols{}%
+ \def\@MXV@starttime{}\def\@MXV@durationtime{}%
+ \setkeys{MXV@user}{#1}%
+ %
+ %sanity check
+ \ifx\@MXV@durationtime\@empty\else\ifx\@MXV@startat\@empty\else%
+ \PackageError{movie15}{%
+ Options `startat' and `duration' cannot be used\MessageBreak
+ together.\MessageBreak
+ Possible combinations are `startat'/`endat',\MessageBreak
+ `start'/`endat' or `start'/`duration'
+ }{}%
+ \fi\fi%
+ %
+ %option list
+ \edef\@MXV@movieoptions{#1\@MXV@autostart\@MXV@loop\@MXV@showcontrols}%
+ %
+ %determine playback section
+ \ifx\@MXV@starttime\@empty\else%
+ \edef\@MXV@movieoptions{\@MXV@movieoptions, %
+ startat=time:\strip@pt\@MXV@start}%
+ \fi%
+ \ifx\@MXV@durationtime\@empty\else%
+ \advance\@MXV@end by \@MXV@start%
+ \edef\@MXV@movieoptions{\@MXV@movieoptions, %
+ endat=time:\strip@pt\@MXV@end}%
+ \fi%
+ %
+ \edef\@MXV@movieoptions{[\@MXV@movieoptions]}%
+ \expandafter\movieref\@MXV@movieoptions{#2}{#3}%
+}