Wrote a WebGL program that displays the graph of a bivariate function: z = f (x,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Wrote 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]. f(x, y) = ½el-0.04√(80a-40)²+(90y-45)²)) cos(0.15₁√(80x − 40)² + (90y − 45)²) 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. A reasonable value of k is 50. 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 triangles which share the vertex. * Use a depth buffer for hidden surface removal. A good template for this program is LightedCube_animation in Matsuda Chapter 8 (one of our texts). It is sufficient to replace initVertexBuffers to create typed arrays of vertex positions, colors, normals, and indices for the triangle mesh surface rather than a cube. Note, however, that the indices cannot be stored as 8-bit unsigned integers, and the third artument in function gl.drawElements must be changed from gl.UNSIGNED_BYTE to short or int. Wrote 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]. f(x, y) = ½el-0.04√(80a-40)²+(90y-45)²)) cos(0.15₁√(80x − 40)² + (90y − 45)²) 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. A reasonable value of k is 50. 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 triangles which share the vertex. * Use a depth buffer for hidden surface removal. A good template for this program is LightedCube_animation in Matsuda Chapter 8 (one of our texts). It is sufficient to replace initVertexBuffers to create typed arrays of vertex positions, colors, normals, and indices for the triangle mesh surface rather than a cube. Note, however, that the indices cannot be stored as 8-bit unsigned integers, and the third artument in function gl.drawElements must be changed from gl.UNSIGNED_BYTE to short or int.
Expert Answer:
Answer rating: 100% (QA)
Step12 To create the polygonal mesh surface for the given bivariate function you can follow the steps outlined in the question Partition the domain D0... View the full answer
Related Book For
Posted Date:
Students also viewed these computer engineering questions
-
Write a Java program that displays the following picture. Write a sequence of println statements that display lines of asterisks and blanks. **** ** * **** ****** * ** ************** **** ** **
-
Write an assembly language program that displays the dollar sign ($) 10 times on the first line and 5 times on the second line. SAMPLE: section .text global_start ;must be declared for linker (gcc)...
-
Create a C# Program that displays the series of numbers of the following. - from 1.0 to 9.5 in increments of 0.5 - from 100 down to 0 in increments of 5.
-
For the car suspension shown in Figure determine the differential equation, transfer function and state space model. Plot the position of the car and the wheel after the car hits a unit bump (that...
-
Countries A and B both have the same money growth rate and in both countries, real output is constant. In Country A velocity is constant while in Country B velocity has fallen. In which country will...
-
This comprehensive problem involving Miller Design Studio covers all the learning objectives in this chapter and in the chapters on measuring business transaction and measuring business income. To...
-
Purina entered in a contract with the defendant to sell the defendant piglets, known as weanlingsbaby pigs that have been weaned. It is uncontested that the buyer breached and that Purina is entitled...
-
Statement of Activities. The Atkins Museum recently hired a new controller. His experience with managerial accounting and strong communication skills were extremely attractive. The new controller...
-
Explain why not all relationships go through every stage in Knapp's Relational Model. Give an example.
-
1. Sharps Sandwich Shop has two conflicting quality issues speed and freshness. The premade sandwich system enhances speed; however, it has the potential of affecting freshness. What type of system...
-
(a) Use differentiation to find a power series representation for f(x) = f(x) = ((-1)n(n+1) 2 2) - 2 (5(n+ 2)) OF) n=0 What is the radius of convergence, R? R = 5 1 (5 + x) f(x) = (b) Use part (a) to...
-
Complete the following: Account a. Gain on Sale of Plant Assets b. Accumulated Depletion c. Loss on Disposal of Plant Assets Category Financial Statement Found on
-
The process included in the replenishment cycle includes order arrival. production scheduling. retail sale. manufacturing.
-
________ tend to be significant consumers of energy and water and emitters of waste and greenhouse gases, and thus offer significant opportunities for profitable improvement. Employees Shareholders...
-
Supply chains can influence demand by using production capacity and inventory. pricing and other promotions. price promotions and inventory. production capacity and inventory promotions.
-
The value chain in a company begins with the customer. marketing and sales. new product development. operations.
-
A US Treasury bill has a face value of $100 and 90 days of maturity. The T-bill is bidded at the bank discount yield of 6% per year. What is the T-bill's money market yield per year?
-
In a large midwestern university, 30% of the students live in apartments. If 200 students are randomly selected, find the probability that the number of them living in apartments will be between 55...
-
Find the limit or show that it does not exist. lim Vx? + 1 -2
-
Find the vector, not with determinants, but by using properties of cross products. (i + j) x (i - j)
-
Determine whether the lines given by the symmetric equations x - 1/2 = y - 2/3 = z - 3/4 and x + 1/6 = y - 3/-1 = z + 5/2 are parallel, skew, or intersecting.
-
Which of the following types of epigenetic changes may promote cancer? a. DNA methylation b. Covalent modification of histones c. Chromatin remodeling d. All of the above may promote cancer.
-
The underlying cause(s) of epigenetic changes associated with cancer may be a. mutations in genes that encode chromatin-modifying proteins. b. environmental agents that alter the function of...
-
Normal (nonmutant) tumor-suppressor genes often function a. as negative regulators of cell division. b. in the maintenance of genome integrity. c. in the stimulation of cell division. d. as both a...
Study smarter with the SolutionInn App