guides3d: Guides for 3d spherical plotting.

View source: R/plot-rgl-util.R

guides3dR Documentation

Guides for 3d spherical plotting.

Description

This function plots 3d guidelines for navigation on the surface of the sphere, includings the rotational axis and a polar coordinate system.

Usage

guides3d(
  axis = 1.5,
  polgrid = c(30, 30),
  textPG = FALSE,
  res = 1,
  origin = c(0, 0, 0),
  radius = authRadius,
  drad = 1.1,
  ...
)

Arguments

axis

(numeric) Draws the -90(lat. deg. ) +90 (lat. deg.) axis. The plotted radius will be axis times the authalic radius, ca. 6371km.

polgrid

(numeric) with the length of 2, where the first argument specifies the size of the longitudinal and the second the latitudinal divisions (degrees). Setting this argument to NULL will turn this feature off.

textPG

(logical) Flag indicating whether the coordinate values should be added to the 3d render.

res

(numeric) Graphical resolution of the curves: the distance in degrees between the points of the rendered guides.

origin

(numeric) Vector of length=3. Indicates the center of the guiding sphere.

radius

(numeric) Values indicating the radius of the guiding sphere. Defaults to the R2 radius of Earth (6371.007km).

drad

(numeric) Value, indicates the position of coordinate 3d text relative to the guiding sphere radius.

...

Additional arguments passed to segments3d, lines3d and text3d.

Details

The function is built on the openGL renderer of the R package rgl.

Value

The function does not return any value.

Examples

# create a hexagonal grid
  g <- hexagrid(c(2,2))
# plot the grid in 3d space
# plot3d(g, guides=FALSE)
# plot the rotational axis in blue
# guides3d(axis=2, polgrid=NULL, col="blue")
# plot the polar grid at 10 degree resolution
# guides3d(axis=NULL, polgrid=c(10,10), col="red")
# plot some coordinates
# guides3d(axis=NULL, polgrid=c(30,30), textPG=TRUE, col="orange", cex=1.4)

adamkocsis/icosa documentation built on Aug. 20, 2024, 1:35 a.m.