but it is still positioned on one side of my object and seems to move along with it while i rotate the object.could anyone advise me if i have not initialised it properly.
Thanks in advance!
You are translating/rotating the light when you rotate your scene.
Use glPushMatrix() before you translate/rotate the scene, this copies the current model matrix, once you have updated your world you can replace the “old” model matrix by using glPopMatrix()