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