Public Methods | |
Lighting () | |
void | loadConfigData (void) |
void | specifyLighting (void) |
void | drawSpots (void) |
void | drawSpot (GLfloat x, GLfloat y, GLfloat z) |
float | norm (vec4f v) |
void | vectorialProd (vec4f u, vec4f v, vec4f w) |
void | computeNormals (SCENE *scene) |
Data Fields | |
GLfloat | ambient [4] |
ambient light color | |
GLfloat | diffuse [4] |
diffuse light color | |
GLfloat | specular [4] |
specular light color | |
GLfloat | posSpot1 [4] |
position of first spot | |
GLfloat | posSpot2 [4] |
position of second spot | |
GLfloat | direction [3] |
direction of spot lights | |
int | enabled |
lighting is enabled ? | |
int | cutoff |
angle of the lights | |
int | exponent |
intensity of the lights | |
int | bLocalViewer |
local lighting effects | |
int | drawSmooth |
smooth shading ON/OFF |
|
Inits Lighting parameters from the file user.ini |
|
Computation of all the normals in the scene |
|
Draws a spot at the point x,y,z using 2 spheres and a cone |
|
Draws the 2 spots |
|
Loads light data from config file |
|
Euclidian norm on the first 3 components
|
|
Replaces lights in case a rotation or a translation has occured because moving the scene often means to move lights too if you want to move the 2 lights with respect to the scene, you should consider modifying posSpot1 and posSpot2 |
|
Vectorial product w = u ^ v
|
|
ambient light color
|
|
local lighting effects
|
|
angle of the lights
|
|
diffuse light color
|
|
direction of spot lights
|
|
smooth shading ON/OFF
|
|
lighting is enabled ?
|
|
intensity of the lights
|
|
position of first spot
|
|
position of second spot
|
|
specular light color
|