Modify Program 4.4 so that the sun, planet, and moon are textured. You may continue to use
Question:
Modify Program 4.4 so that the “sun,” “planet,” and “moon” are textured. You may continue to use the shapes already present, and you may use any texture you like. This will require you to build texture coordinates for the cube.
Program 4.4
Transcribed Image Text:
private Matrix4fStack mvStack = new Matrix4fStack(5); public void display(GLAutoDrawable drawable) { // setup of background, depth buffer, rendering program, and proj matrices unchanged tf = elapsed Time/1000.0; // time factor, as before // push view matrix onto the stack mvStack.pushMatrix(); mvStack.translate(-cameraX, // -cameraY, -cameraZ); pyramid == sun mvStack.pushMatrix(); mvStack translate (0.0f, 0.0f, 0.0f); // sun's position // sun's rotation on its axis mvStack.pushMatrix(); mvStack.rotate((float)tf, 1.0f, 0.0f, 0.0f); gl.glUniformMatrix4fv(mvLoc, 1, false, mvStack.get(vals)); gl.glBindBuffer(GL_ARRAY_BUFFER, vbo[1]); gl.glVertexAttribPointer(0, 3, GL_FLOAT, false, 0, 0); gl.glEnable VertexAttribArray(0); gl.glEnable(GL_DEPTH_TEST);
Step by Step Answer:
This question has not been answered yet.
You can Ask your question!
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
-
Modify Program 4.4 so that the sun, planet, and moon are textured spheres, such as the ones shown in Figure 4.11. Program 4.4 Figure 4.11 private Matrix4fStack mvStack = new Matrix4fStack(5); public...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
How are financial statements adjusted for exchange rates?
-
Consider h[n], the real-valued impulse response of a stable, causal LTI system with frequency response H(e j? ). The following is known: (i) The system has a stable, causal inverse. Determine h[n] in...
-
The bridge deck has a weight per unit length of 80 kN/m. It is supported on each side by a cable. Determine the tension in each cable at the piers A andB. -1000 m B. 150 m I75 m
-
17-8. En qu etapa de la decisin de compra del consumidor es mayor la importancia de la venta personal ? Por qu?
-
Please complete the Express Catering, Inc.s 2014 tax return based upon the information provided below. If required information is missing, use reasonable assumptions to fill in the gaps. Ignore any...
-
otional Cumulative final 21 Klein Interiors has the following account balances at the end of the your use only the appropriate accounts to be sheet $ Account quipment Accounts payable Common stock...
-
Modify Program 12.1 to experiment with various values for inner and outer tessellation levels and observing the resulting rendered mesh. Program 12.1 Java/JOGL application public int createShader...
-
Using a simple paint program (such as Windows Paint or GIMP [GI16]), draw a freehand picture of your own design. Then use your image to texture the pyramid in Program 5.1. Program 5.1 JAVA/JOGL...
-
Deduce the structure of each of the following compounds on the basis of their 1H NMR spectra and molecular formulas: (a) C8H10; 1.2 ppm (triplet, 3H) 2.6 ppm (quartet, 2H) 7.1 ppm (broad singlet, 5H)...
-
Medical Helicopters In a study of helicopter usage and patient survival, results were obtained from 47,637 patients transported by helicopter and 111,874 patients transported by ground (based on data...
-
On January 1, 20X1, Laketown Company (the user) leased a truck for a seven-year period under a FINANCE LEASE and agreed to pay an annual lease payment of $6,000 at the end of each year. The interest...
-
ces Shouldice Hospital in Canada is widely known for one thing-hernia repair! In fact, that is the only operation it performs, and it performs a great many of them. Over the past two decades this...
-
2. An Annual General Meeting (AGM) is a meeting conducted annually where the members of an organization gather to discuss and vote on key issues. Public companies hold annual general meetings for...
-
The 3 P's of Sustainability refers to: O The groups of people that environmental efforts effect. O People, Planet, Profit O Population, Productivity, Principled None of the Above. Question 21 2...
-
Mr. and Mrs. Worried, longtime clients, have come to you for help. Their 13-year-old son has recently been expelled from the public junior high school because of severe behavioral problems,...
-
(a) Use integration by parts to show that (b) If f and g are inverse functions and f' is continuous, prove that (c) In the case where f and t are positive functions and b > a > 0, draw a diagram to...
-
Josie is a sales representative for Talk2Me, a communications retailer based in Fort Smith, Arkansas. Josie's sales territory is Oklahoma, and she regularly takes day trips to Tulsa to meet with...
-
Kim Corporation, a calendar year taxpayer, has manufacturing facilities in States A and B. A summary of Kims property holdings follows. Determine Kims property factors for the two states assuming...
-
True Corporation, a wholly owned subsidiary of Trumaine Corporation, generated a $400,000 taxable loss in its first year of operations. True's activities and sales are restricted to State A, which...
-
The company sold merchandise to a customer on March 31, 2020, for $100,000. The customer paid with a promissory note that has a term of 18 months and an annual interest rate of 9%. The companys...
-
imer 2 0 2 4 Question 8 , PF 8 - 3 5 A ( similar to ) HW Score: 0 % , 0 of 1 0 0 points lework CH 8 Part 1 of 6 Points: 0 of 1 5 Save The comparative financial statements of Highland Cosmetic Supply...
-
An investor wants to purchase a zero coupon bond from Timberlake Industries today. The bond will mature in exactly 5.00 years with a redemption value of $1,000. The investor wants a 12.00% annual...
Study smarter with the SolutionInn App