mixColorMesh | R Documentation |
mixColorMesh mixes the vertex colors of two registered meshes (identical faces and corresponding vertices).
mixColorMesh(mesh1, mesh2, alpha = 0.5)
mesh1 |
triangular mesh of class "mesh3d". |
mesh2 |
triangular mesh of class "mesh3d". |
alpha |
numeric: 0 <= alpha <=1 weight of color associated with mesh2. |
returns mesh1 with mixed vertex colors.
Stefan Schlager
require(Morpho)
data(nose)
redmesh <- shortnose.mesh
redmesh$material$color <- rep("#FF0000",,ncol(shortnose.mesh$vb))
bluemesh <- shortnose.mesh
bluemesh$material$color <- rep("#0000FF",ncol(shortnose.mesh$vb))
mixmesh <- mixColorMesh(bluemesh,redmesh)
## Not run:
require(rgl)
shade3d(mixmesh)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.