I’m trying to visualize a weighted 3D point set using meshscatter
, where the weight is visualized using transparency: Low weight means high transparency.
To do this I set a color alpha value for each point.
The result looks like this:
There are a couple of things I don’t understand:
- Why do single spheres/points have this dark/light pattern?
- Why are points transparent to some point but not others?
I don’t see a pattern related to depth here.
ssao=true/false
does not make a difference.
Code to reproduce the image:
using GLMakie
points = rand(Float32, 3, 20)
alpha = rand(Float32, 20)
basecolor = RGBf(0.0, 0.44705883, 0.698039230)
markercolor = RGBAf.(basecolor, alpha)
fig = Figure();
ax = Axis3(fig[1, 1])
ax.scene.lights = [ # define lights by hand, just to be sure
AmbientLight(RGBf(0.2, 0.2, 0.2)), DirectionalLight(RGBf(1, 1, 1), Vec3f(0, 0, -1))
]
meshscatter!(ax, points; color=markercolor, markersize=0.1f0, ssao=true)
Point coordinates used in my example
0.08144003, 0.76462823, 0.3078106
0.08184856, 0.88391453, 0.70793194
0.2750585, 0.21764505, 0.36415952
0.30778933, 0.5571264, 0.57384634
0.5351146, 0.94121045, 0.6286627
0.13961536, 0.97269565, 0.39499444
0.34692007, 0.49153197, 0.2805946
0.9911157, 0.22105312, 0.42372352
0.78404695, 0.2793542, 0.5839179
0.5117918, 0.8036711, 0.278471
0.7802961, 0.45787352, 0.6333635
0.9258438, 0.5479086, 0.713095
0.86555547, 0.012489796, 0.27193218
0.13506001, 0.05365455, 0.31954545
0.8792992, 0.48838484, 0.50887954
0.374256, 0.25085568, 0.28193265
0.4643891, 0.5176311, 0.13900834
0.06747496, 0.99334013, 0.67928374
0.28540635, 0.6764825, 0.38197
0.12089592, 0.3304742, 0.31492037
Order independent transparency (via transparency=true
) gives a somewhat reasonable look to the above MWE, but in my actual data (with many more points) that’s not what I want, because I want to keep some perception of depth.