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

Last updated at Posted at 2020-10-20

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

specularMaterial()

説明文

オブジェクトに鏡面素材を設定します。鏡面素材は光沢のある反射素材です。ambientMaterial と同様に環境光下でオブジェクトが反射する色を定義します。たとえば、
環境光に赤が含まれているとき、鏡面素材に赤が含まれていればオブジェクトは光を反射します。逆に鏡面素材に赤が含まれていなければオブジェクトは光を反射しません。
点光源(pointLight)や指向性ライト(directionalLight)など他のすべてのタイプのライトのとき、鏡面素材は光源の色をビューアに反映します。

構文

specularMaterial(gray, [alpha])

specularMaterial(v1, [v2], [v3], [alpha])

specularMaterial(color)

パラメタ

  • v1
    gray:グレー値

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

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

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

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

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

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

例1

function setup() {
  createCanvas(100, 100, WEBGL);
}
function draw() {
  bacground(0);
  ambientLight(50);
  pointLight(250, 250, 250, 100, 100, 30);
  specularMaterial(250);
  sphere(40);
}

実行結果

著作権

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?