Name

ambient

Examples
settings <- function() {
    size(100, 100, P3D)
}

draw <- function() {
    background(0)
    noStroke()
    background(0)
    directionalLight(204, 204, 204, 0.5, 0, -1)
    emissive(0, 26, 51)
    translate(70, 50, 0)
    sphere(30)
}
Description Sets the ambient reflectance for shapes drawn to the screen. This is combined with the ambient light component of environment. The color components set through the parameters define the reflectance. For example in the default color mode, setting v1=255, v2=127, v3=0, would cause all the red light to reflect and half of the green light to reflect. Used in combination with emissive(), specular(), and shininess() in setting the material properties of shapes.
Syntax
ambient(rgb)
ambient(gray)
ambient(v1, v2, v3)
Parameters
rgbint: any value of the color datatype
grayfloat: number specifying value between white and black
v1float: red or hue value (depending on current color mode)
v2float: green or saturation value (depending on current color mode
v2float: blue or brightness value (depending on current color mode)
Related emissive
specular
shininess
Creative Commons License