Modify Program 9.3 so that the object in the scene blends environment mapping with a texture. Use
Question:
Modify Program 9.3 so that the object in the scene blends environment mapping with a texture. Use a weighted sum in the fragment shader, as described in Chapter 7.
Program 9.3
Transcribed Image Text:
public void display(GLAutoDrawable drawable) { // the code for drawing the cube map is unchanged. // the changes are all in drawing the torus: gl.glUse Program (rendering Program); // uniform locations for matrix transforms, including the transform for normals mvLoc = gl.glGetUniform Location (rendering Program, "mv_matrix"); pLoc = gl.glGetUniform Location (rendering Program, "p_matrix"); nLoc - gl.gl GetUniform Location (rendering Program, "norm_matrix"); // build the MODEL matrix, as before mMat.identity(); mMat.translate(torusLoc.x(), torusLoc.y(), torusLoc.z());
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 50% (4 reviews)
Answered By
Mary Boke
As an online tutor with over seven years of experience and a PhD in Education, I have had the opportunity to work with a wide range of students from diverse backgrounds. My experience in education has allowed me to develop a deep understanding of how students learn and the various approaches that can be used to facilitate their learning. I believe in creating a positive and inclusive learning environment that encourages students to ask questions and engage with the material. I work closely with my students to understand their individual learning styles, strengths, and challenges to tailor my approach accordingly. I also place a strong emphasis on building strong relationships with my students, which fosters trust and creates a supportive learning environment. Overall, my goal as an online tutor is to help students achieve their academic goals and develop a lifelong love of learning. I believe that education is a transformative experience that has the power to change lives, and I am committed to helping my students realize their full potential.
5.00+
4+ Reviews
22+ Question Solved
Related Book For
Computer Graphics Programming In OpenGL With JAVA
ISBN: 9781683922193
2nd Edition
Authors: V. Scott Gordon PhD, John L. Clevenger PhD
Question Posted:
Students also viewed these Computer science questions
-
In the design of a rapid transit system, it is necessary to balance the average speed of a train against the distance between station stops. The more stops there are, the slower the train's average...
-
Modify Program 5.1 by adding the noperspective declaration to the texture coordinate vertex attributes, as described in Section 5.11. Then rerun the program and compare the output with the original....
-
Assume the same information for TelMark as in Exercise 11-24. A member of the data science team points out that overfitting is often an issue with decision trees. To avoid this issue, he suggests...
-
Use a calculator to approximate the value. Round your answer to two decimal places. arccos(0.051)
-
Suppose that x c (t) is a continuuous-time stationary random signal with autocorrelation function ? c (?) = ?{x c (t)x c (t + ?)} and power density spectrum Consider a discrete-time stationary random...
-
1. Suppose the tariff were levied solely on imported crude. In an integrated world economy, who would be hurt? Who would benefit? Why? What would be the longer-term consequences? 2. If a $10/barrel...
-
If \(X_{t} \sim N\left(0, \sigma^{2} t ight)\) and \(Y_{t}=e^{X_{t}}\), calculate the pdf of \(Y_{t}\). Calculate \(\mathbf{E}\left[Y_{t} ight]\) and \(V\left(Y_{t} ight)\). Calculate the transition...
-
Recent balance sheet information for two companies in the food industry, H.J. Heinz Company and The Hershey Company, is as follows (in millions of dollars): a. Determine the ratio of liabilities to...
-
Using the data from problem 3-24, complete the following steps: 1. Prepare a schedule to determine goodwill and to allocate fair value 2. Prepare a schedule to determine the balance in the...
-
More sophisticated implementations of percentage closer filtering (PCF) take into account the relative distance between the light and the shadow versus the light and the occluder. Doing this can make...
-
Modify Program 8.2 to replace the hardcoded values 0.001 in the lookup() function, with the more accurate values of 1.0/shadowbufferwidth and 1.0/shadowbufferheight. Observe to what degree this...
-
Employees at the Dewey Construction Company enter the work they perform on job-time tickets. Most construction sites have data input terminals that employees use to enter the time they start and stop...
-
A student is at rest at the top of a playground slide. The length of the slide is 5.0 m long, and it is at an angle of 30 degrees. When the student leaves the slide he is traveling at a speed of 2.0...
-
A 3.6 kg block starts (with its center-of- mass vertical displacement at a height of 47 cm) on a plane that has an inclination angle of 30 as in figure. Upon reaching the bottom, the block slides...
-
discuss what roles and responsibilities do team members have to ensure successful collaboration and teamwork? Explain describe what is a collaboration agreement? How do you write a collaboration...
-
1. Imagine that you would like to know a friend's preference between chocolate (c) and vanilla (v) ice cream scoops. Your friend tells you that her utility function is U(c,v) = c+2*v. (a) An ice...
-
Use Figure 2.1 to justify the assumption that a typical bacterial cell (that is, E. coli ) has a surface area of 6 m2 and a volume of 1m3. Also, express this volume in Femtoliters. Make a...
-
Rita Pelzer was just hired as the assistant controller of Yorkshire Inns. The company is a specialty chain hotel with nine hotels concentrated in one metropolitan area. Among other things, the...
-
The unadjusted trial balance of Secretarial Services is as follows: SECRETARIAL SERVICES Unadjusted Trial Balance as at 31 December 2017 Account Debit Credit Cash at bank Office supplies Prepaid...
-
Will the elimination of trade barriers between countries in Europe eliminate the need to consider submarkets of European consumers? Why or why not?
-
What and who is the U.S. government attempting to protect in its effort to preserve and regulate competition?
-
For each of the major laws discussed in the text, indicate whether in the long run the law will promote or restrict competition. As a consumer without any financial interest in business, what is your...
-
Imagine that you are purchasing a house for $150,000. You have saved some money and would like to obtain an 80% loan to value mortgage loan so that you can have the lowest interest rate on your...
-
b) [10 marks] Consider two stocks, A and B, with expected returns and volatilities given by E[r]=10%, A=20%, E[B]=15%, B=30%. The riskless rate is 4%. The correlation of stock returns is 0.3....
-
Mayco Inc would like to set up a new plant. Currently, Mayco has an option to buy an existing building at a cost of $ 24,000.Necessary equipment for the plant will cost $ 16,000, including...
The Mcgraw Hill 36 Hour Course Organizational Development 1st Edition - ISBN: 0071743820 - Free Book
Study smarter with the SolutionInn App