specular()

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

specular()

示例
 size(100, 100, P3D);

background(0);

noStroke();

background(0);


fill(0, 51, 102);

lightSpecular(255, 255, 255);

directionalLight(204, 204, 204, 0, 0, -1);

translate(20, 50, 0);

specular(255, 255, 255);

sphere(30);

translate(60, 0, 0);

specular(204, 102, 0);

sphere(30);

描述 Sets the specular color of the materials used for shapes drawn to the screen, which sets the color of highlights. Specular refers to light which bounces off a surface in a preferred direction (rather than bouncing in all directions like a diffuse light). Used in combination with emissive(), ambient(), and shininess() in setting the material properties of shapes.
语法
specular(rgb) specular(gray) specular(v1, v2, v3)
参数
rgb int: color to set
v1 float: red or hue value (depending on current color mode)
v2 float: green or saturation value (depending on current color mode)
v3 float: blue or brightness value (depending on current color mode)
返回值 void
相关 lightSpecular()
ambient()
emissive()
shininess()

Updated on October 2, 2018 05:02:09pm EDT

specular()