| coloredmesh.from.spheres | R Documentation |
Builds one mesh containing all spheres, with a per-vertex color taken from the color of the sphere the vertex belongs to. The result is a regular fs.coloredmesh instance, so it can be rendered, transformed and exported like any other mesh. Note that the vertices of a sphere are not shared with any other sphere, so each sphere can have its own radius and color.
coloredmesh.from.spheres(
centers,
radii = 1,
col = "#FF0000",
subdivisions = 2L,
metadata = list(),
hemi = NULL,
style = NULL
)
centers |
n x 3 numeric matrix, the sphere centers. |
radii |
numeric vector of length n or a single number, the sphere radii. |
col |
vector of hex color strings, a single one or one per sphere. |
subdivisions |
non-negative integer, the number of subdivisions of the unit icosphere. Defaults to 2L. |
metadata |
named list, metadata for the resulting coloredmesh. See |
hemi |
character string or NULL, the hemisphere this renderable belongs to. Defaults to NULL (not hemisphere-specific). |
style |
|
fs.coloredmesh instance.
centers = rbind(c(0, 0, 0), c(10, 0, 0));
cm = fsbrain:::coloredmesh.from.spheres(centers, c(1, 2), c("#FF0000", "#00FF00"));
class(cm);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.