Question: Write a webGL 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
Write a webGL 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 following procedure creates the polygonal (triangle mesh) 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 Gouraud shading and lighting. Note that each vertex normal must be computed by averaging the normals of the triangular faces that share the vertex. Use a depth buffer for hidden surface removal.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
