Render3D. DirectionalLight3D

DirectionalLight3D - A Light3D that shines from far away with no falloff, like sunlight

  • It shines from its position toward the origin, like a three.js DirectionalLight: only the direction to it counts, so moving it or its parent swings the light around; parent it to a sun in the sky and it follows
  • It cannot sit on the origin, since that leaves no direction
  • Like every Light3D it casts no shadow and makes no highlight, only the sun, render3D.sunDirection, does

Constructor

new DirectionalLight3D(pos3Dopt, coloropt, intensityopt)

Create a directional light

Parameters:
NameTypeAttributesDefaultDescription
pos3DVector3<optional>

Where it shines from, toward the origin

colorColor<optional>

Light color, its alpha fades it

intensitynumber<optional>
1

Brightness, multiplies the color, above 1 is brighter than white

Example
const fill = new DirectionalLight3D(vec3(-1, 1, 1), hsl(.6, .5, .3)); // from the back left and above

Extends

  • Light3D