![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
今回の記事の目的はProcessingの「normal()
」を理解し、自分なりに使ってみること。
この記事を書いた人
![](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】normal()について
normal()について
- 3Dの形を作るときにその表面がどっちの方向を向いているかを設定する
【Processing】normal()の使い方【画像とコード】
違いが分かりにくいの、保留問題。
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/11/processing-normal-how-to-set-surface-direction-in-3d-shapes2.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/11/processing-normal-how-to-set-surface-direction-in-3d-shapes2.png)
void setup() {
size(400, 400, P3D); // 画面の大きさを決めると同時に、P3Dレンダラーを使用する
noStroke(); // 線を消す
}
void draw() {
background(0); // 背景色を黒に設定する
// 左側の球体
pushMatrix();
translate(width / 4, height / 2); // 左に移動
fill(0, 0, 255); // 青色を設定する
normal(0, 0, 1); // 表面の向きを決める
sphere(50); // 青い球を描く
popMatrix();
// 右側の球体
pushMatrix();
translate(3 * width / 4, height / 2); // 右に移動
fill(0, 0, 255); // 青色を設定する
normal(1, 0, 0); // 表面の向きを決める
sphere(50); // 青い球を描く
popMatrix();
}
【Processing】normal()を使ってみた感想
カメラ系は違いがわかりにくい。
![](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)
それでは今日もレッツワクワクコーディング。