Description: Example program illustrating a simple use of lighting. Creates six spheres of different fully saturated colors. Adds a...
Description: Example program illustrating a simple use of lighting. Creates six spheres of different fully saturated colors. Adds a white light that slow rotates around the spheres.
USAGE: Press "r" key to toggle (off and on) running the animation
Press "s" key to single-step animation.
The up arrow key and down array key control the time step used in the animation rate. This will speed up or slow down the rate at which the light revolves around the spheres.
Press ESCAPE to exit.
This lighting model is build on the
basis of phong model,Which supports three types of light material interactions
namely Specular, ambient, diffuse. The ambient source color represents the
interaction of a light source with surface whereas the specular source color is
designed to produce the desired color of a specular highlights.
Lighting model is built by summing the
contributions for all the light sources at each point we wish to light. For
each light source, have to compute the amount of light reflected for each of the
nine terms in the illumination array. The contribution can be computed for
each color source by adding the ambient, diffuse, specular components.
There are four vector parameters that
can set, the position of light source and amount of ambient, diffuse, specular
Light associated with the source. Both
lighting should be enabled and particular source. When small amount of white
light is needed, even when all light sources are turned off or disabled following code can be used.
Glfloat global_ambient[]={0.1,0.1,0.1,0.1};
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,global_ambient);
Future
scope
Ø It
is the basic model of Simple Move Light
Ø It
will be used in the fields of animation.
Ø In
future this program can be improved by using of new opengl functions.
Computer Graphics Mini-Project Free Source Code Download
Project Code: Download
Header File: Download
We are giving the Computer Graphics Mini-Project free source code download. To help other students we need your help as well. Kindly if you modify this projects or any other kindly post email or post the projects code to help future students.
Header File: Download