Example:
light -1000 -1000 1000 0 0 0 0.8 0.3 0.8 0.8 0.8 0.8

light 1000 1000 1000 0 0 0 0.2 0.2 0.5 0.8 0.8 0.8
ambient 0.1 0.1 0.1

light x y z ar ag ab dr dg db sr sg sb: define the light information.

x y z: the position of the light (Please set the w of light as 1.0 to make it a point light source)
ar ag ab: define the ambient term
dr dg db: define the diffuse term
sr sg sb: define the specular term

ambient r g b: define the ambient light from environment.
Please use this function: glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);

Go to top