spin: Spin or rotate a 3D plot

Description Usage Arguments Value Author(s) See Also Examples

View source: R/spin.R

Description

Like rgl.viewpoint but starts with defaults from par3d, except for theta (rotation around vertical axis) and phi (angular height above the horizontal plane)

Usage

1
spin(theta = 0, phi = 15, fov = par3d("FOV"), zoom = par3d("zoom"), scale = par3d("scale"), stay = FALSE)

Arguments

theta

rotation around vertical axis

phi

angular height above the horizontal plane

fov
zoom

Zoom factor, passed to link[rgl]{rgl.viewpoint}

scale

Scale factor, passed to link[rgl]{rgl.viewpoint}

stay

Not used in this implementation.

Value

None.

Author(s)

Georges Monette

See Also

link[rgl]{rgl.viewpoint}

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function( theta=0, phi=15,
          fov = par3d("FOV"), zoom = par3d("zoom"), 
          scale = par3d("scale"), stay = FALSE) {
          
          # Like rgl viewpoint but starts with defaults except
          # for theta (rotation around vertical axis)
          # and phi (angular height above the horisontal plane) 
          # PLAN:
          # without arguments it should just start spinning
          # USAGE: see rgl.viewpoint and rgl.snapshot
          # rgl.bringtotop(stay = FALSE)
          rgl.viewpoint( theta=theta, phi = phi,
                fov = fov, zoom = zoom, scale = scale)

  }

p3d documentation built on May 2, 2019, 5:25 p.m.