Closed redek91 closed 4 years ago
Did you find an explanation for the issue?
@MSBack I guess it was low precision with floating point numbers in java. I could not find any other explanation.
It is fixable by seting boundaries on the acceleration variable.
This method is used to avoid oscillation.
Hi Dan, i found a strange behaviour while making the exercises in the book. I could reproduce the problem in the example NOC_2_5_fluidresistance.pde. Try to set
movers[i] = new Mover(random(0.1, 0.2), 40+i*70, 0);
at line 62 instead ofmovers[i] = new Mover(random(0.5, 3), 40+i*70, 0);
You'll see that the small objects are actually bouncing off the liquid and going up at "speed of light".Why is this happening? Is it to the low precision of the float data type or am I missing something?