LoginSignup
0
0

More than 3 years have passed since last update.

P5.js 日本語リファレンス(ellipsoid)

Last updated at Posted at 2020-05-08

このページでは「P5.js 日本語リファレンス」 の ellipsoid関数を説明します。

ellipsoid()

説明文

指定された半径で楕円体を描く。

DetailX と detailY は, 円錐のx方向とy方向の分割数を指定します。分割数を増やすと楕円体がより滑らかに見えます。 150を超える値は避けてください。ブラウザがクラッシュする可能性があります。

構文

楕円体([radiusX], [raduisY], [radiusZ], [detailX], [detailY])

パラメタ

  • radiusX
    Number:楕円体のx方向半径(オプション、デフォルト値は50)

  • radiusY
    Number:楕円体のy方向半径(オプション、デフォルト値はx方向半径)

  • radiusZ
    Number:楕円体のz方向半径(オプション、デフォルト値はx方向半径)

  • detailX
    Integer:円錐x方向の分割数。分割数が多いほど滑らかな楕円体になります(オプション、デフォルト値は24)

  • detailY
    Integer:円錐y方向の分割数。分割数が多いほど滑らかな楕円体になります(オプション、デフォルト値は16)

function setup(){
  createCanvas(200, 200, WEBGL);
}

function draw(){
background(255);
  fill(205, 105, 94);
  rotateY(millis()/ 1000);
  // 楕円体を描画(x方向半径40、y方向半径60,z方向半径10、x方向分割数8、y方向分割数4)
  ellipsoid(40, 60, 10, 8, 4);
}

実行結果

著作権

p5.js was created by Lauren McCarthy and is developed by a community of collaborators, with support from the Processing Foundation and NYU ITP. Identity and graphic design by Jerel Johnson.

ライセンス

Creative Commons(CC BY-NC-SA 4.0) に従います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0