File: viewpoint.Rd

package info (click to toggle)
rgl 1.3.34-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,968 kB
  • sloc: cpp: 23,234; ansic: 7,462; javascript: 6,125; sh: 3,555; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 2,237 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
\name{viewpoint}
\alias{view3d}
\title{Set up viewpoint}
\description{
  Set the viewpoint orientation.
}
\usage{
view3d( theta = 0, phi = 15, fov = 60, zoom = 1, 
        scale = par3d("scale"), interactive = TRUE, userMatrix, 
        type = c("userviewpoint", "modelviewpoint") )
}
\arguments{
  \item{theta, phi}{polar coordinates in degrees. \code{theta} rotates round the vertical axis. \code{phi} rotates round the horizontal axis.}
  \item{fov}{field-of-view angle in degrees}
  \item{zoom}{zoom factor}
  \item{scale}{real length 3 vector specifying the rescaling to apply to each axis}
  \item{interactive}{logical, specifying if interactive navigation is allowed}
  \item{userMatrix}{4x4 matrix specifying user point of view}
  \item{type}{which viewpoint to set?}
}
\details{
The data model can be rotated using the polar coordinates \code{theta}
and \code{phi}.  Alternatively, it can be set in a completely general way using the 4x4 matrix
\code{userMatrix}.  If \code{userMatrix} is specified, \code{theta} and \code{phi} are ignored.

The pointing device of your graphics user-interface can also be used to 
set the viewpoint interactively. With the pointing device the buttons are by default set as follows:

\describe{
\item{left}{adjust viewpoint position}
\item{middle}{adjust field of view angle}
\item{right or wheel}{adjust zoom factor}
}

The user's view can be set with \code{fov} and \code{zoom}.

If the \code{fov} angle is set to 0, a parallel or orthogonal
projection is used. Small non-zero values (e.g. 0.01 or less, but not
0.0) are likely to lead to rendering errors due to OpenGL limitations.

Prior to version 0.94, all of these characteristics were stored in 
one viewpoint object.  With that release the characteristics are split
into those that affect the projection (the user viewpoint) and those that
affect the model (the model viewpoint).  By default, this function
sets both, but the \code{type} argument can be used to limit the effect.

}
\seealso{\code{\link{par3d}}}
\examples{
\dontrun{
# animated round trip tour for 10 seconds

open3d()
shade3d(oh3d(), color = "red")

start <- proc.time()[3]
while ((i <- 36*(proc.time()[3] - start)) < 360) {
  view3d(i, i/4); 
}
}
}
\keyword{dynamic}