No light
Without a light source you can only see the basic material.
Ambient light
This adds an ambiental light, not to basicMaterial though.
//subtle red ambient light
var ambientLight = new THREE.AmbientLight(0x660000);
scene.add(ambientLight);
Directional light
This adds a directional light (e.g. sun light) to the scene. A color and an intensity can be set. Optinal you can set the direction from where the light is coming by setting the position. In this example from the upper right.
//directional light
var directionalLight = new THREE.DirectionalLight(0xffffff,1);
directionalLight.position.set(1, 0, 1).normalize();
scene.add(directionalLight);
Hemisphere light
Hemisphere light is similar to directional light, but you can add a sky color and a ground color to it.
//hemisphere light
var hemisphereLight = new THREE.HemisphereLight(0xffffff,0xff0000,1);
hemisphereLight.position.set(1, 0, 1).normalize();
scene.add(hemisphereLight);
Point light
Point light effects lambert and phong (left) materials. Color, intensity and distance can be set.
var pointLight = new THREE.PointLight( 0xffffff,1 );
pointLight.position.set( 0, 0, 3 );
scene.add( pointLight );







Keine Kommentare:
Kommentar veröffentlichen