![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/03/watataku-hukidashi-light-blue.png)
今回の記事の目的はProcessingの「sphereDetail()
」を理解し、自分なりに使ってみること。
この記事を書いた人
![](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】sphereDetail()について
sphereDetail()について
- 「sphere」は「球体」、「detail」は「細かい部分」を意味します。つまり、「sphereDetail()」は「球体の細かい部分」
sphereDetail()
は、球体の描画時にその表面をどれだけ細かくするかを指定する- 【注意点】
【Processing】sphereDetail()の使い方【画像とコード】
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/11/processing-spheredetail-usage-specifying-sphere-surface-detail1.png)
![](https://watataku-artist-katsuyaku.com/wp-content/uploads/2024/11/processing-spheredetail-usage-specifying-sphere-surface-detail1.png)
void setup() {
size(400, 400, P3D); // 3D描画のためのウィンドウサイズを設定します
noLoop(); // 描画を一度だけ行います
}
void draw() {
background(200); // 背景を薄い灰色にします
lights(); // ライトを設定します
// 球体の細かさを設定します(経度の数, 緯度の数)
sphereDetail(30, 30);
// 球体を描画します
translate(width/2, height/2, 0); // 球体を画面の中心に移動します
sphere(100); // 半径100の球体を描画します
}
【Processing】sphereDetail()を使ってみた感想
Detailが出ているかどうか分かりづらい。
![](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)
それでは今日もレッツワクワクコーディング。