Fun programming with Processing, episode 51. We now continue with the program started in episode 49 where we copy() part of a photo and show this part on our screen. The idea is to animate it by moving which part of the loaded photo we show. If we randomly change the vertical position of the part we copy, we will have an interesting effect. But we encounter a little problem: copy accepts only integer values like 2, 5, 33 or 43, but random() and noise() return float values like 1.4325 or 38.4124. We solve this by converting the float value into an integer by using the int() function.
www.funprogramming.org
Link to this comment:
All Comments (0)