Search code examples
openglgraphicsprojectiongluorthographic

Orthographic projection of a sphere to get a circle (OpenGL -- newbie)


I am trying to draw a very simple, black and white stick figure whose head is a sphere. The background is black and I am drawing with white color. The orthographic projection of the sphere head should be a white circle with line width of 3 pixels. Everything behind the head should be hidden (DEPTH_TEST enabled). I would like to avoid using glut but glu is OK.

What is the simplest way to achive this?


Solution

  • Not using a sphere. A sphere will be composed of several triangles, and if drawn using a line mode you'll end up with a wireframe sphere. Silouhette Shaders are overkill here. The simplemost solution is drawing a line circle, that's oriented towards the camera (=origin), i.e. a billboard effect.