Creates a triangle mesh object representing a surface over a rectangular grid.

1 2 3 |

`x, y` |
numeric vectors. |

`f` |
numeric matrix of dimension |

`color` |
color to use for the surface. Can also be a function of three arguments. This is called with three arguments, the coordinates of the midpoints of the triangles making up the surface. The function should return a vector of colors to use for the triangles. |

`color2` |
opposite face color. |

`alpha` |
alpha channel level, a number between 0 and 1.. |

`fill` |
logical; if |

`col.mesh` |
color to use for the wire frame. |

`smooth` |
integer or logical specifying Phong shading level for "standard" and "grid" engines or whether or not to use shading for the "rgl" engine. |

`material` |
material specification; currently only used by "standard" and "grid" engines. Currently possible values are the character strings "dull", "shiny", "metal", and "default". |

Returns a triangle mesh object representing the surface.

`persp`

, `rgl.surface`

,
`surface3d`

.

1 2 3 4 | ```
drawScene(surfaceTriangles(seq(-1,1,len=30), seq(-1,1,len=30),
function(x, y) (x^2 + y^2), color2 = "green"))
drawScene.rgl(surfaceTriangles(seq(-1,1,len=30), seq(-1,1,len=30),
function(x, y) (x^2 + y^2), color2 = "green"))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.