Description Usage Arguments Value See Also Examples
View source: R/build-bricks-rgl.R
Render the output of any of the bricks_from_*
functions as a 3D model. Opens an 'rgl' window.
1 2 3 4 5 6 7 8 | build_bricks(
brick_list,
background_color = "white",
rgl_lit = TRUE,
outline_bricks = FALSE,
trans_alpha = 0.5,
view_levels = NULL
)
|
brick_list |
List output from a |
background_color |
Default 'white'. Color of the background. |
rgl_lit |
Default 'TRUE'. Include RGL lighting features in rendering. |
outline_bricks |
Default 'FALSE'. Include black outlines around brick edges. Set to 'TRUE' and rgl_lit='FALSE' for cartoon-looking bricks. |
trans_alpha |
Default 0.5. Alpha level for transparent bricks. |
view_levels |
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()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #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()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.