M-File Help: plot_sphere | View code for plot_sphere

# plot_sphere

Plot spheres

plot_sphere(C, R, color) add spheres to the current figure. C is the centre of the sphere and if its a 3xN matrix then N spheres are drawn with centres as per the columns. R is the radius and color is a Matlab color spec, either a letter or 3-vector.

H = plot_sphere(C, R, color) as above but returns the handle(s) for the spheres.

H = plot_sphere(C, R, color, alpha) as above but alpha specifies the opacity of the sphere were 0 is transparant and 1 is opaque. The default is 1.

## Example

Create four spheres

    plot_sphere( mkgrid(2, 1), .2, 'b')

and now turn on a full lighting model

    lighting gouraud
    light

## NOTES

- The sphere is always added, irrespective of figure hold state.
- The number of vertices to draw the sphere is hardwired.

© 1990-2014 Peter Corke.