# rotate.cloud: Interactively rotate 3D plots In TeachingDemos: Demonstrations for Teaching and Learning

## Description

Interactively rotate common 3d plots: cloud, persp, and wireframe.

## Usage

 ```1 2 3``` ```rotate.cloud(x, ...) rotate.persp(x, y, z) rotate.wireframe(x, ...) ```

## Arguments

 `x` `x`, see `persp`, or formula/matrix to pass to cloud or wireframe `y` `y`, see `persp` `z` `z`, see `persp` `...` additional arguments passed on to `cloud` or `persp`

## Details

Use these functions just like `cloud`, `persp`, and `wireframe`. In addition to the default plot a Tk slider window will be created that will allow you to rotate the plot.

The rotations parameters are passed the `screen` argument of `cloud` and `wireframe` and the `theta`, `phi`, `r`, `d`, `ltheta`, `lphi`, and `shade` arguments of `persp`.

For `cloud` and `wireframe` plots the order of the `x`, `y`, and `z` argumets can be rearanged, just type the appropriate letters in the boxes on the left, then press the "refresh" button (changing the order changes the plot for these 2 plots).

## Value

These functions are run for the side effects of the plots and Tk windows, nothing meaninful is returned.

## Author(s)

Greg Snow [email protected]

`cloud` it the lattice package, `persp`, `wireframe` in the lattice package
 ``` 1 2 3 4 5 6 7 8 9 10``` ```if(interactive()){ rotate.cloud(Sepal.Length ~ Petal.Length*Petal.Width, data=iris) rotate.wireframe(volcano) z <- 2 * volcano # Exaggerate the relief x <- 10 * (1:nrow(z)) # 10 meter spacing (S to N) y <- 10 * (1:ncol(z)) # 10 meter spacing (E to W) rotate.persp(x,y,z) } ```