This would be really good to add to the docs, I never need volume plots but there is just one example and it’s not clear at all how to use the other modes.
I would expect to see two intersecting ellipsoids, with axis sitting behind (less visible due to being behind more than one layer). Here I plotted the smaller (closer) surface first. The impression is that both sit behind the axis, and the closer one appears behind the further because transparency is only with respect to axes. I have tried applying an alpha to colormap (suggested above), but I haven’t had much luck improving this
using GLMakie
X = -40:5:40
ellipse1 = [X^2/2 + Y^2 + 2Z^2 for X in X, Y in X, Z in X];
ellipse2 = [X^2/2 + (Y-20)^2 + 2Z^2 for X in X, Y in X, Z in X];
v1=volume(ellipse2, algorithm = :iso,isovalue =350,isorange = 50,transparency=true)
volume!(ellipse1, algorithm = :iso, isovalue =700,isorange = 50,transparency=true)
v1
using GLMakie, ColorSchemes
cbarPal= :plasma
cmap = get(colorschemes[cbarPal], LinRange(0,1,100))
cmap2 = [(cmap[i],0.65) for i in 1:100]
X = -40:5:40
ellipse1 = [X^2/2 + Y^2 + 2Z^2 for X in X, Y in X, Z in X];
ellipse2 = [X^2/2 + (Y-20)^2 + 2Z^2 for X in X, Y in X, Z in X];
volume(ellipse2, algorithm = :iso,isovalue =350,isorange = 50, colormap=cmap2)
volume!(ellipse1, algorithm = :iso, isovalue =700,isorange = 50, colormap=cmap2)
current_figure()
Ok, getting closer. Still puzzling: I make a torus geometry. Why isn’t the full torus visible even though there is an alpha? It seems that the alpha is applied to another surface (dual ellipsoid case above), but not to different parts of the same surface. We should be able to see the core of the torus, and the back surface:
using GLMakie
using ColorSchemes
cmap3 = get(colorschemes[:plasma], LinRange(0,1,100))
cmap4 = [(cmap3[i],0.65) for i in 1:100]
ξ = -40:1:40
c = 20
a = 15
torus = [((hypot(X,Y)-c)^2+Z^2-a^2) for X in ξ, Y in ξ, Z in ξ]
volume(torus, algorithm = :iso,isovalue =100,isorange =50, colormap=cmap4)
current_figure()