Adds a surface mesh to the current scene. The surface is
typically defined by a matrix of height values in z
(as in persp),
but any of x, y, or z may be matrices or
vectors, as long as at least one is a matrix. (One
historical exception is allowed: if all are vectors but
the length of z is the product of the lengths of
x and y, z is converted to a matrix.)
Dimensions of all matrices must match.
If any of the coordinates are vectors, they are interpreted as follows:
If x is a vector, it corresponds to rows of the matrix.
If y is a vector, it corresponds to columns
of the matrix.
If z is a vector, it corresponds to columns
unless y is also a vector, in which case it corresponds
to rows.
If the normals are not supplied, they will be calculated automatically based
on neighbouring points.
Texture coordinates run from 0 to 1 over each dimension of the texture bitmap.
If texture coordinates are not supplied, they will be calculated to
render the texture exactly once over the grid. Values greater than 1 can be
used to repeat the texture over the surface.
surface3d always tries to draw the surface with the `front' upwards
(typically towards higher z values). This can be used to render
the top and bottom differently; see material3d and
the example below. If you don't like its choice, set
flip = TRUE to use the opposition definition.
NA values in the height matrix are not drawn.