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

Last updated at Posted at 2020-10-20

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

emissiveMaterial()

説明文

オブジェクトに使用するマテリアル(素材)の放射色を設定します。放射光があると反射光がなくてもオブジェクトは光っているように見えます。

構文

emissiveMaterial(v1, [v2], [v3], [a])

emissiveMaterial(color)

パラメタ

gray 値を指定するとき

  • v1
    Number:グレー値

RGB または HSB を指定するとき

  • v1
    Number:赤または色相値(Hue)

  • v2
    Number:緑または彩度値(Saturation)

  • v3
    Number:青または明度値(Brightness)

  • a
    Number:不透明度(オプション)

  • color
    Number[] | 文字列 | p5.color:color、color Array または CSS color 文字列

例1

// 環境光などライトは無くても光っています。
function setup() {
  createCanvas(300, 300, WEBGL);
}
function draw() {
  background(0);
  noStroke() ;
//  ambientLight(100, 0, 0);

  translate(-30, 0);
  emissiveMaterial(255, 0, 0);
  box(50);

  translate(60, 0);
  emissiveMaterial(0, 255, 0);
  box(50);
}

実行結果

著作権

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?