Playing issue
Reported video:Processing快乐编程043 用sin()制作动画
Description:
Creators
This time we use the sin() function to animate a circle. In our example it will move smoothly from left to right and then back, repeating this motion again and again.
The sin() function returns a number between -1 and 1. The noise() function returns a number between 0 and 1. All these numbers are too small for measuring pixels and drawing things on the screen. That's why we have to multiply those numbers to make them larger.
Since the sin() function returns negative and positive numbers, it can be a bit tricky to convert them into interesting numbers we can use to draw things on the screen.
That's why we learn to use the map() function, which converts one number from a given range to another number in a new range. For example, it allows us to convert numbers coming out from the sin() function, which are in the -1 to 1 range, into a number which is in the 0 to 400 range, much better for drawing things on the screen.
Courtesy of Abe Pazos Solatie(Fun Programming)
Abe Pazos Solatie, artist and creative coder producing static, moving and interactive images with a focus on the subtle and the organic.
Software(s): Processing
Comments
Please Log in or Register to comment