rgl (version 0.67-2)

viewpoint: setup viewpoint

Description

Set the viewpoint orientation.

Usage

view3d( theta = 0, phi = 15, ...)
rgl.viewpoint( theta = 0, phi = 15, fov = 60, zoom = 1, scale = par3d("scale"), 
               interactive = TRUE, userMatrix )

Arguments

theta,phi
polar coordinates
...
additional parameters to pass to rgl.viewpoint
fov
field-of-view angle
zoom
zoom factor
scale
real length 3 vector specifying the rescaling to apply to each axis
interactive
logical, specifying if interactive navigation is allowed
userMatrix
4x4 matrix specifying user point of view

Details

The viewpoint can be set in an orbit around the data model, using the polar coordinates and phi. Alternatively, it can be set in a completely general way using the 4x4 matrix userMatrix. If userMatrix is specified, theta and 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:

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

See Also

par3d

Examples

Run this code
# animated round trip tour for 10 seconds

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

start <- proc.time()[3]
while ((i <- 36*(proc.time()[3]-start)) < 360) {
  rgl.viewpoint(i,i/4); 
}

Run the code above in your browser using DataCamp Workspace