Main Page   Namespace List   Alphabetical List   Data Structures   File List   Data Fields   Globals  

Lighting Class Reference


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


Detailed Description

Lighting management Includes spot drawing procedure, some computation (vectorail product, normalisation - which should be replaced by algebra3) and lighting model parameters


Constructor & Destructor Documentation

Lighting::Lighting  
 

Inits Lighting parameters from the file user.ini


Member Function Documentation

void Lighting::computeNormals SCENE   scene
 

Computation of all the normals in the scene

void Lighting::drawSpot GLfloat    x,
GLfloat    y,
GLfloat    z
 

Draws a spot at the point x,y,z using 2 spheres and a cone

void Lighting::drawSpots void   
 

Draws the 2 spots

void Lighting::loadConfigData void   
 

Loads light data from config file

float Lighting::norm vec4f    v
 

Euclidian norm on the first 3 components

Parameters:
v  a float[3]

void Lighting::specifyLighting void   
 

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

void Lighting::vectorialProd vec4f    u,
vec4f    v,
vec4f    w
 

Vectorial product w = u ^ v

Parameters:
u  the 1st vec4fe
v  the 2nd vec4fe
w  the result


Field Documentation

GLfloat Lighting::ambient[4]
 

ambient light color

int Lighting::bLocalViewer
 

local lighting effects

int Lighting::cutoff
 

angle of the lights

GLfloat Lighting::diffuse[4]
 

diffuse light color

GLfloat Lighting::direction[3]
 

direction of spot lights

int Lighting::drawSmooth
 

smooth shading ON/OFF

int Lighting::enabled
 

lighting is enabled ?

int Lighting::exponent
 

intensity of the lights

GLfloat Lighting::posSpot1[4]
 

position of first spot

GLfloat Lighting::posSpot2[4]
 

position of second spot

GLfloat Lighting::specular[4]
 

specular light color


The documentation for this class was generated from the following files:
Generated on Wed Feb 18 16:32:54 2004 for POVAMA by doxygen1.2.18