CSCE 4230 Program #5 Due date: Thursday, April 16, 2009 Write a program that displays the graph of a bivariate function: z = f(x,y) for (x,y) in D = [0,1] X [0,1]. Use the following test function: f(x,y) = .5*exp[-.04*sqrt((80x-40)^2 + (90y-45)^2)] * cos[0.15*sqrt((80x-40)^2 + (90y-45)^2)] The user must be able to view the plot from an arbitrary perspective (by rotating it about the x and y axes, for example) and to zoom in or out. Use the following procedure to create a polygonal surface: partition D into a k+1 by k+1 uniform rectangular grid, and partition each of the k*k squares into a pair of triangles. Then call f to obtain a z value at each of the (k+1)^2 grid points. Use filled triangles with smooth shading and lighting. Note that each vertex normal must be computed by averaging the normals of the triangular faces that share the vertex. Refer to "Vertex Arrays" (pp. 65-78) for a means of reducing the number of function calls required to render the surface. Use double buffering to obtain smooth motion when rotating the plot or zooming in or out. Use a depth buffer for hidden surface removal. Use perspective projection. The aspect ratio of the view volume (intersected with the projection plane) should be preserved. Name your source code file Lastname_5.c or Lastname_5.cpp, where Lastname is your last name, and email it to the grader Ismail Mohammed: im0058@unt.edu. Also, hand in a source code listing (with your name on it), at the beginning of class on the due date.