Program 3, Due Friday October October 29th before midnight

Objectives:  Learn basic 3D interactive graphics programming.  Implement your first scientific visualization.  You will very likely be using parts of this program for homework 4, so code well.  This is not a trivial program.  If you wait until the last minute, you will not finish this program.

To Do: you will be visualizing terrain datafiles of the form found in small.in.  There are several height field datafiles you may visualize while testing your program.  I am retaining one file that you have not seen for my final testing.  Use fltk for your GUI.  Design a nice interface to allow users to view the generated terrain.  Users should be able to decide whether they want to view the information using a wireframe drawing, a shaded (solid) drawing, or a point drawing.  Users should be able to increase the width of the lines and the size of points.  Users should be able to scale the height field so that height differences can become more or less pronounced.  Color should indicate the differences in the height field.  Image should first appear in Wireframe. Users should be able to load new data files into the running program. You should start with the basic CubeView demo program found on the class web page.  This demo has a trackball implemented.

Stage 1:

Stage 2:

§         Use small.in as an example of what you should render.  There are several pictures showing small.in rendered in when rendered in wireframe and solid using TRIANGLE_STRIPS.  These pictures incorporate different views, different orientations, etc.

o       This pseudocode should help you start your drawing routine

§         // Create a heightmap made up of w-1 polygon strips, where w is the number of point columns along the width of the graph.

§         For (j=0; j< width of data –1; j++)

·        glBegin(GL_TRIANGLE_STRIP)

o       for (i=0; i<height of data; i++)

§         glVertex3d(i, j, height info at this point)

§         glVertex3d(i, j+1, height info at this point)

·        glEnd()

o       Hint  glPolygonMode(GL_FRONT_AND_BACK, GL_XXXX)  where XXXX is GL_FILL, GL_POINT, or GL_LINE

Stage 3:

 

Stage 4:

Stage 5:

 

Grading:  We must be able to compile/test your code.  We’ll need your code, makefile, and README for this assignment. 

80 pts: functionality (15-creating terrain map wireframe, 10-creating solid terrain map, 5-creating the point terrain wireframe, 15-scaling the height field, 10- differentially coloring the height field, 5-smoothly coloring the solid terrain, 5-change of line and point dimension, 5 points-understandability of coloring of height field,10-usability of GUI).

20 pts: style (documentation/README/commenting/readability.

Extra credit will be given for: allowing the user to anti-alias the lines in the wire-frame, rendering the front and back faces of the terrain separately, and/or allowing the user to choose the colors of the highest and lowest heights and re-coloring the height fields to interpolate between these new colors.  Other interesting features?

 

Submission:  The class locker exists.  The name is cmps160-dw.f04.

To submit a program %submit cmps160-dw.f04 program3 filename filename …

For Example:

% submit cmps160-dw.f04 program3 main.cxx Makefile gui.cxx gui.h \ gl_window.cxx gl_window.h README

To check what you have submitted %peek cmps160-dw.f04 program3