diff options
author | Karl Berry <karl@freefriends.org> | 2006-08-18 23:35:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-08-18 23:35:58 +0000 |
commit | 87db3bff624ea61d6317321a423aa3093fa320b8 (patch) | |
tree | 39cee3a48d33cb6ec4233429137eae03275abb47 /Master/texmf-dist/doc/latex/movie15 | |
parent | 1f37334503f1abac4e6f8b3a3b4af1dce55cc967 (diff) |
movei15 update (16aug06)
git-svn-id: svn://tug.org/texlive/trunk@1980 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/movie15')
-rw-r--r-- | Master/texmf-dist/doc/latex/movie15/dice.js | 144 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/movie15/dice.vws | 14 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/movie15/movie15.pdf | bin | 248565 -> 249626 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/movie15/movie15.tex | 15 |
4 files changed, 108 insertions, 65 deletions
diff --git a/Master/texmf-dist/doc/latex/movie15/dice.js b/Master/texmf-dist/doc/latex/movie15/dice.js index 0b752c53b59..e5561194c32 100644 --- a/Master/texmf-dist/doc/latex/movie15/dice.js +++ b/Master/texmf-dist/doc/latex/movie15/dice.js @@ -1,56 +1,98 @@ +////////////////////////// +// add our own lights +////////////////////////// //first remove any scene lights -var lightIndex = scene.lights.count - 1; -for (; lightIndex >= 0; lightIndex--) -{ - scene.lights.removeByIndex(lightIndex); +for (var i = scene.lights.count - 1; i >= 0; i--) { + scene.lights.removeByIndex(i); } -////set background color -//changer = new RenderEventHandler(); -//changer.onEvent = function(event) -//{ -// event.canvas.background.setColor(new Color(1,1,1)); -//} -//runtime.addEventHandler(changer); - -//add our own lighting -lights = new Object(); -lights.init = function() -{ - //from left - l1 = scene.createLight(); - l1.color.set3(1,1,1); - l1.brightness = .4; - l1.direction.set3(1,0,0); //NB: direction, not source! - - //from right - l2 = scene.createLight(); - l2.color.set3(1,1,1); - l2.brightness = .4; - l2.direction.set3(-1,0,0); - - //from bottom - l3 = scene.createLight(); - l3.color.set3(1,1,1); - l3.brightness = .4; - l3.direction.set3(0,0,1); - - //from top - l4 = scene.createLight(); - l4.color.set3(1,1,1); - l4.brightness = .4; - l4.direction.set3(0,0,-1); - - //from front - l5 = scene.createLight(); - l5.color.set3(1,1,1); - l5.brightness = .4; - l5.direction.set3(0,1,0); - - //from back - l6 = scene.createLight(); - l6.color.set3(1,1,1); - l6.brightness = .4; - l6.direction.set3(0,-1,0); +lights = new Object(); +lights.init = function() { + //from left + l1 = scene.createLight(); + l1.color.set3(1,1,1); + l1.brightness = .4; + l1.direction.set3(1,0,0); //NB: direction, not source! + + //from right + l2 = scene.createLight(); + l2.color.set3(1,1,1); + l2.brightness = .4; + l2.direction.set3(-1,0,0); + + //from bottom + l3 = scene.createLight(); + l3.color.set3(1,1,1); + l3.brightness = .4; + l3.direction.set3(0,0,1); + + //from top + l4 = scene.createLight(); + l4.color.set3(1,1,1); + l4.brightness = .4; + l4.direction.set3(0,0,-1); + + //from front + l5 = scene.createLight(); + l5.color.set3(1,1,1); + l5.brightness = .4; + l5.direction.set3(0,1,0); + + //from back + l6 = scene.createLight(); + l6.color.set3(1,1,1); + l6.brightness = .4; + l6.direction.set3(0,-1,0); } + lights.init(); + +//////////////////////////////////////////////////////////////////////// +// get rid of Gimbal rotation; as a result the z-axis will always be up; +// this part of the script should work off the shelf with _any_ 3D model +//////////////////////////////////////////////////////////////////////// +var max_theta = 88; // maximum pitch (degrees from horizontal) of the camera +var sin_max_theta = Math.sin(max_theta * Math.PI/180); +var tan_max_theta = Math.tan(max_theta * Math.PI/180); + +mouseEventHandler = new MouseEventHandler(); +mouseEventHandler.onMouseMove = true; +mouseEventHandler.onEvent = function(event) { + if(event.currentTool == runtime.TOOL_NAME_ROTATE) { + var camera = scene.cameras.getByIndex(0); + var c2c = camera.position.subtract(camera.targetPosition); + var roo = c2c.length; + + try { + var sin_theta = c2c.z / roo; + if(sin_theta == 1) {//top view + c2c.z = roo * sin_max_theta; + c2c.y = -c2c.z / tan_max_theta; + c2c.x = 0 + } + else if(sin_theta == -1) {//bottom view + c2c.z = -roo * sin_max_theta; + c2c.y = c2c.z / tan_max_theta; + c2c.x = 0 + } + else if(sin_max_theta < sin_theta){//camera too high + c2c.z = Math.sqrt(c2c.x * c2c.x + c2c.y * c2c.y) * tan_max_theta; + c2c.normalize(); + c2c.scaleInPlace(roo); + } + else if(sin_theta < -sin_max_theta){//camera too low + c2c.z = -Math.sqrt(c2c.x * c2c.x + c2c.y * c2c.y) * tan_max_theta; + c2c.normalize(); + c2c.scaleInPlace(roo); + } + + //corrected camera position + camera.position.set(camera.targetPosition.add(c2c)); + } + catch(e) {} + + camera.roll=0; //z-axis always up + } +} + +runtime.addEventHandler(mouseEventHandler); diff --git a/Master/texmf-dist/doc/latex/movie15/dice.vws b/Master/texmf-dist/doc/latex/movie15/dice.vws index 96894f51dd4..06a7e496061 100644 --- a/Master/texmf-dist/doc/latex/movie15/dice.vws +++ b/Master/texmf-dist/doc/latex/movie15/dice.vws @@ -1,7 +1,7 @@ -[Front]{0 0 0}{0 -1 0}{28}{30} -[Back]{0 0 0}{0 1 0}{28}{30} -[Left]{0 0 0}{-1 0 0}{28}{30} -[Right]{0 0 0}{1 0 0}{28}{30} -[Top]{0 0 0}{0 0 1}{28}{30} -[Bottom]{0 0 0}{0 0 -1}{28}{30} -[Fish Eye at Centre]{0 0 0}{0 -1 0}{0.00001}{130} +[Front]{}{0 -1 0}{27}{}% using defaults coo=0 0 0 (arg #2) and aac=30 (arg #5) +[Back]{}{0 1 0}{27}{} +[Left]{}{-1 0 0}{27}{} +[Right]{}{1 0 0}{27}{} +[Top]{}{0 0 1}{27}{} +[Bottom]{}{0 0 -1}{27}{} +[Fish Eye at Centre]{}{0 -1 0}{}{130}% using defaults coo=0 0 0 (arg #2) and roo=0 (arg #4) diff --git a/Master/texmf-dist/doc/latex/movie15/movie15.pdf b/Master/texmf-dist/doc/latex/movie15/movie15.pdf Binary files differindex ab049fb499a..3b4afa9dacc 100644 --- a/Master/texmf-dist/doc/latex/movie15/movie15.pdf +++ b/Master/texmf-dist/doc/latex/movie15/movie15.pdf diff --git a/Master/texmf-dist/doc/latex/movie15/movie15.tex b/Master/texmf-dist/doc/latex/movie15/movie15.tex index 20b5c3ab5ff..b81e6e07f3b 100644 --- a/Master/texmf-dist/doc/latex/movie15/movie15.tex +++ b/Master/texmf-dist/doc/latex/movie15/movie15.tex @@ -255,7 +255,7 @@ are allowed. \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 immovable 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!) +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 gradually increase the radius $ROO$ from \LaTeX{} run to \LaTeX{} run until the object or group of objects can be fully seen in the viewport. Since the object size in terms of world coordinate units may differ in orders of magnitude between U3D files, the optimal `\verb+3Droo+' setting might be found by experimenting with a series of geometrically increasing numbers, such as 1, 10, 100, 1000, 10000 etc. to get a rough approximation and by subsequent fine tuning using smaller changes. @@ -270,7 +270,7 @@ Instead of or in addition to the default view, further \emph{named views} can be \begin{verbatim} [<name>]{<coo_x> <coo_y> <coo_z>}{<c2c_x> <c2c_y> <c2c_z>}{<roo>}{<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>+ and \verb+<aac>+ the same rules as for the corresponding options `\verb+3Dcoo+', `\verb+3Dc2c+', `\verb+3Droo+' and `\verb+3Daac+' apply. 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. +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>+ and \verb+<aac>+ the same rules as for the corresponding options `\verb+3Dcoo+', `\verb+3Dc2c+', `\verb+3Droo+' 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. \begin{verbatim} 3Dbg=<r> <g> <b> @@ -438,7 +438,7 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda \begin{minipage}{0.5\linewidth} \begin{center} \includemovie[poster, label=alien, text=(AlienSong.mpg), url, playerid=AAPL_QuickTime, repeat]{\linewidth}{.75\linewidth}{http://www.linux-video.net/Samples/Mpeg1/AlienSong.mpg}\\ - %\includemovie[poster, label=alien, text=(AlienSong.mpg), playerid=AAPL_QuickTime, repeat]{\linewidth}{.75\linewidth}{AlienSong.mpg}\\ +% \includemovie[poster, label=alien, text=(AlienSong.mpg), playerid=AAPL_QuickTime, repeat]{\linewidth}{.75\linewidth}{AlienSong.mpg}\\ \movieref[rate=0.5]{alien}{Slow}\hfill \movieref{alien}{Normal}\hfill \movieref[rate=2]{alien}{Fast}\hfill @@ -446,7 +446,7 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda \end{center} \end{minipage} -\item\label{ex3d} Embedded U3D file. It is based on a VRML model by Peter Whitehouse \href{mailto:pwhitehouse@optusnet.com.au}{\tt <pwhitehouse@optusnet.com.au>}. Conversion to U3D has been made with DeepExploration\textsuperscript{\scriptsize\textregistered}\cite{dexp}. A file `{\tt dice.vws}' that provides additional views and a JavaScript `{\tt dice.js}' defining light sources have been associated with the 3D object. +\item\label{ex3d} Embedded U3D file. It is based on a VRML model by Peter Whitehouse \href{mailto:pwhitehouse@optusnet.com.au}{\tt <pwhitehouse@optusnet.com.au>}. Conversion to U3D has been made with DeepExploration\textsuperscript{\scriptsize\textregistered}\cite{dexp}. The file `{\tt dice.vws}' provides additional views to be selected from the 3D toolbar or by right click. The JavaScript `{\tt dice.js}' defines light sources and disables the annoying Gimbal rotation mode. \begin{minipage}{0.5\linewidth} {\tt% @@ -454,7 +454,7 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda \phantom{xx}poster,\\ \phantom{xx}label=dice,\\ \phantom{xx}text=(dice.u3d),\\ - \phantom{xx}3Droo=28,\\ + \phantom{xx}3Droo=27,\\ \phantom{xx}3Dc2c=1 -1 1,\\ \phantom{xx}3Dbg=1 1 1,\\ \phantom{xx}3Dviews=dice.vws,\\ @@ -478,11 +478,12 @@ The duration of the media segment to be played. The trailing `\verb+s+' is manda poster, label=dice, text=(dice.u3d), - 3Droo=28, + 3Droo=27, 3Dc2c=1 -1 1, 3Dbg=1 1 1, 3Dviews=dice.vws, - 3Djscript=dice.js]{\linewidth}{\linewidth}{dice.u3d} + 3Djscript=dice.js + ]{\linewidth}{\linewidth}{dice.u3d} \end{center} \movieref[3Dviewindex=N]{dice}{Click here} to cycle through the list of additional views. \movieref[3Dcalculate=60]{dice}{This link} calculates 3D option settings for a 60\textdegree{} aperture angle of the virtual camera. \end{minipage} |