File: par3dinterpControl.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 (50 lines) | stat: -rw-r--r-- 1,606 bytes parent folder | download
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
\name{par3dinterpControl}
\alias{par3dinterpControl}
\title{
Control RGL widget like par3dinterp()
}
\description{
This control works with \code{\link{playwidget}} to 
change settings in a WebGL display in the same way
as \code{\link{par3dinterp}} does within R.
}
\usage{
par3dinterpControl(fn, from, to, steps, subscene = NULL, omitConstant = TRUE, ...)
}
\arguments{
  \item{fn}{A function returned from \code{\link{par3dinterp}}.}
  \item{from, to, steps}{Values where \code{fn} should be evaluated.}
  \item{subscene}{Which subscene's properties should be modified?}
  \item{omitConstant}{If \code{TRUE}, do not set values that are
  constant across the range.}
  \item{...}{Additional parameters which will be passed
  to \code{\link{propertyControl}}.}
}
\details{
\code{par3dinterpSetter} sets parameters corresponding to values produced by the result of
\code{par3dinterp}.  
}
\value{
Returns controller data in a list of class "rglControl".
}
\author{
Duncan Murdoch
}
\seealso{
The \HTMLVignette{WebGL}{}{User Interaction in WebGL} vignette
gives more details.
}
\examples{
example(plot3d)
M <- r3dDefaults$userMatrix
fn <- par3dinterp(times = (0:2)*0.75, userMatrix = list(M,
                                      rotate3d(M, pi/2, 1, 0, 0),
                                      rotate3d(M, pi/2, 0, 1, 0)),
                                      scale = c(0.5, 1, 2))
control <- par3dinterpControl(fn, 0, 3, steps = 15)
control      
if (interactive() || in_pkgdown_example()) 
  rglwidget(width = 500, height = 250) \%>\%
  playwidget(control,
       step = 0.01, loop = TRUE, rate = 0.5)
}