P5.js Study 023

Generative Design with p5.js / Sketch P_2_1_3_04 を試しながらアレンジ。
元ネタ:https://editor.p5js.org/generative-design/sketches/P_2_1_3_04

新しく覚えたコマンドなど

scale();
// Increases or decreases the size of a shape by expanding and contracting vertices.
// Objects always scale from their relative origin to the coordinate system.

lerpColor();
// Blends two colors to find a third color somewhere between them. 

ロジックのポイント

カーソルのX座表示応じて、モジュール内の図形の数を変化させている。
モジュール内で、図形の塗りがグラデーションを描くようにlerpColor()を利用して色を決定している。
scale()で一定の倍率で図形を縮小させていっている。
カーソルのY座標は、モジュール内での図形の回転角度に連動している。

Leave a comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です