forked from mrdoob/three.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirectionalLight.html
More file actions
86 lines (67 loc) · 2.79 KB
/
DirectionalLight.html
File metadata and controls
86 lines (67 loc) · 2.79 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Object3D] → [page:Light] →
<h1>[name]</h1>
<div class="desc">
Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].
</div>
<h2>Example</h2>
<div>[example:canvas_morphtargets_horse morphtargets / horse ]</div>
<div>[example:misc_controls_fly controls / fly ]</div>
<div>[example:misc_lights_test lights / test ]</div>
<div>[example:vr_cubes cubes ]</div>
<div>[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]</div>
<div>[example:webgl_effects_stereo effects / stereo ]</div>
<div>[example:webgl_geometry_extrude_splines geometry / extrude / splines ]</div>
<div>[example:webgl_materials_bumpmap materials / bumpmap ]</div>
<div>[example:webgl_materials_cubemap_balls_reflection materials / cubemap / balls / reflection ]</div>
<code>// White directional light at half intensity shining from the top.
var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
directionalLight.position.set( 0, 1, 0 );
scene.add( directionalLight );</code>
<h2>Constructor</h2>
<h3>[name]( [page:Integer hex], [page:Float intensity] )</h3>
<div>
[page:Integer hex] -- Numeric value of the RGB component of the color. <br />
[page:Float intensity] -- Numeric value of the light's strength/intensity.
</div>
<div>
Creates a light that shines from a specific direction not from a specific position. This light will behave
as though it is infinitely far away and the rays produced from it are all parallel. The best
analogy would be a light source that acts like the sun: the sun is so far away that all sunlight
hitting objects comes from the same angle.
</div>
<h2>Properties</h2>
See the base [page:Light Light] class for common properties.
<h3>[property:Object3D target]</h3>
<div>
Target used for shadow camera orientation.
</div>
<h3>[property:DirectionalLightShadow shadow]</h3>
<div>
This property stores all relevant information for rendering the shadow of the light.<br />
</div>
<h3>[property:Boolean castShadow]</h3>
<div>
If set to *true* light will cast dynamic shadows. *Warning*: This is expensive and requires tweaking to get shadows looking right.<br />
Default — *false*.
</div>
<h2>Methods</h2>
See the base [page:Light Light] class for common methods.
<h3>[method:DirectionalLight copy]( [page:DirectionalLight source] )</h3>
<div>
<br />
Copies value of *source* to this DirectionalLight object.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>