Learn R Programming

RFOC (version 3.4-6)

PROJ3D: Project 3D

Description

Project a 3D body after rotation and translation

Usage

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

Value

Glyph structure

x,y,z

coordinates of rotated body faces

xp

rotated normal vectors

zd

depth mean value of each face

Details

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

See Also

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

Examples

Run this code
# NOT RUN {
  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))


# }

Run the code above in your browser using DataLab