I like to draw spheres in an OpenGL environment using gluSphere(). However, I wish I could draw a border around the sphere, with the border being a circle aligned perfectly with the camera frame so that the circle is in fact always a circle, and not an ellipse when seen from different angles. I'm using a framework that sets up the OpenGL environment for me and does the handling of the camera. When I'm drawing, I'm always thinking in world coordinates, so I find accomplishing this task difficult. I would love to have a solution embedded into my deepest level of OpenGL drawing commands, like so:
// Draws a sphere with a camera plane aligned border around it (you wish).
void GLLib::drawBorderedSphere(float radius)
{
static GLUquadric* quadric = gluNewQuadric();
gluSphere(quadric, radius, 32, 32);
// Determine a rotation matrix depending on the current camera configuration.
// glRotate(somehow);
// drawCircle(radius); <-- this I already have.
}
Can anyone help?