SEARCH
TOOLBOX
LANGUAGES
Lights

Lights

From SOFAWiki

Jump to: navigation, search

Lights

One white global light illuminates the scene by default. This can be changed through a light manager object and a certain number of lights (limited by OpenGL).

The first step is to add the object called LightManager, preferably at the top of the scene file.

<LightManager />

After that, we can add 3 different kinds of lights :

  • a positional light (parameters : color, position) ;
<PositionalLight position="0 -5 10" />
  • a directional light (parameters : color, direction) ;
<DirectionalLight direction="0 5 0" />
  • a spotlight (parameters : color, position, direction, cut off, exponent, attenuation)
<SpotLight position="-3 2 5" direction="0 0 -1" />