Original Post
Hi, i have problem modeling a spotlight that tracks the camera. I want the spotlight to be always at the same position and facing the same direction as the camera. for this i tried te following: 1.process input and update the camera position/orientation. 2.spotlightposition = cameraposition (then i call glLightfv(GL_LIGHT0,GL_POSITION,Position); ) 3.spotlightdirection = cameradirection ( calculated with lookat-position) (then i call glLightfv(GL_LIGHT0,GL_SPOT_DIRECTION,direction); ) the position part seems to be working properly but the direction stuff seems to be inverted: when the camera rotates left, the spotlight seems to be rotating right, etc. i suspect the problem is with the way spotlight direction vector is passed in glLightfv(...) but can't seem to figure it out. if needed, i can post the code as well.