search for: subdivision3d

Displaying 1 result from an estimated 1 matches for "subdivision3d".

Did you mean: subdivision
2011 Jan 31
1
rgl: draw multiple ellipsoids
...row=T) return(Rc%*%Rb%*%Ra) } require(rgl) ## create one ellipsoid at a given location, with axes a,b,c and Euler angles phi, theta, psi rgl.ellipsoid <- function (x=0,y=0,z=0, a = 1,b=1,c=1, phi=0,theta=0,psi=0, subdivide = 3, smooth = TRUE, ...) { sphere <- subdivision3d(cube3d(...), subdivide) class(sphere) <- c("mesh3d","shape3d") norm <- sqrt(sphere$vb[1, ]^2 + sphere$vb[2, ]^2 + sphere$vb[3, ]^2) for (i in 1:3) sphere$vb[i, ] <- sphere$vb[i, ]/norm sphere$vb[4, ] <- 1 sphere$normals <- sphere$vb...