🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Why all the objects become white when using glScale?

Started by
1 comment, last by WWWFdisk 18 years, 3 months ago
I'm a new learner who benefits a lot from NeHe's OpenGL Tutorial. However, when I'm trying to "do" something myself, the problem comes... I created four spheres with conditions like bellowing: glEnable GL_DEPTH_TEST GL_LIGHTING(direction light from +Z, one ambient, one diffuse) GL_COLOR_MATERIAL ShadeModel GL_SMOOTH glOrtho The color of spheres is glColor4f 0.8, 0.3, 0.1, 1.0 I tried rotating, translateing and scaling with my mouse. When I scale, I found all the spheres' color become white when they become small. If I turn off the light, this problem does not exist any more. But of course, the spheres are only 2D disks now. Please help me to avoid this problem. Thank you very much!
Advertisement
See here (#1) that's most likely your problem.
Thanks to Cocalus!!! And also the writer Mark J. Kilgard.
The problem is fixed by adding
glEnable(GL_NORMALIZE);

This article is very helpful!
I think all programmers of OpenGL should read it..hehe!
http://www.opengl.org/resources/features/KilgardTechniques/oglpitfall/

This topic is closed to new replies.

Advertisement