Computer graphics/2013-2014/Laboratory 5

Placing text in your scene
In (J)OGL one can place text at certain coordinates (2D or 3D). This is easily achieved by using the GLUT API. The method (function) intended for displaying text is glutBitmapString.

Important: it should never be placed inside a glBegin/glEnd block.

Before using it we need however to specify the raster position (used to position pixel and bitmap write operations) by using the glRasterPos method (function). The object coordinates presented by glRasterPos are treated just like those given with glVertex methods (functions).

Simple Star Chart
In what follows we will put together what we have seen so far and create a simple 2D application which displays a Star Chart. A Star Chart is basically a projection (using for example the Polar Projection) of constellations, stars and other stellar objects on a screen (paper).

To do this we need an API for reading and computing the coordinates of our objects (constellations, stars, names) from some data files. A simple API which does the previous can be found here.

The next code fragment shows you how you it could be used:

Links:


 * Star Chart
 * Star Chart examples
 * Map projections
 * Tutorial on building 2D Star Charts