Why??

Why my lights are “LIGHTING” my whole environment ?? i mean, how can i make a spot light ?? i need code guys!

im using this code before i call my function to draw my obj model…

glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, @Light_WHITE );
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, @Light_WHITE );
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, @Light_BLACK );

i ll give a example!
i have a space ship (my .obj model) light by green light (environment) and a red spot light come next to the space ship lighting the hull with constant velocity…

can somebody help me???

will be great!

thank you!

Hi gelero I had a similar problem.

When you set your light position the first 3 parameter set the x,y,z position of the light but there’s a 4th parameter.
If you set it to 0 it means the light is a directional light ( from a point very far so it lights all the scene )
I solved my problem by setting it to 1
it means it’s a positional light ! it’s what you want !
try it and tell me if it was the same problem.


Evil-Dog
Sleep is a waste of time

Bulls-Eye, Evil-Dog!!!

thank you!

but, i still have a doubt…
directional light is the light for every direction ???

Directional Light is like what we get from tghe sun. The light rays are coming from the same dircetion everywhere.

ok… and how can i control de POWER of the light??
the SHININESS…

UP!!!

ok… and how can i control de POWER of the light??
the SHININESS