transferPoints | R Documentation |
transfer points between two registered meshes
transferPoints(x, mesh1, mesh2, tolwarn = 0.01)
x |
a matrix with 3D-coordinates (or a mesh), positioned on |
mesh1 |
a mesh on which |
mesh2 |
a mesh with vertices and faces corresponding to |
tolwarn |
numeric: if at least one coordinate of |
the function gets the barycentric coordinates of x
on mesh1
and uses them to find the corresponding positions on mesh2
returns a matrix containing x
tranfered to mesh2
.
require(Rvcg)
data(humface)
#extract 300 random points from humface
coords <- vcgSample(humface,200,"pd")
#move original mesh
transface <- rgl::translate3d(humface, 10, 10 ,10)
##extract coordinates
newcoord <- transferPoints(coords, humface, transface)
## Not run:
require(rgl)
wire3d(transface, col=3)
spheres3d(newcoord)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.