この記事を書いた人
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-user-profile-illustrationi-light-blue.png)
- クリエイティブコーディングで制作した作品と、上達のためにやったこと・学習過程を発信
- コンセプトは「クリエイティブコーディング1万時間の歩き方」
- 2024年にProcessingの構文のアウトプットを終え、2025年から作品制作開始(クリエイティブコーディングで作成した作品集)
目次
作品の画像とコード
![【作品No.31】花火【Processing 2025年1月30日】](https://watataku-artist-katsuyaku.com/wp-content/uploads/2025/01/fireworks-adventures-31-eye-catching-image.jpg)
アニメーション。
// 参考にさせていただいた本
// Processingではじめるビジュアル・デザイン入門 直感と論理できたえるプログラミング
// 138ページを自分なりに変えて作成
void setup() {
size(600, 600);
background(255);
frameRate(1);
}
void draw() {
firework(width / 2, height / 2, 100);
}
void firework(float x0, float y0, float R) {
fill(255, 0, 0);
ellipse(x0, y0, 6, 6);
for (int i = 0; i < 21; i++) {
float t = radians(random(0, 360));
float r = random(R);
float x = x0 + r * cos(t);
float y = y0 + r * sin(t);
ellipse(x, y, random(10, 20), random(10, 20));
stroke(255, 0, 0); // 赤色に設定
strokeWeight(random(1, 5)); // ランダムな太さの線を設定
line(x, y, x0, y0);
noStroke();
}
}
作った感想
花火でもあるし、爆発のような作品をつくったことがなかったので、できて嬉しい。
短時間で、簡単に作成するだけでも得られることは多いという気づきも得る。
いろいろなテーマやジャンルの作品をつくれるようになっていこう。
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
それでは今日もレッツワクワクコーディング。