PDA

View Full Version : Normals Having No Effect???



no-one
08-28-2001, 05:00 PM
im writing a GL modelviewer and im stuck as to why the model(a ball) has a massive bright spot and the opposite side is dull...
now i know what you thinkin the fools got his normals backwards on the dim side,
but i dont think thats it since, when i dont use my normals the same thing happens, and the light isn't moving. it also has several extremely bright spots in various locations(my guess is specular problems)????

ive written similar programs many o' times and ive never had this problem ever!!!

and pretaining to the topic name MY NORMALS HAVE NO EFFECT AT ALL...

thanks,

[This message has been edited by no-one (edited 08-28-2001).]

hkyProgrammer
08-28-2001, 05:55 PM
Hi,

I am not an expert in OpenGL yet but I may be able to help.

You stated that it is bright on one side and dark on the other. You also said that the light does not move.

One problem could be that you are transforming the light as well as your model on each rendering pass, this will cause the light to move with the model (the spot never moves).

I hope that helped.

Paulus
08-28-2001, 06:56 PM
Hey, it has nothing to do with the normal vectors -they are fine!The normal vectors are defined very well by the function that draws sphere.You are not supposed to redefine them!Your problem has to do with the light's position and settings.The problem is there-good luck http://www.opengl.org/discussion_boards/ubb/wink.gif

no-one
08-28-2001, 07:09 PM
hkyProgrammer,

actually they are moved(if the light moves) seperatly using matrix pushes...
thanks though.

Paulus,
>Your problem has to do with the light's position and settings.The problem is there-good luck<

settings match old working programs, and the position in this case doesnt change... i cant figure it out ive ben on this for 2 weeks...
do you have any idea what setting could cause this i have no clue?????

and thank you once again.

[This message has been edited by no-one (edited 08-28-2001).]

no-one
08-28-2001, 07:47 PM
and BTW: this might help so...
the smooth shading looks like crap also it lights the edges of the polygons brighter than the centers so it looks kinda nasty and this is abnormal...

Paulus
08-29-2001, 05:27 PM
If you use the glScale function then you have to enable automatic renormalization of vectors using glEnable(GL_NORMALIZE) -have you tried that?If you do not then what you describe is natural.

no-one
08-29-2001, 08:19 PM
>If you use the glScale function then you have to enable automatic renormalization of vectors using glEnable(GL_NORMALIZE) -have you tried that?If you do not then what you describe is natural.<

glScale is never used anywhere not eventyped anywhere...

zed
08-29-2001, 11:22 PM
>>im writing a GL modelviewer and im stuck as to why the model(a ball) has a massive bright spot and the opposite side is dull...
now i know what you thinkin the fools got his normals backwards on the dim side,<<

a bit o a strange question, thjis is normal behaviour if u want the other side lit as well either stick another light on the the other side or increase the first lights ambient coour

no-one
08-30-2001, 08:08 AM
actually only the object moves the light remains constant i have verified this with other objects yet all have the same problem with the bright and dark spots...

glPushMatrix()
//rotate then draw the object
glPopMatrix()
//draw the light

light doesnt move... all sides of the object should be lit evenly as it rotates

DFrey
08-30-2001, 08:30 AM
If you do a search on this board you should find a complete program I posted for someone else that draws a light revolving around a sphere. It might be of some use to you.

no-one
08-30-2001, 07:45 PM
thanks DFrey,

i'll look into it...