Writes the output of render_mesh() or render_scene()
to a TGA file using scimesh's own C++ TGA writer (no external
dependencies). TGA output is uncompressed true-color.
Arguments
- image
An image list returned by
render_mesh()orrender_scene().- filename
Output TGA file path.
- use24bit
If
TRUE, write 24-bit RGB (no alpha channel). The defaultFALSEwrites 32-bit RGBA.
Examples
mesh <- generate_cuboid(c(0, 0, 0), c(1, 1, 1))
img <- render_mesh(mesh$vertices, mesh$triangles)
tmp_file <- tempfile(fileext = ".tga")
write_tga(img, tmp_file)