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.
Arguments
- image
An image list returned by
render_mesh()orrender_scene().
Examples
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
#> [1] 600 800 4