Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started