1

I'm new in 3D pdf generation. I created a U3D file, than converted to 3D PDF with texworks(using movie 15 package). It's working, but a media display window is not centered, if a increase the size. My tex file looks like this:

\documentclass[a4paper,portrait, top=1in, bottom=1.25in, left=1.25in, right=1.25in]{article}
\usepackage[3D]{movie15}
\usepackage{hyperref}
\usepackage[UKenglish]{babel}
\begin{document}
\includemovie[
    poster,
    toolbar, %same as `controls'
    label=koord.u3d,
        text=(Click here to see the 3D view),
    3Daac=60.000000, 3Droll=0.000000, 3Dc2c=0.996600 -38.220001 -1.019000, 3Droo=38.246571, 3Dcoo=0.996595 13.730411 1.019460,
    3Dlights=CAD,
]{20 cm }{16 cm}{koord.u3d}
\end{document}

I', looking forward to your answers. Thanks Peter [At the image you can see, tha media display window is not centered]

AndréC
  • 24,137

1 Answers1

2

There are two issues.

  1. In the log file one finds

    LaTeX Warning: Unused global option(s):
        [portrait,top=1in,bottom=1.25in,left=1.25in,right=1.25in].
    

    Thus, the class options have no effect. Instead, use the geometry package to adjust the page set-up:

    \documentclass{article}
    \usepackage[a4paper,portrait, top=1in, bottom=1.25in, left=1.25in, right=1.25in]{geometry}
    
  2. However, these settings give you a line width of 416.83289 pt which is not enough for an object of 20 cm (= 569.05511 pt) width to be centred horizontally. It will produce an "overfull hbox" warning.

The 3D display area behaves like any other object that makes up a TeX box, such as an included graphic, a tabular, or a single letter. To centre these horizontally, use the center environment or the \centering command inside a figure or table environment. Of course, the width of the object may not exceed the available line width.

As stated in the comments, movie15 is obsolete. Use media9 instead. In the following code, the display area has dimensions of 10 cm by 10 cm, which result from the size of the poster argument. It is centred by means of the center environment.

\documentclass{article}
\usepackage[a4paper,portrait, top=1in, bottom=1.25in, left=1.25in, right=1.25in]{geometry}
\usepackage{media9}
\usepackage{hyperref}
\usepackage[UKenglish]{babel}

\begin{document}

\begin{center}
  \includemedia[
%    width=10cm,
%    height=10cm,
    3Dmenu, % various settings via mouse right-click
    3Dtoolbar,
    3Daac=60.000000, 3Droll=0.000000, 3Dc2c=0.996600 -38.220001 -1.019000, 3Droo=38.246571, 3Dcoo=0.996595 13.730411 1.019460,
    3Dlights=CAD
  ]{\vbox to 10cm{
    \vss
    \hbox to 10cm{\hss(Click here to see the 3D view)\hss}
    \vss
  }}{koord.u3d}
\end{center}

\end{document}
AlexG
  • 54,894