00:00 / 06:18
1080P
  • Quality
  • 1080P 1080P
  • 720P 720P
  • SD 480P
Add to Channel Download Photo Album 3 Report

Playing issue

0 0

Embed:

Copy

Processing快乐编程045 将距离转化为颜色或宽度 Original

AlanHou 2021-08-03 431

Creators

The map() function is very useful when you want to convert numbers from one range to another range. When do we want to do that? well, we use different ranges of numbers for different things. For example the sin() function returns values between -1 and 1. The valid X positions for drawing on our screen might be between 0 and 400. The right values for RGB colors usually are between 0 and 255.
Sometimes we want to make the color depend on a distance, or maybe the width depend on a speed. You can link any two concepts that come into your mind in your program. Using map() is the easiest way to convert values from one range to another.

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

Photo Album

Comments

No comments yet
Recommended
Autoplay
Download MANA APP