mixColorMesh: mix vertex colors of two registered meshes.

View source: R/mixColorMesh.r

mixColorMeshR Documentation

mix vertex colors of two registered meshes.

Description

mixColorMesh mixes the vertex colors of two registered meshes (identical faces and corresponding vertices).

Usage

mixColorMesh(mesh1, mesh2, alpha = 0.5)

Arguments

mesh1

triangular mesh of class "mesh3d".

mesh2

triangular mesh of class "mesh3d".

alpha

numeric: 0 <= alpha <=1 weight of color associated with mesh2.

Value

returns mesh1 with mixed vertex colors.

Author(s)

Stefan Schlager

Examples


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)

zarquon42b/mesheR documentation built on Jan. 28, 2024, 2:17 p.m.