ergetgetagt

Page 137

Chapter 8: Base modules

132

• +: expand

• =: expand

• >: expand • -: shrink

: shrink

• <: shrink • q: exit

• Ctrl-q: exit

2. Render the scene to a specified rasterized format outformat at the resolution of n pixels per bp, as specified by the setting render=n. A negative value of n is interpreted as |2n| for EPS and PDF formats and |n| for other formats. The default value of render is -1. By default, the scene is internally rendered at twice the specified resolution; this can be disabled by setting antialias=1. High resolution rendering is done by tiling the image. If your graphics card allows it, the rendering can be made more efficient by increasing the maximum tile size maxtile to your screen dimensions (indicated by maxtile=(0,0). If your video card generates unwanted black stripes in the output, try setting the horizontal and vertical components of maxtiles to something less than your screen dimensions. The tile size is also limited by the setting maxviewport, which restricts the maximum width and height of the viewport. On UNIX systems some graphics drivers support batch mode (-noV) rendering in an iconified window; this can be enabled with the setting iconify=true. Some (broken) UNIX graphics drivers may require the command line setting -glOptions=-indirect, which requests (slower) indirect rendering. 3. Embed the 3D PRC format in a PDF file and view the resulting PDF file with version 9.0 or later of Adobe Reader. In addition to the default settings.prc=true, this requires settings.outformat="pdf", which can be specified by the command line option -f pdf, put in the Asymptote configuration file (see [configuration file], page 159), or specified in the script before three.asy (or graph3.asy) is imported. Version 2008/10/08 or later of the movie15 package is also required (see Section 8.17 [embed], page 93). The example pdb.asy illustrates how one can generate a list of predefined views (see 100d.views). A stationary preview image with a resolution of n pixels per bp can be embedded with the setting render=n; this allows the file to be viewed with other PDF viewers. Alternatively, the file externalprc.tex illustrates how the resulting PRC and rendered image files can be extracted and processed in a separate LaTeX file. However, see Chapter 7 [LaTeX usage], page 82 for an easier way to embed three-dimensional Asymptote pictures within LaTeX. The open-source PRC specification is available from http://livedocs.adobe.com/acrobat_sdk/9/ Acrobat9_HTMLHelp/API_References/PRCReference/PRC_Format_Specification/. 4. Project the scene to a two-dimensional vector (EPS or PDF) format with render=0. Only limited hidden surface removal facilities are currently available with this approach (see [PostScript3D], page 138). Automatic picture sizing in three dimensions is accomplished with double deferred drawing. The maximal desired dimensions of the scene in each of the three dimensions can optionally be specified with the routine


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.