File: postscript.Rd

package info (click to toggle)
rgl 0.80-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,508 kB
  • ctags: 10,065
  • sloc: ansic: 27,581; cpp: 14,088; sh: 3,062; makefile: 103
file content (67 lines) | stat: -rw-r--r-- 1,819 bytes parent folder | download | duplicates (3)
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
\name{rgl.postscript}
\alias{rgl.postscript}
\title{export screenshot}
\description{
  Saves the screenshot to a file in PostScript or other vector graphics format.
}
\usage{
rgl.postscript( filename, fmt="eps", drawText=TRUE )
}
\arguments{
  \item{filename}{full path to filename.}
  \item{fmt}{export format, currently supported: ps, eps, tex, pdf, svg, pgf }
  \item{drawText}{logical, whether to draw text}
}
\details{
Animations can be created in a loop modifying the scene and saving 
a screenshot to a file. (See example below)

This function is a wrapper for the GL2PS library by Christophe Geuzaine,
and has the same limitations as that library:  not all OpenGL features
are supported, and some are only supported in some formats.
See the reference for full details.
}
\references{
GL2PS: an OpenGL to PostScript printing library by Christophe Geuzaine,
\url{http://www.geuz.org/gl2ps/}, version 1.3.2.
}
\author{ Christophe Geuzaine / Albrecht Gebhardt }
\examples{

x <- y <- seq(-10,10,length=20)
z <- outer(x,y,function(x,y) x^2 + y^2)
persp3d(x,y,z, col='lightblue')

title3d("Using LaTeX text", col='red', line=3)
rgl.postscript("persp3da.ps","ps",drawText=FALSE)
rgl.postscript("persp3da.pdf","pdf",drawText=FALSE)
rgl.postscript("persp3da.tex","tex")
rgl.pop()
title3d("Using ps/pdf text", col='red', line=3)
rgl.postscript("persp3db.ps","ps")
rgl.postscript("persp3db.pdf","pdf")
rgl.postscript("persp3db.tex","tex",drawText=FALSE)

\dontrun{

#
# create a series of frames for an animation
#

rgl.open()
shade3d(oh3d(), color="red")
rgl.viewpoint(0,20)

for (i in 1:45) {
  rgl.viewpoint(i,20)
  filename <- paste("pic",formatC(i,digits=1,flag="0"),".eps",sep="") 
  rgl.postscript(filename, fmt="eps")
}

}

}
\seealso{
  \code{\link{rgl.viewpoint}}, \code{\link{rgl.snapshot}}
}
\keyword{dynamic}