Render a 3-Dimensional projection matrix given positive or negative degree changes in yaw, pitch, and / or roll.

rotate3D(yaw, pitch, roll)

Arguments

yaw

z-axis change in degrees; look left (+) or right (-). Consider this a rotation on the x-y plane.

pitch

y-axis change in degrees; look up (-) or down (+). Consider this a rotation on the x-z plane.

roll

x-axis change in degrees; this change appears as if you touch head to shoulders: right roll (+) and left roll (-).

Value

A 3 x 3 projection matrix corresponding to the degree changes entered.

Details

When plotting with the package scatterplot3d, the default perspective is such that the pitch action appears as a roll while the roll action appears as a pitch.

This function is used only in data generation of the package vignette. This function is called by rotateScale3D().

See also

Called by: rotateScale3D.

Examples

rotate3D(yaw = -10, pitch = 0, roll = 15)
#>           [,1]       [,2]        [,3]
#> [1,] 0.9848078 -0.1677313 -0.04494346
#> [2,] 0.1736482  0.9512512  0.25488700
#> [3,] 0.0000000 -0.2588190  0.96592583