Plots an interactive 3D representation of a cube object using OpenGL.
# S3 method for cube
plot3D(x, colvec = getOption("cubing.colors"), recolor = FALSE,
bg = grey(0.8), rand.col = FALSE, size = 0.98, col.interior = grey(0.5),
al.interior = 0.4, al.exterior = 1, rinit = 30, bbox = TRUE, bbcolor =
"#333377", bbemission = "#333377", bbspecular = "#3333FF", bbshininess =
5, bbalpha = 0.5, …)
Any cube object.
Vector of sticker colors. The default is the
cubing.colors
option.
If TRUE
, previous rotations are ignored
and therefore the cube is recolored.
Background color.
If TRUE
then sticker colors are chosen at
random and colvec
is ignored.
Size of the individual cubies. Must be less than one. Values closer to one give cubes that look stickerless because the gap between cubies decreases. Smaller sizes give exploded cubes.
Color of the cube interior.
Alpha value of cube interior.
Alpha value of cube exterior.
The initial plot is rotated rinit
degrees about the z-axis.
Use a bounding box?
Bounding box parameter.
Bounding box parameter.
Bounding box parameter.
Bounding box parameter.
Bounding box parameter.
Other parameters to be passed through to plotting functions.
This function uses the R package rgl which is an interface to OpenGL. The cube can be rotated using a mouse. See the documentation for the rgl package to explore the large number of options available.
The animate
function also uses the rgl package to produce cubing
animations.
# NOT RUN {
aCube <- getCubieCube("Superflip")
# }
# NOT RUN {
plot3D(aCube)
# }
Run the code above in your browser using DataLab