emissiveMaterial

def setup
  createCanvas(100, 100, WEBGL)
end

def draw
  background(0)
  noStroke
  ambientLight(0)
  emissiveMaterial(130, 230, 0)
  sphere(40)
end

p5.jsリファレンス(参考情報)

[p5.js] emissiveMaterial

概要

3Dモデルの質感にエミッシブマテリアルを設定します。

書式

emissiveMaterial(gray)
emissiveMaterial(v1, v2, v3 [, a])
emissiveMaterial(values)
emissiveMaterial(colorstring)
emissiveMaterial(color)

引数

引数名内容備考オプションデフォルト値
grayグレースケール0~255
v1赤 または 色相0~255
colorModeの設定に依存
v2緑 または 彩度0~255
colorModeの設定に依存
v3青 または 輝度(明度)0~255
colorModeの設定に依存
values配列[v1, v2, v3, 透明度]
colorModeの設定に依存
colorstring色文字列
colorp5.Colorオブジェクト
a透明度0~2550

戻値

なし

備考

・エミッシブマテリアルは自己発光します。

関連

色(カラー)