提交 65fdb621 编写于 作者: R Ricardo Cabello

Merge pull request #6690 from sukhwant/lightDoc

Light doc
......@@ -17,7 +17,13 @@
<h2>Example</h2>
<div>[example:canvas_camera_orthographic camera / orthographic ]</div>
<div>[example:canvas_interactive_voxelpainter interactive / voxelpainter ]</div>
<div>[example:canvas_materials materials ]</div>
<div>[example:canvas_sandbox sandbox ]</div>
<div>[example:webgl_animation_cloth animation / cloth ]</div>
<div>[example:webgl_animation_skinning_blending animation / skinning / blending ]</div>
<code>var light = new THREE.AmbientLight( 0x404040 ); // soft white light
scene.add( light );</code>
......@@ -32,7 +38,19 @@ scene.add( light );</code>
This creates an Ambientlight with a color.
</div>
<h2>Methods</h2>
<h3>[method:AmbientLight clone]()</h3>
<div>
<br />
It returns a clone of Ambientlight.
</div>
<h3>[method:JSON toJSON]()</h3>
<div>
Return Ambientlight data in JSON format.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -15,6 +15,10 @@
<h2>Example</h2>
<h2>Example</h2>
<div>[example:webgldeferred_arealights arealights ]</div>
<code>areaLight1 = new THREE.AreaLight( 0xffffff, 1 );
areaLight1.position.set( 0.0001, 10.0001, -18.5001 );
areaLight1.rotation.set( -0.74719, 0.0001, 0.0001 );
......@@ -80,8 +84,7 @@ scene.add( areaLight1 );</code>
<div>
Sets or gets the attention of the light in linear space. This increases the attenuation quadratic with the distance from the light.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -17,7 +17,16 @@
<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 );
......@@ -58,7 +67,13 @@ scene.add( directionalLight );</code>
If set to *true* light will only cast shadow but not contribute any lighting (as if *intensity* was 0 but cheaper to compute).<br />
Default — *false*.
</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>
<h3>[property:Float shadowCameraNear]</h3>
<div>
Orthographic shadow camera frustum parameter.<br />
......@@ -199,8 +214,16 @@ scene.add( directionalLight );</code>
</div>
<h2>Methods</h2>
<h3>[method:DirectionalLight clone]()</h3>
<div>
It returns a clone of DirectionalLight.
</div>
<h3>[method:JSON toJSON]()</h3>
<div>
Return DirectionalLight data in JSON format.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -12,6 +12,18 @@
<h1>[name]</h1>
<div class="desc">A light source positioned directly above the scene.</div>
<h2>Example</h2>
<div>[example:webgl_lights_hemisphere lights / hemisphere ]</div>
<div>[example:misc_controls_pointerlock controls / pointerlock ]</div>
<div>[example:webgl_decals decals ]</div>
<div>[example:webgl_loader_collada_kinematics loader / collada / kinematics ]</div>
<div>[example:webgl_materials_lightmap materials / lightmap ]</div>
<div>[example:webgl_shaders_ocean shaders / ocean ]</div>
<code>var light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
scene.add( light );</code>
<h2>Constructor</h2>
......@@ -38,7 +50,17 @@
</div>
<h2>Methods</h2>
<h3>[method:HemisphereLight clone]()</h3>
<div>
<br />
It returns a clone of HemisphereLight.
</div>
<h3>[method:JSON toJSON]()</h3>
<div>
Return HemisphereLight data in JSON format.
</div>
<h2>Source</h2>
......
......@@ -32,7 +32,15 @@
<div>
Color of the light.<br />
</div>
<h2>Methods</h2>
<h3>[method:Light clone]()</h3>
<div>
<br />
It returns a clone of Light.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -18,6 +18,16 @@
<h2>Example</h2>
<div>[example:canvas_lights_pointlights lights / pointlights ]</div>
<div>[example:webgl_lights_pointlights lights / pointlights ]</div>
<div>[example:webgl_lights_pointlights2 lights / pointlights2 ]</div>
<div>[example:webgldeferred_animation animation ]</div>
<div>[example:webgldeferred_pointlights pointlights ]</div>
<div>[example:webgl_effects_anaglyph effects / anaglyph ]</div>
<div>[example:webgl_geometry_large_mesh geometry / large / mesh ]</div>
<div>[example:webgl_geometry_text geometry / text ]</div>
<div>[example:webgl_lensflares lensflares ]</div>
<code>var light = new THREE.PointLight( 0xff0000, 1, 100 );
light.position.set( 50, 50, 50 );
scene.add( light );</code>
......@@ -26,11 +36,12 @@ scene.add( light );</code>
<h2>Constructor</h2>
<h3>[name]([page:Integer hex], [page:Float intensity], [page:Number distance])</h3>
<h3>[name]([page:Integer hex], [page:Float intensity], [page:Number distance], [page:Float decay])</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. <br />
[page:Number distance] -- The distance of the light where the intensity is 0. When distance is 0, then the distance is endless.
[page:Number distance] -- The distance of the light where the intensity is 0. When distance is 0, then the distance is endless. <br />
[page:Float decay] -- The amount the light dims along the distance of the light.
</div>
<div>
Creates a light at a specific position in the scene. The light shines in all directions (roughly similar to a light bulb.)
......@@ -52,7 +63,24 @@ scene.add( light );</code>
Default — *0.0*.
</div>
<h3>[property:Float decay]</h3>
<div>
The amount the light dims along the distance of the light<br />
Default — *1*.
</div>
<h2>Methods</h2>
<h3>[method:PointLight clone]()</h3>
<div>
<br />
It returns a clone of PointLight.
</div>
<h3>[method:JSON toJSON]()</h3>
<div>
Return PointLight data in JSON format.
</div>
<h2>Source</h2>
......
......@@ -17,7 +17,13 @@
<h2>Example</h2>
<div>[example:webgl_interactive_cubes_gpu interactive / cubes / gpu ]</div>
<div>[example:webgl_interactive_draggablecubes interactive / draggablecubes ]</div>
<div>[example:webgl_materials_bumpmap_skin materials / bumpmap / skin ]</div>
<div>[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic ]</div>
<div>[example:webgl_morphtargets_md2 morphtargets / md2 ]</div>
<div>[example:webgl_shading_physical shading / physical ]</div>
<code>
// white spotlight shining from the side, casting shadow
......@@ -178,7 +184,16 @@
</div>
<h2>Methods</h2>
<h3>[method:SpotLight clone]()</h3>
<div>
<br />
It returns a clone of SpotLight.
</div>
<h3>[method:JSON toJSON]()</h3>
<div>
Return SpotLight data in JSON format.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册