Skip to content

Commit d52b95d

Browse files
committed
Merge branch 'master' into dev
2 parents eb07af5 + 3b4457e commit d52b95d

File tree

2 files changed

+170
-152
lines changed

2 files changed

+170
-152
lines changed

docs/api/lights/SpotLight.html

Lines changed: 168 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,168 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<script src="../../list.js"></script>
6-
<script src="../../page.js"></script>
7-
<link type="text/css" rel="stylesheet" href="../../page.css" />
8-
</head>
9-
<body>
10-
[page:Object3D] &rarr; [page:Light] &rarr;
11-
12-
<h1>[name]</h1>
13-
14-
<div class="desc">A point light that can cast shadow in one direction.</div>
15-
16-
<div class="desc">Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].</div>
17-
18-
19-
<h2>Example</h2>
20-
21-
<code>// white spotlight shining from the side, casting shadow
22-
23-
var spotLight = new THREE.SpotLight( 0xffffff );
24-
spotLight.position.set( 100, 1000, 100 );
25-
26-
spotLight.castShadow = true;
27-
28-
spotLight.shadowMapWidth = 1024;
29-
spotLight.shadowMapHeight = 1024;
30-
31-
spotLight.shadowCameraNear = 500;
32-
spotLight.shadowCameraFar = 4000;
33-
spotLight.shadowCameraFov = 30;
34-
35-
scene.add( spotLight );</code>
36-
37-
38-
<h2>Constructor</h2>
39-
40-
<h3>[name]( [page:Float color], [page:Float intensity], [page:Float distance], [page:Boolean castShadow] )</h3>
41-
42-
<h2>Properties</h2>
43-
44-
<h3>.[page:Vector3 position]</h3>
45-
<div>
46-
Light's position.<br />
47-
Default — *new THREE.Vector3()*.
48-
</div>
49-
50-
<h3>.[page:Float intensity]</h3>
51-
<div>
52-
Light's intensity.<br />
53-
Default — *1.0*.
54-
</div>
55-
56-
<h3>.[page:Float distance]</h3>
57-
<div>
58-
If non-zero, light will attenuate linearly from maximum intensity at light *position* down to zero at *distance*.<br />
59-
Default — *0.0*.
60-
</div>
61-
62-
<h3>.[page:Boolean castShadow]</h3>
63-
<div>
64-
If set to *true* light will cast dynamic shadows. *Warning*: This is expensive and requires tweaking to get shadows looking right.<br />
65-
Default — *false*.
66-
</div>
67-
68-
<h3>.[page:Boolean onlyShadow]</h3>
69-
<div>
70-
If set to *true* light will only cast shadow but not contribute any lighting (as if *intensity* was 0 but cheaper to compute).<br />
71-
Default — *false*.
72-
</div>
73-
74-
<h3>.[page:Float shadowCameraNear]</h3>
75-
<div>
76-
Perspective shadow camera frustum <em>near</em> parameter.<br />
77-
Default — *50*.
78-
</div>
79-
80-
<h3>.[page:Float shadowCameraFar]</h3>
81-
<div>
82-
Perspective shadow camera frustum <em>far</em> parameter.<br />
83-
Default — *5000*.
84-
</div>
85-
86-
<h3>.[page:Float shadowCameraFov]</h3>
87-
<div>
88-
Perspective shadow camera frustum <em>field of view</em> parameter.<br />
89-
Default — *50*.
90-
</div>
91-
92-
<h3>.[page:Boolean shadowCameraVisible]</h3>
93-
<div>
94-
Show debug shadow camera frustum.<br />
95-
Default — *false*.
96-
</div>
97-
98-
<h3>.[page:Float shadowBias]</h3>
99-
<div>
100-
Shadow map bias.<br />
101-
Default — *0*.
102-
</div>
103-
104-
<h3>.[page:Float shadowDarkness]</h3>
105-
<div>
106-
Darkness of shadow casted by this light (from *0* to *1*).<br />
107-
Default — *0.5*.
108-
</div>
109-
110-
<h3>.[page:Integer shadowMapWidth]</h3>
111-
<div>
112-
Shadow map texture width in pixels.<br />
113-
Default — *512*.
114-
</div>
115-
116-
<h3>.[page:Integer shadowMapHeight]</h3>
117-
<div>
118-
Shadow map texture height in pixels.<br />
119-
Default — *512*.
120-
</div>
121-
122-
<h3>.[page:Float shadowBias]</h3>
123-
<div>
124-
Shadow map bias.<br />
125-
Default — *0*.
126-
</div>
127-
128-
<h3>.[page:Float shadowDarkness]</h3>
129-
<div>
130-
Darkness of shadow casted by this light (from *0* to *1*).<br />
131-
Default — *0.5*.
132-
</div>
133-
134-
<h3>.[page:Integer shadowMapWidth]</h3>
135-
<div>
136-
Shadow map texture width in pixels.<br />
137-
Default — *512*.
138-
</div>
139-
140-
<h3>.[page:Integer shadowMapHeight]</h3>
141-
<div>
142-
Shadow map texture height in pixels.<br />
143-
Default — *512*.
144-
</div>
145-
146-
<h2>Source</h2>
147-
148-
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
149-
</body>
150-
</html>
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<script src="../../list.js"></script>
6+
<script src="../../page.js"></script>
7+
<link type="text/css" rel="stylesheet" href="../../page.css" />
8+
</head>
9+
<body>
10+
[page:Object3D] &rarr; [page:Light] &rarr;
11+
12+
<h1>[name]</h1>
13+
14+
<div class="desc">A point light that can cast shadow in one direction.</div>
15+
16+
<div class="desc">Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].</div>
17+
18+
19+
<h2>Example</h2>
20+
21+
<code>// white spotlight shining from the side, casting shadow
22+
23+
var spotLight = new THREE.SpotLight( 0xffffff );
24+
spotLight.position.set( 100, 1000, 100 );
25+
26+
spotLight.castShadow = true;
27+
28+
spotLight.shadowMapWidth = 1024;
29+
spotLight.shadowMapHeight = 1024;
30+
31+
spotLight.shadowCameraNear = 500;
32+
spotLight.shadowCameraFar = 4000;
33+
spotLight.shadowCameraFov = 30;
34+
35+
scene.add( spotLight );</code>
36+
37+
38+
<h2>Constructor</h2>
39+
40+
<h3>[name]( [page:Float color], [page:Float intensity], [page:Float distance], [page:Boolean castShadow] )</h3>
41+
42+
<h2>Properties</h2>
43+
44+
<h3>.[page:Vector3 position]</h3>
45+
<div>
46+
Light's position.<br />
47+
Default — *new THREE.Vector3()*.
48+
</div>
49+
50+
<h3>.[page:Object3D target]</h3>
51+
<div>
52+
Spotlight focus points at target.position.<br />
53+
Default position — *(0,0,0)*.
54+
</div>
55+
56+
<h3>.[page:Float intensity]</h3>
57+
<div>
58+
Light's intensity.<br />
59+
Default — *1.0*.
60+
</div>
61+
62+
<h3>.[page:Float distance]</h3>
63+
<div>
64+
If non-zero, light will attenuate linearly from maximum intensity at light *position* down to zero at *distance*.<br />
65+
Default — *0.0*.
66+
</div>
67+
68+
<h3>.[page:Float angle]</h3>
69+
<div>
70+
Maximum extent of the spotlight, in radians, from its direction.<br />
71+
Default — *Math.PI/2*.
72+
</div>
73+
74+
<h3>.[page:Float exponent]</h3>
75+
<div>
76+
Rapidity of the falloff of light from its target direction.<br />
77+
Default — *10.0*.
78+
</div>
79+
80+
<h3>.[page:Boolean castShadow]</h3>
81+
<div>
82+
If set to *true* light will cast dynamic shadows. *Warning*: This is expensive and requires tweaking to get shadows looking right.<br />
83+
Default — *false*.
84+
</div>
85+
86+
<h3>.[page:Boolean onlyShadow]</h3>
87+
<div>
88+
If set to *true* light will only cast shadow but not contribute any lighting (as if *intensity* was 0 but cheaper to compute).<br />
89+
Default — *false*.
90+
</div>
91+
92+
<h3>.[page:Float shadowCameraNear]</h3>
93+
<div>
94+
Perspective shadow camera frustum <em>near</em> parameter.<br />
95+
Default — *50*.
96+
</div>
97+
98+
<h3>.[page:Float shadowCameraFar]</h3>
99+
<div>
100+
Perspective shadow camera frustum <em>far</em> parameter.<br />
101+
Default — *5000*.
102+
</div>
103+
104+
<h3>.[page:Float shadowCameraFov]</h3>
105+
<div>
106+
Perspective shadow camera frustum <em>field of view</em> parameter.<br />
107+
Default — *50*.
108+
</div>
109+
110+
<h3>.[page:Boolean shadowCameraVisible]</h3>
111+
<div>
112+
Show debug shadow camera frustum.<br />
113+
Default — *false*.
114+
</div>
115+
116+
<h3>.[page:Float shadowBias]</h3>
117+
<div>
118+
Shadow map bias.<br />
119+
Default — *0*.
120+
</div>
121+
122+
<h3>.[page:Float shadowDarkness]</h3>
123+
<div>
124+
Darkness of shadow casted by this light (from *0* to *1*).<br />
125+
Default — *0.5*.
126+
</div>
127+
128+
<h3>.[page:Integer shadowMapWidth]</h3>
129+
<div>
130+
Shadow map texture width in pixels.<br />
131+
Default — *512*.
132+
</div>
133+
134+
<h3>.[page:Integer shadowMapHeight]</h3>
135+
<div>
136+
Shadow map texture height in pixels.<br />
137+
Default — *512*.
138+
</div>
139+
140+
<h3>.[page:Float shadowBias]</h3>
141+
<div>
142+
Shadow map bias.<br />
143+
Default — *0*.
144+
</div>
145+
146+
<h3>.[page:Float shadowDarkness]</h3>
147+
<div>
148+
Darkness of shadow casted by this light (from *0* to *1*).<br />
149+
Default — *0.5*.
150+
</div>
151+
152+
<h3>.[page:Integer shadowMapWidth]</h3>
153+
<div>
154+
Shadow map texture width in pixels.<br />
155+
Default — *512*.
156+
</div>
157+
158+
<h3>.[page:Integer shadowMapHeight]</h3>
159+
<div>
160+
Shadow map texture height in pixels.<br />
161+
Default — *512*.
162+
</div>
163+
164+
<h2>Source</h2>
165+
166+
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
167+
</body>
168+
</html>

docs/manual/introduction/Creating-a-scene.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ <h1>[name]</h1>
1111

1212
<div>The goal of this section is to give a brief introduction to Three.js. We will start by setting up a scene, with a spinning cube. A working example is provided at the bottom of the page, if you get stuck, and need help.</div>
1313

14-
<h2>What is Three.js</h2>
14+
<h2>What is Three.js?</h2>
1515

1616
<div>If you're reading this, you probably have some understanding of what Three.js is, and what it helps you with, but let's try to describe it briefly anyway.</div>
1717

18-
<div>Three.js is a a library that makes WebGL - 3D in the browser - very easy. While a simple cube in raw WebGL would turn out hundreds of lines of Javascript and shader code, a Three.js equivalent is only a fraction of that.</div>
18+
<div>Three.js is a library that makes WebGL - 3D in the browser - very easy. While a simple cube in raw WebGL would turn out hundreds of lines of Javascript and shader code, a Three.js equivalent is only a fraction of that.</div>
1919

2020
<h2>Before we start</h2>
2121
<div>Before you can use Three.js, you need somewhere to display it. Save the following HTML to a file on your computer, and open it in your browser.</div>

0 commit comments

Comments
 (0)