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 日本語リファレンス(box)

Last updated at Posted at 2020-05-08

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

box()

説明文

指定された幅、高さ、奥行きでボックスを描画します

構文

box([width], [height], [depth], [detailX], [detailY])

パラメタ

  • width
    Number:ボックスの幅(オプション、省略時は50)

  • height
    Number:ボックスの高さ(オプション、省略時は幅と同じ)

  • depth
    Number:ボックスの深さ(オプション、省略時は高さと同じ)

  • detailX
    Integer:x方向の三角形分割数(オプション)

  • detailY
    Integer:y次元の三角形分割数(オプション)

例1

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

function draw(){
  background(240);
  fill(255, 0, 0);
  rotateX(frameCount * 0.01);
  rotateY(frameCount * 0.01);
  box(50, 50, 50, 0, 0);
}

実行結果

著作権

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?