Project 3D
Project a 3D body after rotation and translation
PROJ3D(aglyph, M = diag(1, nrow = 4), M2 = diag(1, nrow = 4), anorms = list(), zee = c(0, 0, 1))
aglyph |
glyph structure |
M |
rotation matrix |
M2 |
rotation matrix |
anorms |
normals to structure |
zee |
Up direction of body |
This function takes a 3D body, rotates it and projects it for plotting. An example glyph is found in Z3Darrow.
Glyph structure
x,y,z |
coordinates of rotated body faces |
xp |
rotated normal vectors |
zd |
depth mean value of each face |
Jonathan M. Lees<jonathan.lees@unc.edu>
makeblock3D, ROTZ, ROTY, ROTX, BOXarrows3D, Z3Darrow, TRANmat
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))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.