Py5Shape.set_shininess()#

Sets the amount of gloss a Py5Shape object’s surface has.

Examples#

example picture for set_shininess()
 1def setup():
 2    py5.size(100, 100, py5.P3D)
 3    py5.background(0)
 4    py5.ambient_light(102, 102, 102)
 5    py5.light_specular(204, 204, 204)
 6    py5.directional_light(150, 150, 150, .5, 0, -1)
 7    py5.no_stroke()
 8    s = py5.create_shape(py5.SPHERE, 20)
 9
10    s.set_shininess(0.2)
11    py5.shape(s, 50, 25)
12    s.set_shininess(5)
13    py5.shape(s, 50, 75)

Description#

Sets the amount of gloss a Py5Shape object’s surface has. This is part of the material properties of a Py5Shape object.

The shine 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.setShininess

Syntax#

set_shininess(index: int, shine: float, /) -> None
set_shininess(shine: float, /) -> None

Parameters#

  • index: int - vertex index

  • shine: float - degree of shininess

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