API

Function createSpotLight

  • Creates a spot light: a cone of light from position aimed along direction.

    Parameters

    • position: [number, number, number]

      World-space position of the light.

    • direction: [number, number, number]

      World-space direction the cone points along.

    • angle: number

      Full cone angle in radians.

    • exponent: number

      Falloff exponent; higher values produce a sharper edge.

    • intensity: number = 1.0

      Scalar multiplier applied to the light's diffuse and specular contribution.

    Returns SpotLight

    Plain SpotLight data to be added to a scene via addToScene.