View source: R/mesh_recenter.R
mesh_recenter | R Documentation |
Transforms a mesh so that its center is at the origin (0, 0, 0); it does so by subtracting the average x, y, and z coordinates from all vertices. The same transformation can be applied to the optional set of coordinates to preserve spatial relationships between the mesh and these coordinates.
mesh_recenter(mesh, coords = NA)
mesh |
An object of class |
coords |
(Optional) An Nx3 matrix-like object containing xyz
coordinates, one coordinate per row. Default is |
A list containing the translated mesh (mesh
) and coordinates
(coords
)
Add tests
Cornel M. Pop
## Not run:
library(rgl)
data(demoFlake2)
res <- mesh_recenter(demoFlake2$mesh, demoFlake2$lms)
view3d(theta=0, phi=0)
shade3d(res$mesh, color="green")
points3d(res$coords, color="red", size=5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.