Jump to content
  • Advertisement
Sign in to follow this  
dmichel

OpenGL lighting problem with ellipsoids

This topic is 4253 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi All, I am new to OpenGL so I hope this isn't a dumb question...but I am kind of stuck... I am drawing a ellipsoid by scaling a sphere using glScalef. However, the result is looking pretty bad with strange shadows,etc... When I remove the scaling function, it looks great, but as soon as the scaling is there, it doesn't render that good anymore. I guess this is due to a problem with normales (is it ?) but I have got no clue on what to do ? any ideas ? Cheers Dav

Share this post


Link to post
Share on other sites
Advertisement
great ! cheers mate...

but just out of curiosity...what was the problem exactly and what does glEnable(GL_NORMALIZE) do ?

cheers

dav

Share this post


Link to post
Share on other sites
If you scale your mesh, the normals are scaled, too. GL_NORMALIZE tells OpenGL that the normals should be renormalized (brought to length 1) before lighting is applied. Since the length of a normal affects the lighting equation, a non-normalized normal (;)) produces false results.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!