Archived

This topic is now archived and is closed to further replies.

tyreth

Light with glOrtho()

Recommended Posts

tyreth    122
I'm having problem with light objects while in ortho mode. I use the following to switch into ortho: glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0, video->width, 0, video->height, -200, 200); MatrixMode(GL_MODELVIEW); Am I missing anything, or doing stuff I don't need to? Here's the problems. The light does not seem to shine very bright at all, and does not seem to change position. GLfloat LightPosition[] = { sin(rotation) * 200, cos(rotation) * 200, 0.0f, 1.0f }; glLightfv(GL_LIGHT0, GL_POSITION, LightPosition); glEnable(GL_LIGHT0); (basically, the light should go around the object in a circle, I have tested these calculations with a visible object, and they are correct). The light does seem to move a little bit, but not noticeably, and not where it should. I have printed the co-ordinates of LightPosition in realtime to the screen and they are what they should be, so that's not the problem. I'm thinking it's maybe in my switch into glOrtho that's potentially wrong, causing light to be displayed wrong. Any suggestions would be appreciated. Edit: Woops, figured out the light position problem. I forgot to translate the position of the light, working position is: GLfloat LightPosition[] = { (sin(rotation) * 200) + (video->width/2), (cos(rotation) * 200) + (video->height/2), 0.0f, 1.0f }; I'm still having a problem with the brightness of the light. Is there a way to make lights brighter? If you have a page reference in the red book that would be great, thanks. [edited by - tyreth on April 29, 2002 10:57:46 PM]

Share this post


Link to post
Share on other sites
zedzeek    529
float dif[] = {10,10,10,10};
glLight..( GL_LIGHT0, GL_DIFFUSE, dif );
bright enuf?

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites