PDA

View Full Version : Why??



Gelero
10-01-2001, 08:54 AM
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!

Evil-Dog
10-01-2001, 09:55 AM
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*

Gelero
10-01-2001, 10:03 AM
Bulls-Eye, Evil-Dog!!!
http://www.opengl.org/discussion_boards/ubb/smile.gif
thank you!

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

Michael Steinberg
10-01-2001, 10:10 AM
Directional Light is like what we get from tghe sun. The light rays are coming from the same dircetion everywhere.

Gelero
10-01-2001, 10:16 AM
ok... and how can i control de POWER of the light??
the SHININESS...

Gelero
10-02-2001, 02:19 AM
UP!!!



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