Last chance! 50% off unlimited learning
Sale ends in
Render the output of any of the bricks_from_*
functions as a 3D model. Opens an 'rgl' window.
build_bricks(
brick_list,
background_color = "white",
rgl_lit = TRUE,
outline_bricks = FALSE,
trans_alpha = 0.5,
view_levels = NULL
)
List output from a bricks_from_*
function. Contains an element Img_lego
.
Default 'white'. Color of the background.
Default 'TRUE'. Include RGL lighting features in rendering.
Default 'FALSE'. Include black outlines around brick edges. Set to 'TRUE' and rgl_lit='FALSE' for cartoon-looking bricks.
Default 0.5. Alpha level for transparent bricks.
Numeric array of Levels/z values to display. Leave as 'NULL' to include all.
3D brick model rendered in the 'rgl' package.
Other 3D Models:
bricks_from_coords()
,
bricks_from_excel()
,
bricks_from_mosaic()
,
bricks_from_table()
# NOT RUN {
#This is a brick
brick <- data.frame(
Level="A",
X1 = rep(3,4), #The number 3 is the brickrID for 'bright red'
X2 = rep(3,4)
)
#Convert the dataframe to a list object that can be rendered
brick_object <- brick %>%
bricks_from_table()
#Render it
brick_object %>%
build_bricks()
rgl::clear3d()
#Combine the option rgl_lit=FALSE & outline_bricks=TRUE
# This makes the rendering look like a drawing
brick_object %>%
build_bricks(outline_bricks = TRUE, rgl_lit = FALSE,
background_color = "#99e7ff")
rgl::clear3d()
# }
Run the code above in your browser using DataLab