rotate ,scale and translate a mesh based on landmark information.
rotates and reflects a mesh onto by calculating the transformation from two sets of referenced landmarks.
rotmesh.onto(mesh, refmat, tarmat, adnormals = FALSE, scale = FALSE, reflection = FALSE, ...)
mesh |
object of class mesh3d. |
refmat |
k x m matrix with landmarks on the mesh |
tarmat |
k x m matrix as target configuration |
adnormals |
logical - if TRUE, vertex normals will be recomputed after
rotation. If |
scale |
logical: if TRUE the mesh will be scaled according to the size of the target. |
reflection |
logical: allow reflection. |
... |
additional parameters passed on to |
mesh |
rotated mesh |
yrot |
rotated refmat |
trafo |
4x4 transformation matrix |
Stefan Schlager
require(rgl) data(boneData) ## rotate, translate and scale the mesh belonging to the first specimen ## onto the landmark configuration of the 10th specimen rotmesh <- rotmesh.onto(skull_0144_ch_fe.mesh,boneLM[,,1], boneLM[,,10], scale=TRUE) ## Not run: ## render rotated mesh and landmarks shade3d(rotmesh$mesh, col=2, specular=1) spheres3d(boneLM[,,1]) ## render original mesh shade3d(skull_0144_ch_fe.mesh, col=3, specular=1) spheres3d(boneLM[,,10]) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.