summaryrefslogtreecommitdiff
path: root/texmf-dist/source/latex/rmannot/examples/rm3da/tst_rm3da.tex
blob: 8f7a90d726e56b31176f600648620d4fe85ea7c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
\documentclass{article}
\usepackage{amsmath}
%
% the driver line is not necessary if you
% have aebpro.cfg configured to your driver.
%
\usepackage[%
%    driver=dvips,
    web={pro,tight,usesf,designv},
    eforms,graphicxsp={showembeds},aebxmp
]{aeb_pro}
\usepackage[use3D]{rmannot}
\usepackage{eforms}

% Alexander Grahn a.grahn@web.de

%\margins{1in}{1in}{.5in}{.5in} % left,right,top, bottom
%\screensize{11in}{8.5in}       % height,width dimensions

\DeclareDocInfo
{
    title=The \texttt{rmannot} Package\texorpdfstring{\\[1ex]}{: } Demo of 3D and RMA,
    author=D. P. Story,
    university=Acro\negthinspace\TeX.Net,
    email=dpstory@acrotex.net,
    subject={Demo of the rmannot package, 3D and RMA},
    keywords={Adobe Acrobat, RMA, 3D},
    talksite=\url{http://www.acrotex.net},
    talkdate={Dec 2011},
    copyrightStatus=True,
    copyrightNotice={Copyright (C) \the\year, D. P. Story},
    copyrightInfoURL=http://www.acrotex.net
}
\talkdateLabel{Published:}

\def\AcroTeX{Acro\!\TeX}

% Place \AcroVer{11} in rmannot.cfg, or uncomment line below
%\AcroVer{Beta}
% The argument corresponds to the version of Acrobat you have

%
% Convenience command pointing to the rich media files, this needs
% to be edited to point to its location on your system.
%
\definePath{\myPath}{C:/Users/Public/Documents/%
    My TeX Files/tex/latex/aeb/aebpro/rmannot/%
    examples/rm3da}
\definePath{\myRMFiles}{%
    C:/Users/Public/Documents/My TeX Files/%
    tex/latex/aeb/aebpro/rmannot/RMfiles}
\saveNamedPath{myDice}{\myPath/3dmodels/dice.u3d}
\saveNamedPath{turntableJS}{\myPath/js/turntable.js}
\saveNamedPath{AcroAd}{\myRMFiles/Acro_Advertiser.swf}

\newcommand{\cs}[1]{\texttt{\char`\\#1}}

\parindent=0pt\parskip6pt\pagestyle{empty}

\begin{document}
\begin{center}\large\bfseries
RMA and 3D Annotations
\end{center}
Using the 3D feature of \textsf{rmannot}, you can not only embed 3D
models, such as \texttt{dice.u3d}, as distributed with the
\textsf{movie15} package (author, Alexander Grahn), but you can bind SWF
applications to the background, foreground, or to a material.

%--------------

\setRmOptions3D{my3DDice}{%
    3DOptions={%
        3Droo=40,
        3Dlights=CAD,
        3Drender=Solid,
        3Djscript=turntableJS,
%        3Dbg=1 0 0,
        3Dviews=views/dice.vws,
   },%
   3DResources={%
        background={rName=AcroAd}
%        foreground={rName=AcroAd}
   }%
}

% Comment out the background line, and uncomment the foreground line and
% recompile. Try viewing in a window and in fullscreen. You can see that you
% can manipulate the dice through the foreground SWF, swave!

\begin{center}
\rmAnnot[name=my3DDice,toolbar]{.67\textwidth}{2in}{myDice}
\end{center}
The following two button illustrates how to control the view. Two methods
are used, the left button uses the GoTo3DView action, the one uses the
method \texttt{setView()}, available through the 3D JS engine.

\newcommand{\gotoNamedView}[2]{%
\JS{var rm=this.getAnnotRichMedia(this.pageNum,"#1");\r
    rm.activated=true;}\Next{%
    /S/GoTo3DView/TA \RefObjRm{#1}/V (#2)}%
}
\makebox[\linewidth][c]{%
    \pushButton[\CA{Front View}\TU{Uses GoTo3DView action}
        \A{\gotoNamedView{my3DDice}{Front View}}]{frontView1}{}{11bp}\kern1bp
    \pushButton[\CA{Front View}\TU{Uses setView from 3D JS engine}\A{\JS{%
        var rm=this.getAnnotRichMedia(this.pageNum,"my3DDice");\r
        rm.activated=true;\r
        if (rm.subtype=="3D") {\r\t
            var c3d=rm.context3D;\r\t
            c3d.runtime.setView("Front View", true);\r
        }
    }}]{frontView2}{}{11bp}%
}
One significant difference in dealing with RM3D annotations, it that the
annotation is a rich media annotation not a 3D annotation. This is seen in
some of the code of the buttons, where we say, for example,
\begin{verbatim}
    var rm=this.getAnnotRichMedia(this.pageNum,"my3DDice");
\end{verbatim}
that is, we use \texttt{Doc.getAnnotRichMedia} (or \texttt{Doc.getAnnotsRichMedia})
instead of the 3D method of \texttt{Doc.getAnnot3D} (or \texttt{Doc.getAnnots3D}).


\end{document}