1

I am making a mesh of Games of Thrones video for 360 video, motivated by Zuckerberg's video today about GoT where you can move mouse 360 in the beginning, in Matlab. I am thinking where to show the output. I can generate any format from the code but not sure if the user interaction can be hold in any beamer's output formats, as I can understand in the discussion here about Beamer and JavaScript in a web browser.

I would like to embed such a 360 mouse control in my beamer presentation, stub here, for instance, in any format. HTML is sufficient and can be done with Beamer (here). There may be some elements missing in Beamer which does not allow the user interaction. In such a case, I would like to understand what.

Example of Mark's 360 GoT video

enter image description here

Pseudocode

%% Sources
% https://tex.stackexchange.com/q/98446/13173 for 2D animation
\documentclass{article}

\usepackage{pgfplots}
\usetikzlibrary{ocgx}
\tikzset{ocg button/.style={circle,inner sep=.25em,switch ocg with mark on={#1}{}}}
\tikzset{base/.style={baseline=-0.5ex}}

\newcommand{\function}{x ...}
\newcommand{\buttonUp}[2]{\tikz[base]\node[fill=#2!30,ocg button=#1]{};}
\newcommand{\buttonDown}[2]{\tikz[base]\node[fill=#2!30,ocg button=#2]{};}
\newcommand{\buttonLeft}[2]{\tikz[base]\node[fill=#2!30,ocg button=#3]{};}
\newcommand{\buttonRight}[2]{\tikz[base]\node[fill=#2!30,ocg button=#4]{};}

\begin{document}
\begin{minipage}[b][0.5\textheight][c]{0.2\textwidth}
...
\end{minipage}%

\end{document}

Planning Document

  • Is Flash Flex sufficient?
  • I like Java API. How well does Java Flex compare to it?
  • Blender. [JohannesB]

2D Mesh and viewer on .tex Document

  • Data. Panorama.
  • Package. animate.
  • Stepping by 1°. This would require only 180 frames, keeping PDF size small.

3D Mesh and Viewer on .tex Document

  • Data. 3D Panorama. I think this can be only a picture. How to get/make such a data?
  • Package. animate.
  • Stepping by 10°. This would require only 36x18=648 frames, not expanding PDF size.

Thread about making the datatype here in Stackoverflow. [AlexG] The azimuth has a range of 0° to 360° while elevation ranges from -90° to +90° for a sphere and from 0° to +90° for the northern hemisphere. With 10° stepping in both coordinates this makes 36x18 for the whole sphere and 36x9 for the hemisphere. ASCII example of equispaced font where 9 (=18/2) panorama pictures of the hemisphere on top of each other for each angle; everything can be in one picture

1 2 3 4 ... 34 35 36
___2D-panorama #1__ 1
___2D-panorama #2__ 2
________etc________ 3
___________________ 4
___________________ ...
___________________ 8
___2D-panorama_ #9_ 9

Viewer's metadata

  • stepping angle
  • projection algorithm without loosing data
  • .png lossless compression

How can you have mouse control of video element in Beamer?

  • 3
    Honestly, as far as i am cocerned, this question could might as well be asking how to dig holes in your garden with an unplugged electrical chainsaw. Apart from the fact, that you could use the blade for shoveling, or attach some small spade using cable binders, using a real shovel seems to be the sane approach here. – Johannes_B Apr 24 '16 at 12:49
  • The chance of actually starting it while digging is much too high. Ever moved a running chainsaw into the dirt? Don't. The result is not funny. Dids: Do not try this at home. – Johannes_B Apr 24 '16 at 12:56
  • 4
    As i said, i think using a pdf with flash is the wrong approach. A penguin is a good swimmer and you can mount wings on it and make it fly but ... the result might not be satisfactory. – Johannes_B Apr 24 '16 at 13:52
  • 1
    @Johannes_B What's wrong with flash? It allows for more complex interactivity within html and can do so within PDF. Its documentation is public. Everyone can write players/plugins/VMs. – AlexG May 17 '16 at 08:26
  • 1
    You can use Flex to program Flash applications and embed them with the media9 package as demonstrated here: http://tex.stackexchange.com/a/98686 . Yet, I must admit that it may be a huge task to build a 3D scene viewer that way. – AlexG May 17 '16 at 12:40
  • I really don't know how to start such a project. Maybe there is some Flash solution already available on the Web? – AlexG May 17 '16 at 12:48
  • 3
    Perhaps it would be more constructive to ask @Johannes_B where shovels are to be had or which kind of shovel would be best for hole-digging in the relevant type of garden soil? – cfr May 17 '16 at 13:59
  • 2
    If i have understand it correctly, TeX (and so LaTeX) are (mainly) for typesetting static text, the pdf format allows stuff like Flash thingies to be included in pdf. In my point of view, that does not mean that LaTeX (just because it can generate a pdf) is also the tool to generate something flashy interactive like a video. – Johannes_B May 17 '16 at 16:03
  • Unforetunately, i don't know how to generate a video (or what the goal here is). – Johannes_B May 17 '16 at 16:03
  • 3
    I would certainly have a look at Blender though, those guys from the Blender community can do miracles – Johannes_B May 17 '16 at 16:03

1 Answers1

3

A simple panorama viewer for panoramic images with a fixed z-axis can be built using the animate package. (AR required.)

The example uses a 360° image downloaded here.

Clicking the buttons changes the view by 10°, [shift]+click by 1°.

\documentclass{standalone}
\usepackage{animate}
\usepackage{media9}
\usepackage{MnSymbol}
\usepackage{graphicx}
\usepackage{xsavebox}

\begin{document}
\xsavebox{PanoramaImg}{\includegraphics[width=\linewidth]{potw1130a}}%
\xsavebox{PanoramaImg}{\thePanoramaImg\thePanoramaImg}%
\raisebox{-0.5\height}{\mediabutton[
  jsaction={
    var frm=anim['myPanorama'].frameNum;
    if(event.shift) frm--;
    else frm-=10;
    if(frm<0) frm+=360;
    anim['myPanorama'].frameNum=frm;
  }
]{\Huge$\triangleleft$}}%
\raisebox{-0.5\height}{%
  \begin{animateinline}[label=myPanorama,step,nomouse]{1}
    \multiframe{360}{dStep=0pt+\dimexpr\linewidth/360\relax}{
      \makebox[1.78\height][l]{\hspace{-\dStep}\makebox[0pt][l]{\thePanoramaImg}}
    }
  \end{animateinline}%
}%
\raisebox{-0.5\height}{\mediabutton[
  jsaction={
    var frm=anim['myPanorama'].frameNum;
    if(event.shift) frm++;
    else frm+=10;
    frm\%=360;
    anim['myPanorama'].frameNum=frm;
  }
]{\Huge$\triangleright$}}%
\end{document}
AlexG
  • 54,894
  • 1
    @Masi : Acrobat Reader – AlexG May 18 '16 at 08:51
  • 1
    @Masi : The next problematic step would be the projection of the spherical data onto the rectangular viewport. This is beyond animate, I am afraid. For animate, you need a fixed set of pre-fabricated frames to choose from (with the arrow keys). – AlexG May 18 '16 at 10:24
  • 1
    @Masi: For example: If you restrict yourself to one hemisphere and you want to be able to freely step by 1° in azimuthal and in polar directions each. With animate this would require a total of 360x180=64800 pre-built frames, since we cannot do projection on the fly. – AlexG May 18 '16 at 10:44
  • 1
    @Masi : No, I don't have any such data. Maybe stepping by 10° would be sufficient and would require only 36x18=648 frames. This could be manageable without the PDF to explode in size. – AlexG May 18 '16 at 11:09
  • @Masi : I really don't know in which format such (photographic?) data are usually distributed. As I said, a matrix of 36x18 projections (=648 individual image files) of such data on a rectangular area would be required. – AlexG May 18 '16 at 11:31
  • 1
    @Masi : Looks ok. Actually, we only need 9 rows for a hemisphere with 10° stepping ;-) . Perhaps a single large image containing the view matrix could be handled more easily. – AlexG May 19 '16 at 12:51
  • 1
    @Masi : The azimuth has a range of 0° to 360° while elevation ranges from -90° to +90° for a sphere and from 0° to +90° for the northern hemisphere. With 10° stepping in both coordinates this makes 36x18 for the whole sphere and 36x9 for the hemisphere. – AlexG May 19 '16 at 13:05