matthias-research / pages

My web page containing all the demos from my youtube channel "Ten Minute Physics" www.youtube.com/c/TenMinutePhysics
651 stars 134 forks source link

Bug report: Eulerian Fluid Simulator in 200 lines of code #25

Open Habrador opened 1 year ago

Habrador commented 1 year ago

I guess the intent is to display the fluid as white and the walls as black if you deactivate both the smoke and the pressure. To make that work the "var color = [255, 255, 255, 255]" has to be inside of the two for loops in "draw" method. Otherwise everything becomes just black.

Habrador commented 1 year ago

I think there's also a bug in the SampleField method. If we sample from the bottom row it interpolates between the wrong values