Next: , Previous: , Up: Graphics   [Contents][Index]


5.3.9 Lights

The (chickadee graphics light) module provides a data type for dynamic lights that can be used to light 3D objects (such as Models or Meshes.)

There are 3 types of dynamic lights:

Procedure: make-point-light [#:position (vec3 0 0 0)] [#:color black] [#:intensity 1]

Return a new point light located at position that emits color light.

Procedure: make-directional-light [#:direction (vec3 0 -1 0)] [#:color black] [#:intensity 1]

Return a new directional light that emits color light in direction.

Procedure: make-spot-light [#:position (vec3 0 0 0)] [#:direction (vec3 0 -1 0)] [#:color black] [#:cut-off π/4] [#:intensity 1]

Return a new spot light located at position that emits color light in direction in a cone that cuts off at cut-off radians.

Procedure: point-light? obj

Return #t if obj is a point light.

Procedure: directional-light? obj

Return #t if obj is a directional light.

Procedure: spot-light? obj

Return #t if obj is a spot light.

Procedure: light-type light

Return the type of light, one of:

Procedure: light-color light

Return the color of light.

Procedure: light-intensity light

Return the intensity of light.

Procedure: light-position light

Return the position of light. The value is irrelevant for directional lights.

Procedure: light-direction light

Return the direction of light. The value is irrelevant for point lights.

Procedure: light-cut-off light

Return the cosine of the cut off angle of light. The value is only relevant for spot lights.

Procedure: set-light-color! light color

Set the color of light to color.

Procedure: set-light-position! light position

Set the position of light to position.

Procedure: set-light-direction! light direction

Set the direction of light to direction.

Procedure: set-light-cut-off! light cut-off

Set the cut off angle of light to cut-off.


Next: , Previous: , Up: Graphics   [Contents][Index]