We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to calculate on how to draw a line and I need to run the calculations until the error is small, but my point is how can I draw a line without it displaying the result immediately?
I have a for loop that calculates and updates my variables and until the error is small, I use those variables to draw my line. I want to draw the line changing as my variables are changing during the calculation. However, when I put that in my draw method and run it, it only displays the end result and not the line moving during the calculation. How can I do this???
Answers
draw() is a loop. rewrite your code so that it uses draw looping rather than your for loop. use a global variable rather than the loop index.
the minimal example is just
is there another way to not rewrite my code into the draw loop?
https://forum.processing.org/two/discussion/8087/what-are-setup-and-draw
https://forum.processing.org/two/discussion/8085/i-display-images-in-sequence-but-i-see-only-the-last-one-why
in short: no