ambient()
Lights Camera / Material PropertiesDescription
Sets the ambient reflectance for shapes. Used with lighting.
Syntax
void ambient(float r, float g, float b)
void ambient(color c)
Parameters
| Name | Type | Description |
|---|---|---|
| r | float | red component |
| g | float | green component |
| b | float | blue component |
| c | color | a color value |
Returns
voidRelated
Under the Hood
From Processing.h:
void ambient(float r, float g, float b);
void ambient(color c);
Under the Hood
From Processing.cpp:
void PApplet::ambient(float r, float g, float b) {
GLfloat col[] = { lc(r), lc(g), lc(b), 1.0f };
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, col);
}
void PApplet::ambient(color c) {
unsigned int v = c.value;
ambient((v >> 16 & 0xFF) / 255.f,
(v >> 8 & 0xFF) / 255.f,
(v & 0xFF) / 255.f);
}
ambient((v >> 16 & 0xFF) / 255.f,
(v >> 8 & 0xFF) / 255.f,
(v & 0xFF) / 255.f);