CS 534 Spring 2006 E. Angel Assignment 2: Display a Height Field with OpenGL Surfaces I have put two sets of data in my file system under ~angel/public_html/CS534. Each contains height data for over a rectangular mesh. Note that the scales are not the same so you might want to rescale these data as part of the assignment. honolulu.raw: 465 x 436 elevation values for the Honolulu area. The data are ASCII integers. The first two elements in the file are 436 and 465, not elevation values. nmtopo.raw: 1024 x 768 elevation values for northern New Mexico. Same format as honolulu data with first two elements of 768 and 1024. Note: If the data does not display correctly, you may have to swap rows and columns. I'm not sure of rows or columns is first in these data sets. The easiest way to display these data are by using four adjacent data points to define either an OpenGL quad or two OpenGL triangles. Actually, a better approach would be to use the adjacent rows or columns of the data to define triangle strips or quad strips. The first part of the assignment is to write a program to display these data sets using filled triangles or quads. Note that you will have to worry about shading the data set and adding at least one light (the "sun"). We should be able to get a smoother display using curved surfaces. For the second part, you are to use OpenGL's cubic Bezier surfaces to display the data. You should be able to use groups of 16 (4 x 4 subarrays) data points to define each patch. Consider how to obtain the normals for shading. Third, use the matrices that we discussed in class to generate interpolating and spline patches from the same data. Compare the running time of the various options and see if the improved quality of the surfaces is worth the work. Some fun things to try: Try displaying the data as a mesh using line segments or curves. Display the data over the course of a day by moving the sun's position. Make your program interactive and let the user fly around the data set. Color the data according to altitude, trying to capture features such as water vs land vs snow. Find a corresponding topo map for one of the data sets on the web and use that data set as a texture map. This option will be tricky since you would have to worry about differences in scale and geometry between the data sets, Note that a lot of the code you may need is available under Book Support on my home page from either the textbook or my OpenGL Primer.