
プレゼンテーションで 3D ビューを切り替えたいのですが、movie15 パッケージで次のコマンドでそれが可能であると読みました: (movie15.pdf の 16 ページのサイコロの例)
\movieref[3Dviewindex=N]{dice}{Click here}
しかし、この場合、マウスでボタンをクリックする必要があります。コマンドをキーにバインドしたり、キーを介してボタンを呼び出したり、これをコマンド \pause と組み合わせたりすることは可能ですか?
よろしくお願いいたします。
グランデマン。
答え1
まず、movie15
もう使用しないでください。パッケージはmedia9
交換用です。
PDF機能を利用すると、サブページナビゲーションGoTo3DView
アクションを左 <-- および右 -->キーボードのキー押下イベント。一連のアクションをすべて実行した後にのみ、リーダーは次の/前のドキュメント ページに進みます。
この機能を使用するには、全画面表示モード。
以下のコードは、\ThreeDPresSteps
コンマで区切られたペアのリストを{<3D label>,<number of views>}
引数として受け取るコマンドを定義します。(ペアが 1 つの場合でも、ペアを囲む中括弧は必須です。)
\ThreeDPresSteps{...}
3D オブジェクトを含むフレームのコードの前に使用しますbeamer
。コマンドによって参照される 3D オブジェクトのビューは、ビュー ファイルで指定された順序と<3D label>
コマンド引数の順序で処理されます。
覚えておいてください左矢印と右矢印キーを使用すると、ページ内のプレゼンテーション ステップ間を両方向に移動できます。その他の矢印キーと PgUp/PgDn キーは、前方向にのみ移動します (Linux の場合は AR-9)。
...
% initialise 3D presentation steps for the next frame
\ThreeDPresSteps{{3DobjA,7},{3DobjB,5}}
\begin{frame}{...}
\includemedia[label=3DobjA,3Dviews=3DviewsA.txt,...]{...}{...}
\includemedia[label=3DobjB,3Dviews=3DviewsB.txt,...]{...}{...}
\end{frame}
% clear 3D presentation steps before next frame
\ThreeDPresStepsReset
...
最小限の例2つの3Dオブジェクト(2 xdice.u3d
) をビーマーフレームで表示します。
\documentclass{beamer}
\usepackage{media9}[2015/11/02]
%write file with 7 predefined 3D views
\usepackage{filecontents}
\begin{filecontents*}{3Dviews.txt}
VIEW=Front
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=Bottom
ROO=27
C2C=0 0 -1
END
VIEW=Fish Eye at Centre
AAC=130
END
\end{filecontents*}
\ExplSyntaxOn
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% command to build presentation steps for navigating through 3D views
% Argument: comma separated list of {label,number of views} pairs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\ThreeDPresSteps[1]{
\tl_set:Nn\l_initactn_tl{}
\clist_map_inline:nn{#1}{\tl_if_exist:cT{ann@\clist_item:nn{##1}{1}}{
\pbs_pdfobj:nnn{}{dict}{ %init. actions for all 3D objects -> goto 1st view
/S/GoTo3DView/V~0/TA~\use:c{ann@\clist_item:nn{##1}{1}}
}
\tl_put_right:Nx\l_initactn_tl{~\pbs_pdflastobj:}
}}
\pbs_pdfobj:nnn{}{dict}{} %reserve pdf obj for the `Next' nav. node
\tl_set:Nx\l_nextnode_tl{\pbs_pdflastobj:}
%primary nav. node, initialise all 3D objects in the page
\pbs_pdfobj:nnn{}{dict}{
/NA<</S/Named/N/NOP/Next[\l_initactn_tl]>>/Next~\l_nextnode_tl
}
\tl_set:Nn\l_prevactn_tl{}\tl_set:Nx\l_prevnode_tl{/Prev~\pbs_pdflastobj:}
\tl_set_eq:NN\l_currnode_tl\l_nextnode_tl
%register primary navigation node of this page
\sys_if_output_pdf:TF{
\edef\pdfpageattrsave{\the\pdfpageattr}
\tl_set:Nx\l_temp_tl{\pdfpageattrsave/PresSteps~\pbs_pdflastobj:}
\immediate\pdfpageattr\exp_after:wN{\l_temp_tl}
}{
\bool_if:NTF\g_pbs_dvipdfmx_bool{ %dvipdfmx/XeTeX
\special{pdf:put~@thispage <</PresSteps~\pbs_pdflastobj:>>~}
}{
\special{ps:~
mark~{ThisPage}~<</PresSteps~\pbs_pdflastobj:>>/PUT~pdfmark~
}
}
}
%build doubly linked list of navigation nodes
\clist_map_inline:nn{#1}{
\tl_if_exist:cT{ann@\clist_item:nn{##1}{1}}{
\int_step_inline:nnnn{1}{1}{\int_eval:n{\clist_item:nn{##1}{2}-1}}{
\pbs_pdfobj:nnn{}{dict}{} %reserve pdf obj for the `Next' nav. node
\tl_set:Nx\l_nextnode_tl{\pbs_pdflastobj:}
\pbs_pdfobj:nnn{\l_currnode_tl}{dict}{ %current navigation node
\l_prevactn_tl\l_prevnode_tl
/NA<</S/GoTo3DView/V/N/TA~\use:c{ann@\clist_item:nn{##1}{1}}>>
/Next~\l_nextnode_tl
}
\tl_set:Nx\l_prevactn_tl{
/PA<</S/GoTo3DView/V/P/TA~\use:c{ann@\clist_item:nn{##1}{1}}>>}
\tl_set:Nx\l_prevnode_tl{/Prev~\pbs_pdflastobj:}
\tl_set_eq:NN\l_currnode_tl\l_nextnode_tl
}
}
}
%final navigation node
\pbs_pdfobj:nnn{\l_currnode_tl}{dict}{\l_prevactn_tl\l_prevnode_tl}
}
\newcommand\ThreeDPresStepsReset{ %cmd for resetting pres. steps
\bool_if:nT{
\sys_if_output_pdf_p: && \cs_if_exist_p:N\pdfpageattrsave}{
\immediate\pdfpageattr\exp_after:wN{\pdfpageattrsave}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatother
\ExplSyntaxOff
\begin{document}
\begin{frame}{Intro}
Put the Reader into \Acrobatmenu{FullScreen}{\color{blue}Full Screen Mode} first!
\end{frame}
% initialise 3D presentation steps for the next frame
\ThreeDPresSteps{{diceA,7},{diceB,7}}
\begin{frame}{Go forth and back through 3D views using $\leftarrow$ and $\rightarrow$}
\centering
\includemedia[
label=diceA,
width=0.3\textheight,height=0.3\textheight,
activate=pageopen,deactivate=pageclose,
3Dviews=3Dviews.txt,
]{}{dice.U3D}
\includemedia[
label=diceB,
width=0.3\textheight,height=0.3\textheight,
activate=pageopen,deactivate=pageclose,
3Dviews=3Dviews.txt,
]{}{dice.U3D}
\end{frame}
% clear 3D presentation steps
\ThreeDPresStepsReset
\begin{frame}{The End}
\dots
\end{frame}
\end{document}