Three.js 08 Light - yoshiweb/labs GitHub Wiki
Three.js 08 ă©ă€ă
DirectionalLight
æčćăæ±șăăŠć
ăćœăŠă
http://threejs.org/docs/#Reference/Lights/DirectionalLight
var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
directionalLight.position.set( 0, 1, 1 );
scene.add( directionalLight );
https://yoshiweb.github.io/labs/html/threejs/basic/08-1.html
DirectionalLight(hex, intensity)
- hex -- ć ăźèČ Numeric value of the RGB component of the color.
- intensity -- ć ăźćŒ·ă Numeric value of the light's strength/intensity.
AmbientLight
èȘç¶ć
ăźăăă«ć
šäœçă«ć
ăćœăŠă
http://threejs.org/docs/#Reference/Lights/AmbientLight
var light = new THREE.AmbientLight( 0x404040 ); // soft white light
scene.add( light );
https://yoshiweb.github.io/labs/html/threejs/basic/08-2.html
AmbientLight( hex )
- hex â ć
ăźèČ Numeric value of the RGB component of the color.
This creates an Ambientlight with a color.
SpotLight
äžéšă ăć
ăćœăŠă
http://threejs.org/docs/#Reference/Lights/SpotLight
// white spotlight shining from the side, casting shadow
var spotLight = new THREE.SpotLight( 0xffffff );
spotLight.position.set( 100, 1000, 100 );
spotLight.castShadow = true;
spotLight.shadowMapWidth = 1024;
spotLight.shadowMapHeight = 1024;
spotLight.shadowCameraNear = 500;
spotLight.shadowCameraFar = 4000;
spotLight.shadowCameraFov = 30;
scene.add( spotLight );
https://yoshiweb.github.io/labs/html/threejs/basic/08-3.html
SpotLight(hex, intensity, distance, angle, exponent, decay)
- hex â Numeric value of the RGB component of the color.
- intensity â Numeric value of the light's strength/intensity.
- distance -- Maximum distance from origin where light will shine whose intensity is attenuated linearly based on distance from origin.
- angle -- Maximum angle of light dispersion from its direction whose upper bound is Math.PI/2.
- exponent -- Rapidity of the falloff of light from its target direction.
- decay -- The amount the light dims along the distance of the light.
ăăźä»
http://threejs.org/docs/#Reference/Lights/HemisphereLight http://threejs.org/docs/#Reference/Lights/Light http://threejs.org/docs/#Reference/Lights/PointLight