Processing, ambient()
用法介紹。
用法
ambient(rgb)
ambient(gray)
ambient(v1, v2, v3)
參數
rgb
(int)
顏色數據類型的任何值gray
(float)
數字指定白色和黑色之間的值v1
(float)
紅色或色調值(取決於當前顏色模式)v2
(float)
綠色或飽和度值(取決於當前顏色模式)v3
(float)
藍色或亮度值(取決於當前顏色模式)
返回
void
說明
設置繪製到屏幕上的形狀的環境反射率。這與環境的環境光分量相結合。通過參數設置的顏色分量定義反射率。例如在默認顏色模式下,設置 v1=255、v2=126、v3=0,將導致所有紅光反射,一半綠光反射。與 emissive()
、 specular()
和 shininess()
結合使用以設置形狀的材料屬性。
例子
size(400, 400, P3D);
background(0);
noStroke();
directionalLight(153, 153, 153, .5, 0, -1);
ambientLight(153, 102, 0);
ambient(51, 26, 0);
translate(280, 200, 0);
sphere(120);

相關用法
- Processing ambientLight()用法及代碼示例
- Processing acos()用法及代碼示例
- Processing arrayCopy()用法及代碼示例
- Processing asin()用法及代碼示例
- Processing atan()用法及代碼示例
- Processing applyMatrix()用法及代碼示例
- Processing atan2()用法及代碼示例
- Processing arc()用法及代碼示例
- Processing alpha()用法及代碼示例
- Processing abs()用法及代碼示例
- Processing append()用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
- Processing FloatDict用法及代碼示例
- Processing FFT.stop()用法及代碼示例
- Processing join()用法及代碼示例
- Processing () (parentheses)用法及代碼示例
- Processing Pulse用法及代碼示例
- Processing PShader用法及代碼示例
- Processing PVector.set()用法及代碼示例
- Processing FloatDict.sortKeysReverse()用法及代碼示例
- Processing texture()用法及代碼示例
- Processing IntDict.add()用法及代碼示例
- Processing PShape.enableStyle()用法及代碼示例
- Processing FloatDict.sub()用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 ambient()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。