Py5Shape.set_specular()#

Sets the specular color of a Py5Shape object’s material, which sets the color of highlight.

Examples#

example picture for set_specular()
 1def setup():
 2    py5.size(100, 100, py5.P3D)
 3    py5.background(0)
 4    py5.light_specular(255, 255, 255)
 5    py5.directional_light(204, 204, 204, 0, 0, -1)
 6    py5.no_stroke()
 7    s = py5.create_shape(py5.SPHERE, 20)
 8
 9    s.set_specular("#FFFFFF")
10    py5.shape(s, 50, 25)
11    s.set_specular("#CC6600")
12    py5.shape(s, 50, 75)

Description#

Sets the specular color of a Py5Shape object’s material, which sets the color of highlight. This is part of the material properties of a Py5Shape object.

The specular parameter can be applied to the entire Py5Shape object or to a single vertex.

This method can only be used for a complete Py5Shape object, and never within a Py5Shape.begin_shape() and Py5Shape.end_shape() pair.

Underlying Processing method: PShape.setSpecular

Syntax#

set_specular(index: int, specular: int, /) -> None
set_specular(specular: int, /) -> None

Parameters#

  • index: int - vertex index

  • specular: int - any color value

Updated on November 12, 2021 11:30:58am UTC