First I would suggest that you post that question in the beginner or advanced forum
It’s just simple trigonometry.
In glulookat, the 3(eyex,eyey,eyez) first point are the position of the camera. The other 3(centerx,centery,centerz) are the point where the eye look at. The 3 last or the position of the up-vector.
So, the “looking” direction vector is :
(centerx - eyex, centery - eyey, centerz - eyez).
Let’s say you only want the billboarding to happen when there is a y rotation(there is billboarding when you are horizontaly moving around the object)
Now let’s say that your billboarded polygon was on the x axis first at (X1,0,0) for center. you calculate the X angle between that point and the vector:
Xangle = atan (X1 / (centerx - eyex)
Rotangle = 90 - Xangle;
this is just one case. depending if you are in wich quadrant around the object. I’m sure you can easely figure it out by taking a sheet of paper and doing some tests.