forked from processing/processing-web-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathambientLight.xml
More file actions
executable file
·104 lines (77 loc) · 2.44 KB
/
Copy pathambientLight.xml
File metadata and controls
executable file
·104 lines (77 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>ambientLight()</name>
<category>Lights, Camera</category>
<subcategory>Lights</subcategory>
<usage>Web & Application</usage>
<example>
<image>ambientLight_.gif</image>
<code><![CDATA[
size(100, 100, P3D);
background(0);
noStroke();
// The spheres are white by default so
// the ambient light changes their color
ambientLight(51, 102, 126);
translate(20, 50, 0);
sphere(30);
translate(60, 0, 0);
sphere(30);
]]></code>
</example>
<example>
<image>directional_ambient_.jpg</image>
<code><![CDATA[
size(100, 100, P3D);
background(0);
noStroke();
directionalLight(126, 126, 126, 0, 0, -1);
ambientLight(102, 102, 102);
translate(32, 50, 0);
rotateY(PI/5);
box(40);
translate(60, 0, 0);
sphere(30);
]]></code>
</example>
<description><![CDATA[Adds an ambient light. Ambient light doesn't come from a specific direction, the rays have light have bounced around so much that objects are evenly lit from all sides. Ambient lights are almost always used in combination with other types of lights. Lights need to be included in the <b>draw()</b> to remain persistent in a looping program. Placing them in the <b>setup()</b> of a looping program will cause them to only have an effect the first time through the loop. The effect of the parameters is determined by the current color mode.]]></description>
<syntax><![CDATA[
ambientLight(<kbd>v1</kbd>, <kbd>v2</kbd>, <kbd>v3</kbd>)
ambientLight(<kbd>v1</kbd>, <kbd>v2</kbd>, <kbd>v3</kbd>, <kbd>x</kbd>, <kbd>y</kbd>, <kbd>z</kbd>)
]]></syntax>
<parameter>
<label>v1</label>
<description><![CDATA[int or float: red or hue value]]></description>
</parameter>
<parameter>
<label>v2</label>
<description><![CDATA[int or float: green or hue value]]></description>
</parameter>
<parameter>
<label>v3</label>
<description><![CDATA[int or float: blue or hue value]]></description>
</parameter>
<parameter>
<label>x</label>
<description><![CDATA[int or float: x-coordinate of the light]]></description>
</parameter>
<parameter>
<label>y</label>
<description><![CDATA[int or float: y-coordinate of the light]]></description>
</parameter>
<parameter>
<label>z</label>
<description><![CDATA[int or float: z-coordinate of the light]]></description>
</parameter>
<returns>None</returns>
<related>
lights()
directionalLight()
pointLight()
spotLight()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>