00:00 / 10:16
1080P
  • Quality
  • 1080P 1080P
  • 720P 720P
  • SD 480P
Add to Channel Download Report

Playing issue

0 0

Embed:

Copy

Processing快乐编程043 用sin()制作动画 Original

AlanHou 2021-07-31 688

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

No comments yet
Recommended
Autoplay
Ocean Child 06:40
Ocean Child
LightProjectionAudition & Performance
Performing Arts Lab 01:52
Performing Arts Lab
ProjectionAudition & PerformanceInteractive
Zendō Project 02:10
Zendō Project
Dynamic DesignCGPublic ArtArt VideoInteractive Design
The Wishing Forest 01:55
The Wishing Forest
Sound DesignPublic ArtInstallationInteractionInteractive Design
鲜粒|2023世界人工智能大会开幕秀 02:39
鲜粒|2023世界人工智能大会开幕秀
Mixed RealityVirtuality and RealityAudition & PerformanceAudiovisual Interactive InstallationInstallation
Download MANA APP