0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

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

Last updated at Posted at 2020-05-08

このページでは[「P5.js 日本語リファレンス」] (https://qiita.com/bit0101/items/91818244dc26c767a0fe) の plane関数を説明します。

plane()

説明文

指定した幅と高さで平面を描く。

構文

plane([width], [height], [detailX], [detailY])

パラメタ

  • width
    Number:平面の幅(オプション、省略時は50)

  • height
    Number:平面の高さ(オプション、省略時は50)

  • detailX
    Integer:x方向の三角形分割数(オプション、省略時は1)

  • detailY
    Integer:y方向の三角形分割数(オプション、省略時は1)

例1

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

function draw(){
  push();
  translate(-100, -100);
  fill(255, 0, 0);
  plane(60, 60, 1, 1);
  pop();
  
  push();
  translate(-0, -100);
  fill(0, 255, 0);
  plane(60, 60, 0, 0);  // xy方向の三角形分割数が0のため描画されない
  pop();
}

実行結果

plane.png

著作権

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?