I’m having the weirdest issue here. I’ve switched to p5js and its been almost a year that I didn’t use Processing on my Macbook (13-inch 2017, running macOS 10.13.6). Now I’m running the Hello World of interactivity and trying to move an ellipse using mouse coordinates. It doesn’t run smoothly as expected. It seems like the frameRate is very low, but I’ve printed it to console, it is pretty normal… around 60 fps. What is wrong? I’ve tried it with Processing 3.5.4 and the alpha version of Processing 4, same result.
Yes the frameRate is around 60 fps for this very simple program, but the ellipse is not following the cursor smoothly… And now I’ve observed one more thing, the ellipse doesn’t move while I’m moving the mouse, it jumps to the point of the cursor after I stop moving. It looks like mouse movement is blocking the draw loop but below are the frameRate and frameCount values printed on console, so it seems nothing is wrong? But visually it is very wrong … any ideas?
Thx for the reply @micuat ! I’m using the same code that WeinSim posted…
There is no problem with animations as you’ve suggested, they are pretty smooth. I’ve tried the code below. But if I move the mouse during this animation, ellipse movement stops, draw continues to loop and prints the frameRate and frameCount Any more ideas on what is going wrong?
So if I am understanding this right, the draw() method stops being executed as soon as you start moving your mouse, and once you stop moving, draw() continues? That seems very odd
To quantify this, could you maybe add this to your code?
println(frameCount, frameRate, millis()); //instead of just println(frameRate)
Hi @josephh, I also tried to run Processing alone, no luck…
@WeinSimdraw() doesn’t stop, it continues to print to console smoothly but the circle stops moving as soon as I start moving the mouse and once I stop moving the mouse the circle continues moving… I’ve also tried to press random keys. I’m trying to understand if any mouse/keyboard input is blocking the canvas update, but pressing keys doesn’t interrupt the animation. Here is the updated console output according to your suggestion:
@glv thank youuu! now it is displaying the animation smoothly
It seems I have to use the P2D or FX2D (it also works fine with P3D, but no need in my case since I work with 2D canvas only) I still don’t know why it doesn’t work with the default renderer, but it is solved!