首页 > 文档 > lights()设置默认光源参数
2017
08-02

lights()设置默认光源参数

Name lights()设置默认光源参数
Exampleslights()设置默认光源参数 - 第1张  | Processing编程艺术 lights()设置默认光源参数 - 第2张  | Processing编程艺术lights()设置默认光源参数 - 第3张  | Processing编程艺术

size(100, 100, P3D);

background(0);

noStroke();

// Sets the default ambient

// and directional light

lights();

translate(20, 50, 0);

sphere(30);

translate(60, 0, 0);

sphere(30);

lights()设置默认光源参数 - 第4张  | Processing编程艺术lights()设置默认光源参数 - 第5张  | Processing编程艺术lights()设置默认光源参数 - 第6张  | Processing编程艺术

void setup() {

size(100, 100, P3D);

background(0);

noStroke();

}

void draw() {

// Include lights() at the beginning

// of draw() to keep them persistent

lights();

translate(20, 50, 0);

sphere(30);

translate(60, 0, 0);

sphere(30);

}

Description Sets the default ambient light, directional light, falloff, and specular values. The defaults are ambientLight(128, 128, 128) and directionalLight(128, 128, 128, 0, 0, -1), lightFalloff(1, 0, 0), and lightSpecular(0, 0, 0). Lights need to be included in the draw() to remain persistent in a looping program. Placing them in the setup() of a looping program will cause them to only have an effect the first time through the loop.

设置默认的环境光源、方向灯、衰减和镜面值。缺省值为 ambientLight (128128128) 和光源 (12812812800-1)lightFalloff (100) lightSpecular (000)。需要在绘图 () 中包括光源, 以便在循环程序中保持持久性。将它们放在循环程序的设置 () 中将导致它们在第一次循环时产生效果。

Syntax lights()
Returns void
Related ambientLight()
directionalLight()
pointLight()
spotLight()
noLights()


最后编辑:
作者:卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。