PROJ3D: Project 3D

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Project a 3D body after rotation and translation

Usage

1
2
PROJ3D(aglyph, M = diag(1, nrow = 4), M2 = diag(1, nrow = 4),
             anorms = list(), zee = c(0, 0, 1))

Arguments

aglyph

glyph structure

M

rotation matrix

M2

rotation matrix

anorms

normals to structure

zee

Up direction of body

Details

This function takes a 3D body, rotates it and projects it for plotting. An example glyph is found in Z3Darrow.

Value

Glyph structure

x,y,z

coordinates of rotated body faces

xp

rotated normal vectors

zd

depth mean value of each face

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

See Also

makeblock3D, ROTZ, ROTY, ROTX, BOXarrows3D, Z3Darrow, TRANmat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
  block1 = matrix(c(0,0,0,
      1,0,0,
      1,0.5,0,
      0,0.5,0,
      0,0,-2,
      1,0,-2,
      1,0.5,-2,
      0,0.5,-2), byrow=TRUE, ncol=3)

    Bblock1 = makeblock3D(block1)

    R3 = ROTX(-40)
    R2 = ROTY(0)
    R1 = ROTZ(20)
    T =  TRANmat(.1, 0, 0 )
    M =     R1  %*% R2  %*%  R3  %*% T

    T2 =  TRANmat(1, 0.5, 0 )
    MT =       T2 %*%   R1  %*% R2  %*%   R3 %*% T

    Z1 =  PROJ3D(Bblock1$aglyph, M=MT,  anorms=Bblock1$anorm , zee=c(0,0,1))

RFOC documentation built on May 2, 2019, 1:38 p.m.