Hi Natverse team,
Thank you so much for all of your hard work on these amazing tools. I have a question related to exporting a high resolution snapshot of the rgl 3d graphics window. I understand the functions rgl.snapshot() and rgl.postscript are typically used for this purpose, but the former does not allow the user to specify resolution, and the latter does not render objects with transparency. We am trying to create images including a semi-transparent hemibrain mesh, so the transparency is crucial.
library(natverse)
library(readobj)
meshpaths=dir(OBJ_path, pattern = "obj$", full.names = T)
names(meshpaths)=tools::file_path_sans_ext(basename(meshpaths))
meshes=nlapply(meshpaths, function(p) readobj::read.obj(p, convert.rgl = T)[[1]])
neurons <- read.neurons(paths = SWC_path)
plot3d(meshes, col = mesh_color, alpha = mesh_opacity, plotengine = 'rgl', add = TRUE)
plot3d(neurons, col = neuron_colors, lwd = neuron_width,
soma = soma_radius, WithNodes = neuron_nodes, WithText = neuron_text,
skipRedraw = TRUE, plotengine = engine, add = TRUE)
Where SWC_path is a directory containing 3 SWC neurons and OBJ_path is a directory containing a hemibrain mesh in OBJ format fetched via neuprint.
the rendering looks beautiful in the xquartz window, but we cannot figure out a good way to capture it in high resolution after we have manipulated it to a good viewing angle. Ideally, we would be able to specify the FOV and export the plot to a high resolution bitmap (tiff). Any ideas how to do this?
I am attaching the results of rgl.snapshot (poor resolution) and rgl.postscript (no transparency), to give an idea of what we're looking for.
Thanks so much for your time,
Andrew