Learn R Programming

quadmesh (version 0.2.0)

quadmesh: Create a quad-type mesh for use in rgl.

Description

Convert an object to a mesh3d quadrangle mesh, currently the only available method is for raster.

Usage

quadmesh(x, z = x, na.rm = FALSE, ..., texture = NULL)

Arguments

x

raster object for mesh structure

z

raster object for height values

na.rm

remove quads where missing values?

...

ignored

texture

optional input RGB raster, 3-layers

Value

mesh3d

Details

The output is described as a mesh because it is a dense representation of a continuous shape, in this case plane-filling quadrilaterals defined by index of four of the available vertices.

Any raster RGB object (3-layers, ranging in 0-255) may be used as a _texture_ on the resulting mesh3d object. It is not possible to provide rgl with an object of data for texture, it must be a PNG file.

Examples

Run this code
# NOT RUN {
library(raster)
data(volcano)
r <- setExtent(raster(volcano), extent(0, 100, 0, 200))
qm <- quadmesh(r)
# }

Run the code above in your browser using DataLab