File: observer3d.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 (53 lines) | stat: -rw-r--r-- 1,616 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
\name{observer3d}
\alias{observer3d}
\title{
Set the observer location
}
\description{
This function sets the location of the viewer.
}
\usage{
observer3d(x, y = NULL, z = NULL, auto = FALSE)
}
\arguments{
  \item{x, y, z}{
The location as a 3 vector, using the usual \code{xyz.coords}
conventions for specification.  If \code{x} is missing
or any coordinate is \code{NA}, no change will be made to the
location.  
}
  \item{auto}{ 
If \code{TRUE}, the location will be set 
automatically by RGL to make the whole bounding box visible.
}
}
\details{
This function
sets the location of the viewer relative to the scene, after the model transformations
(scaling, rotation) have been done, but before lighting or projection have been 
applied.  (See \code{\link{par3d}} for details on the rendering pipeline.)

The coordinate system is a slightly strange one:  the X coordinate
moves the observer location from left to right, and the Y coordinate moves up
and down.  The Z coordinate changes the depth from the viewer.  All are measured
relative to the center of the bounding box (\code{par("bbox")}) of the subscene.
The observer always looks in the positive Z direction
after the model rotation have been done.  The coordinates are in post-scaling
units.
}
\note{
This function is likely to change in future versions of RGL, to allow more 
flexibility in the specification of the observer's location and orientation.
}
\value{
Invisibly returns the previous value.
}
\author{
Duncan Murdoch
}

\examples{
example(surface3d)  # The volcano data
observer3d(0, 0, 440) # Viewed from very close up
}
\keyword{ graphics }