Surface and mesh rendering with ggWebGL
Source:vignettes/surface-mesh-showcase.Rmd
surface-mesh-showcase.RmdPurpose
ggWebGL separates structured surfaces from unstructured
meshes. Structured surfaces are rectilinear grids that can carry height
colormaps, normals, wireframes, and optional contour overlays. Meshes
are indexed triangle geometry with scalar coloring, wireframe edges, and
renderer-owned face or vertex ids.
Both examples below use small deterministic in-memory data. They are intended to show the renderer contracts, not to report performance numbers.
Code examples are shown by default. Live WebGL widgets are disabled
during CRAN, package checks, and CI. Rich local or pkgdown rendering
requires GGWEBGL_EVAL_COVERAGE_VIGNETTE=true and
GGWEBGL_EVAL_LIVE_WIDGETS=true.
Status. Structured surfaces and unstructured meshes
are Experimental public APIs. They cover browser-side
indexed geometry examples, while terrain preprocessing, mesh
simplification, and high-scale mesh optimization remain outside the core
package.
Structured Surface
The volcano matrix is converted with
surface_matrix() and rendered as a first-class surface
primitive. The widget uses a perspective orbit view and the
surface_height_colormap shader.
surface_gallery_volcano_widget(height = 460)