bary2point | R Documentation |
transform barycentric coordinates into 3D-coordinates
bary2point(bary, faceptr, mesh)
bary |
3xn Matrix containing barycentric coordinates |
faceptr |
integer vector of length n. Assigning a face to each triple of barycentric coordinates |
mesh |
mesh to extract coordinates from |
a nx3 matrix containing 3D-coordinates
require(Rvcg)
data(humface)
#extract 300 random points from humface
coords <- vcgSample(humface,200)
#get barycentric coordinates
proj <- vcgClost(coords, humface, barycentric=TRUE)
#move original mesh
transface <- rgl::translate3d(humface, 10, 10 ,10)
newcoord <- bary2point(proj$barycoords, proj$faceptr, transface)
## Not run:
require(rgl)
wire3d(transface, col=3)
spheres3d(newcoord,radius=0.5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.