Thanks.
🎉 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!
Rotating Line Strips in OpenGL
GLfloat ambient[] {0.5,0.5,0.5,1.0};
GLfloat diffuse[] {1.0,1.0,1.0,1.0};
glMaterialfv(GL_AMBIENT, ambient);
glMaterialfv(GL_DIFFUSE, diffuse);
glColorfv(diffuse);
will set up a "white" material with a half gray "unlit" color. this tends to work well to give the appropriate lighting cues, and yet not cause dissapearing lines. The glColor*() function gives the appropriate color to the object in case lighting is turned off... not needed unless you plan to turn lights off for some reason.
If you turn off lighting before drawing your lines, you will note that the line looks complete. I have found that adjusting the ambient material properties works well in lighted scenes to avoid the annoying vanishing lines.