Original Post
I'm working on a point and select interface for my game. When the user clicks, I'd like to be able to highlight what he clicked on with a circle. I've gone through NeHe's tutorial for selecting an object and done the general case for when the object is at (0,0,0) Here's my code for that:
glTranslatef(xtranslate, ytranslate, 0);
glTranslatef(0, 0, zoomfactor);
if highlighted
CreateCircle(48, 1.2*targetradius, 0, 0);
glRotatef(xrot, 1, 0, 0);
glRotatef(yrot, 0, 1, 0);
//draw object
The problem now is if the object is at (x,y,z). The circle obviously won't be highlighting the object anymore. How do I get the circle to recenter on the object? I've tried using glTranslate(object.x, object.y, object.z) but that doesn't seem to work, or I'm not using it right, I don't know.