Makie 3D scatter animation flow field

Hi everyone,
I’m trying to make a particle tracking animation of a flow field with Makie. One thing I observed was an “artifact” when the scatter dots move away from the camera. Then they’re surrounded by a small white stroke, rendering many dots next to each other almost invisible to the eye. I attached a video to try to make my point. I hope it’s visible. Is there any easy way to turn this off? If a minimal working example helps, I can attach it later.

I am using Makie and plotting with

scene = scatter(x_,y_,z_,color=c_,markersize=10*s_[:],show_axis=true, strokewidth=0)

where x_,y_,z_,c_ are Node's that modify the scene for the animation.

ezgif.com-gif-maker

5 Likes

Nice plot!
I think you pretty much have two options right now:

  1. use meshscatter(shading=false) so it looks like flat circles (will be slower but should be still plenty fast)
  2. use transparency=true… but that may introduce other artifacts like particles in the background rendering over particles in the foreground (it assumes that everything is transparent, so if it’s opaque it doesn’t work that well).
2 Likes

Thanks for the super quick reply!

Option 1 gave a

ERROR: There was no `AbstractPlotting.convert_arguments` overload found for
the plot type Combined{AbstractPlotting.meshscatter,Tuple{}}, or its conversion trait AbstractPlotting.PointBased().
The arguments were:
()

To fix this, define `AbstractPlotting.convert_arguments(::Combined{AbstractPlotting.meshscatter,Tuple{}}, )`.

I’m using [537997a7] AbstractPlotting v0.12.18, [ee78f7c6] Makie v0.11.1 and Julia v1.5.2.

Option 2 works fine, but it does show the particles in the background over those in the foreground, as you said !

Is there something I can do to change this?

It looks like you call meshscatter without any arguments?

1 Like

ah oups, I thought meshscatter is a configurating function :sweat_smile:

It works fine now, thanks a lot!

Ah :smiley:
Btw, I’d love to see the final animation, and maybe tweet it to https://twitter.com/MakiePlots :slight_smile:

2 Likes

I also want to do a transient animation, how did you get this to work in Makie?

I was using meshscatter, but could only plot one frame at a time.

Kind regards

What do you mean?

Sorry I tried replying to @fgerick

I was just curious of how to make an animation as he showed and do it properly, i.e. not calling meshscatter all the times, but updating the underlying data if it makes sense?

I see now that he also used scatter instead of meshscatter, so perhaps that is the difference

Kind regards

Hi, I use Nodes to udpate the plot, something like so:

r = [Node{Vector{Point3{Float64}}}(Point3.(rand(3)) for i=1:n_points]
meshcatter!(scene, r)

for i=1:n_time
    r[] = r[] .+ [Point3.(randn(3)/20) for i=1:n_points] #updates the Node
    sleep(0.02) #give the plot some time to display.
end

hope this helps!

1 Like