Hi, I’m back with my second question:)
I am currently making a zooming effect, by gradually increasing the size of an image.
It does work well, but it kind of lags and the pixels get all mixed up; I don’t want to slow it down, and the smooth() function doesn’t seem like the one I’m looking for.
Does anybody have a tip about smooth moving? I’d really appreciate it.
It seems that your Code just runs slowly. The best Option would probably be to try and make your code more efficient, or to save the zooming as Images and just show it as a video/displaying the individual images one after the other a time.
Got it. So there aren’t any functions or something that helps making smoother graphics or something?
better post your code , but use the
</> code button from editor menu
to paste into
Sorry I just think I should just slow the code down
Thank you though:)
If you are using the five-argument form of image – image(img, a, b, c, d)
– in draw(), then you are resizing your image every frame, and that can get really slow.
There are many potential workarounds, including pre-scaling to different sizes, or using a 3D space and drawing at different depths to zoom. However, good advice on optimizing performance depends on knowing the specific details of your code.
Ok. Maybe I should just study Processing a little more.
Sure. Some of these things – like 5-arg image being slow - we learn through experience. Keep in mind that, if you share an MCVE, people can give you optimization advice. If you don’t, we are just guessing blindly.