Create a simple quad mesh3d object. quad() is the eager
convenience form of quad_mesh(quad_spec(...)).
Details
Use quad() to create a mesh3d object with quad indexes to the vertices, this is
defined in the rgl package by qmesh3d() and has elements
vb (the homogeneous coordinates 4xn) and ib (the quad index 4xn).
Use segs() to create a mesh3d object with segment indexes, exactly analogous to the mesh created by
quad() just only containing the quad edges/segments - note that segments are unique.
The meshColor is currently hardcoded as 'vertices'.
Use quad_texture() to create a mesh3d object additionally with texcoords and
texture properties.
See also
Other textures:
break_mesh(),
quad_spec()
Examples
qm <- quad()
## orientation is low to high, x then y
qm <- quad(dim(volcano))
scl <- function(x) (x - min(x, na.rm = TRUE))/diff(range(x, na.rm = TRUE))
qm$meshColor <- "faces"
qm$material$color <- hcl.colors(12, "YlOrRd", rev = TRUE)[scl(volcano) * 11 + 1]
if (requireNamespace("rgl")) {
rgl::plot3d(qm)
}
3D plot