| image_to_array | R Documentation |
Converts the output of render_mesh() or render_scene()
into a 3-dimensional R array of dimensions (height x width x 4) with
RGBA channels.
image_to_array(image)
image |
An image list returned by |
A 3D array of dimensions (height, width, 4) with values in
[0, 1].
mesh <- generate_cuboid(c(0, 0, 0), c(1, 1, 1))
img <- render_mesh(mesh$vertices, mesh$triangles)
arr <- image_to_array(img)
dim(arr) # height x width x 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.