Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rotmesh.onto

rotate ,scale and translate a mesh based on landmark information.


Description

rotates and reflects a mesh onto by calculating the transformation from two sets of referenced landmarks.

Usage

rotmesh.onto(mesh, refmat, tarmat, adnormals = FALSE, scale = FALSE,
  reflection = FALSE, ...)

Arguments

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 mesh has normals and adnormals=FALSE, the existing normals are rotated by the same rotation matrix as the mesh's vertices.

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 rotonto.

Value

mesh

rotated mesh

yrot

rotated refmat

trafo

4x4 transformation matrix

Author(s)

Stefan Schlager

See Also

Examples

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)

Morpho

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.