vrml.surface {mining}R Documentation

View a surface in 3D

Description

Creates a VRML scene with a shaded surface.

Usage

vrml.surface.default(x,y,z,xlab=NULL,ylab=NULL,zlab=NULL,
                     col="gray",scale=c(1,1,1),file.name=NULL,
                     cex.axis=12,light=F,...)

Arguments

x,y locations of grid lines at which the values in z are measured.
z a matrix containing the values to be plotted (NAs are allowed).
xlab,ylab,zlab axis labels. If NULL, taken from the deparsed expressions for x,y,z.
col the color of the surface.
scale a vector of 3 numbers, defining the size of the box into which the surface is placed. You can control the aspect ratio this way.
file.name a filename (with or without the .wrl extension) to receive the VRML. If NULL, a temporary name is chosen.
cex.axis a scale factor for the axis labels.
light If TRUE, the scene will contain its own light and no headlight. Otherwise, the scene will contain no lights and rely on the headlight only.
border If TRUE, a grid will be drawn on top of the surface.
creaseAngle a parameter controlling the smoothness of the surface. When it is small, faces at large angles to each other will create visible "creases".
... additional arguments for internal drawing routines.

Details

A VRML scene description file is created, and opened with a browser if one is available.

VRML is a standard language for describing 3D scenes, and the file produced by this function should be portable across all machines with a VRML browser.

This function is similar to persp except it creates a 3D scene which can be manipulated with a VRML viewer.

Author(s)

Tom Minka

See Also

persp,vrml.plot3d

Examples

#  The Obligatory Mathematical surface.
#  Rotated sinc function.
x <- seq(-10, 10, length= 30)
y <- x
f <- function(x,y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r }
z <- outer(x, y, f)
z[is.na(z)] <- 1
vrml.surface(x,y,z)
vrml.surface(x,y,z,border=T)

[Package Contents]