I have a small program where I can move around with the camera by moving and rotating all the objects in the opposite direction. But it seems that the light source always stays in the same place, so it follows the camera. Since translate and rotate affect objects that are drawn after these actions, how could I get the light source to be positioned with rest of the objects?
Seems like you are setting the lightposition before translation/rotation.
First you need to translate/rotate camera, then place light, and then render objects.