Hello.
Im having same issue like here (old topic):
My pic
Im using OpenGL 1.1 and VS2008 Express.
Dont ask why old GL and stuff. Thats not the point here.
I created 15 spotlights and all of them are like half circles. See my PIC!!
Any ideas why?
Im using built in OpenGL lights. Im using multipass method to get these 15 lights…
Some code:
// draw func
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(-20, 20, -55); // moves a bit back and up and left for better view!
glRotatef(180, 1, 0, 0);
gluLookAt( 0.0f, -1.48, 0.0f,
0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0);
glLightfv(GL_LIGHT0+j, GL_POSITION, VECTOR4D(lights[i*8+j].position));
glLightfv(GL_LIGHT0+j, GL_DIFFUSE, lights[i*8+j].color);
glLightfv(GL_LIGHT0+j, GL_SPOT_DIRECTION, spotDirection);
glLightf(GL_LIGHT0+j, GL_SPOT_CUTOFF,60.0f);
glLightf(GL_LIGHT0+j, GL_SPOT_EXPONENT, -1.0f);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, white*0.1f); //white is just 1,1,1,1.0
glMaterialfv(GL_FRONT, GL_AMBIENT, white);
glMaterialfv(GL_FRONT, GL_DIFFUSE, white);
glEnable(GL_LIGHTING);
// INIT func
spotDirection[0]=0.0;
spotDirection[1]=-1.0;
spotDirection[2]=0.0;
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
//Depth states
glClearDepth(1.0f);
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
Nothing special really. I just dont understand why its half circles.
If there is more code needed i will post.
Its not big.
TIA!!
EDIT:
I was missing normals.
This fixed it
glNormal3f(0,1,0);
Result:
[ATTACH=CONFIG]1950[/ATTACH]
Im leaving it here as reference in case anybody runs into same problem.
Who uses GL 1.1 anyway? But anyway!!!