We expect you to learn basic 3D drawing, 3D transformations, perspective projection and 3D globe rendering.
The template program we are supplying for this assignment is the standard FLTK template program, which is given in chapter 9 of FLTK manual. This program draws a 3D cube on the screen and allows the user to rotate and translate the cube.
In this assignment you need to read a political boundary dataset and store each of the polygons. From the political dataset we get a bunch of 3D points. The points need to be converted from longitude and latitude to euclidean coordinates.
These 3D points have to be rendered as wireframe allowing basic 3D transformations like translation and rotation on it. The translation and rotation calls in 3D transformations are executed in a similar manner to 2D transformations. For example while rotating an object, the object should be moved to the origin, rotated and then translated back to its original position. However the number of degrees of freedom in these transformations is more than in the 2D case. In addition to the standard transformation commands you may also use glMultMatrix() to perform transformations.
Use a virtual trackball interface to rotate the globe, and click and drag to translate the globe. Have a reset button to reset the view (reinitialize the translation and rotation parameters). File control or a text box has to be used for getting the name of the political boundary data set.
Other glu commands and classes that might be useful are GLUquadric, gluNewQuadric(), and gluSphere().
Chapter 3 of red book is necessary for understanding the perspective projection in 3D transformations. In perspective projection objects that are closer to the viewpoint appear larger compared to the objects that are far away from the viewpoint. Perspective projection can be implemented using two function calls - glFrustum() and gluPerspective(). Viewing volume for a perspective projection is a frustum of the pyramid. You specify six parameters (left, right, bottom, top, near and far) for specifying the frustum. gluPerspective() is the another function call, which can be used instead of glFrustum(). Here you specify the field of view, aspect ratio, near plane and far plane. In both the cases the viewpoint is fixed and cannot be changed using the above two commands. Try using gluLookAt() to set your viewpoint at arbitrary position and change the viewing direction.