Py5Shape.emissive()#

Sets the emissive color of a Py5Shape object’s material.

Examples#

example picture for emissive()
 1def create_strip(use_emissive):
 2    s = py5.create_shape()
 3    s.begin_shape(py5.TRIANGLE_STRIP)
 4    if use_emissive:
 5        s.emissive(0, 50, 100)
 6    s.vertex(10, 40, -25)
 7    s.vertex(20, 0, -10)
 8    s.vertex(30, 40, 0)
 9    s.vertex(40, 0, 5)
10    s.vertex(50, 40, 0)
11    s.vertex(60, 0, -10)
12    s.vertex(70, 40, -25)
13    s.end_shape()
14    return s
15
16
17def setup():
18    py5.size(100, 100, py5.P3D)
19    py5.background(0)
20    py5.directional_light(200, 200, 200, .5, 0, -1)
21    py5.shape(create_strip(False), 0, 5)
22    py5.shape(create_strip(True), 0, 50)

Description#

Sets the emissive color of a Py5Shape object’s material. Use in combination with Py5Shape.ambient(), Py5Shape.specular(), and Py5Shape.shininess() to set the material properties of a Py5Shape object.

This method can only be used within a Py5Shape.begin_shape() and Py5Shape.end_shape() pair. The emissive color setting will be applied to vertices added after the call to this method.

Underlying Processing method: PShape.emissive

Syntax#

emissive(gray: float, /) -> None
emissive(rgb: int, /) -> None
emissive(x: float, y: float, z: float, /) -> None

Parameters#

  • gray: float - value between black and white, by default 0 to 255

  • rgb: int - color to set

  • x: float - red or hue value (depending on current color mode)

  • y: float - green or saturation value (depending on current color mode)

  • z: float - blue or brightness value (depending on current color mode)

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