dangit, nothing is working!
could someone show me a working example of lighting a textured pyramid (drawn by primitive functions, not a model) with a red light lighting up the faces as it spins...
blah! how to make this red light work...
I always have troubles with positioning my lights. What happens if you leave the lights position to default?
if youre using textures you must set the texEnvMode to Modulate, or your texture will overwrite all lighting effects
actually i spoke too soon, doesnt work...
thats how im initialzing my code (yes, GL_LIGHTING is enabled inside of opengl.InitOpenGL(); LIGHT0 is disabled cuz the open gl class automatically enables it...)
help?
bool Init(){ opengl.EnableOpenGL(myapp.GetHwnd()); opengl.ResizeOpenGL(myapp.mwidth,myapp.mheight); opengl.InitOpenGL(); glDisable(GL_LIGHT0); GLfloat lightambient[] = {0.5f,0.5f,0.5f,1.0f}; GLfloat lightdiffuse[] = {1.0f,0.0f,0.0f,1.0f}; GLfloat lightposition[] = {0.0f,0.0f,2.0f,1.0f}; glLightfv(GL_LIGHT1,GL_AMBIENT,lightambient); glLightfv(GL_LIGHT1,GL_DIFFUSE,lightdiffuse); glLightfv(GL_LIGHT1,GL_POSITION,lightposition); glEnable(GL_LIGHT1); glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE); myapp.Error(false,"% test",f); LoadGLTextures(); return true;}
thats how im initialzing my code (yes, GL_LIGHTING is enabled inside of opengl.InitOpenGL(); LIGHT0 is disabled cuz the open gl class automatically enables it...)
help?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement