A light source: ambient, directional, or point.
Fields
:type-:ambient,:directional, or:point:color-{r, g, b}color, channels 0-255:intensity- scalar brightness (defaults to1.0):direction-{x, y, z}direction toward the light (only for:directional):position-{x, y, z}world position (only for:point)
Prefer the constructors over building the struct by hand.
Examples
iex> light = ExRatatui.ThreeD.Light.ambient({255, 255, 255}, 0.15)
iex> {light.type, light.color, light.intensity}
{:ambient, {255, 255, 255}, 0.15}
iex> light = ExRatatui.ThreeD.Light.directional({-1.0, -1.0, -1.0}, {255, 255, 255})
iex> {light.type, light.direction, light.intensity}
{:directional, {-1.0, -1.0, -1.0}, 1.0}
iex> light = ExRatatui.ThreeD.Light.point({2.0, 3.0, 2.0}, {255, 220, 180})
iex> {light.type, light.position}
{:point, {2.0, 3.0, 2.0}}
Summary
Functions
Constant ambient illumination.
A directional light. direction points toward the light source.
A point light at position.
Types
Functions
Constant ambient illumination.
A directional light. direction points toward the light source.
Options: :intensity (defaults to 1.0).
A point light at position.
Options: :intensity (defaults to 1.0).