![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
今回の記事の目的はProcessingの「noLights()
」を理解し、自分なりに使ってみること。
この記事を書いた人
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-user-profile-illustrationi-light-blue.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-user-profile-illustrationi-light-blue.png)
- クリエイティブコーディングで制作した作品と、上達のためにやったこと・学習過程を発信
- コンセプトは「クリエイティブコーディング1万時間の歩き方」
- 2024年にProcessingの構文のアウトプットを終え、2025年から作品制作開始(クリエイティブコーディングで作成した作品集)
目次
【Processing】noLights()について
noLights()について
- noLightsの英語の意味は「光を使わない」
- 絵やアニメーションで、光の効果を止めるために使う
【Processing】noLights()の使い方【画像とコード】
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/11/processing-nolights-how-to-stop-light-effects-in-art-and-animation1.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/11/processing-nolights-how-to-stop-light-effects-in-art-and-animation1.png)
void setup() {
size(400, 400, P3D); // 画面の大きさを決めると同時に、P3Dレンダラーを使用する
noStroke(); // 線を消す
}
void draw() {
background(255); // 背景色を白に設定する
// 左側
pushMatrix();
translate(width/4, height/2); // 球体を左に移動
noLights(); // 光をオフ
fill(0, 0, 255); // 青色を設定する
sphere(100); // 左半分の青い球を描く
popMatrix();
// 右側
pushMatrix();
translate(3 * width/4, height/2); // 球体を右に移動
lights(); // 光をオン
fill(0, 0, 255); // 青色を設定する
sphere(100); // 右半分の青い球を描く
popMatrix();
}
【Processing】noLights()を使ってみた感想
ちょっと色が変わりましたね。
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
それでは今日もレッツワクワクコーディング。