Modify Program 4.4 so that the sun, planet, and moon are textured spheres, such as the ones
Question:
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.4Figure 4.11
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);
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (3 reviews)
Answered By
Bhartendu Goyal
Professional, Experienced, and Expert tutor who will provide speedy and to-the-point solutions. I have been teaching students for 5 years now in different subjects and it's truly been one of the most rewarding experiences of my life. I have also done one-to-one tutoring with 100+ students and help them achieve great subject knowledge. I have expertise in computer subjects like C++, C, Java, and Python programming and other computer Science related fields. Many of my student's parents message me that your lessons improved their children's grades and this is the best only thing you want as a tea...
3.00+
2+ Reviews
10+ 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
-
Modify your program from Exercise 6.1 so that the imported NASA shuttle object from Figure 6.16 also orbits the sun. Youll want to experiment with the scale and rotation applied to the shuttle to...
-
An early graphical method for comparing nucleotide sequencesthe so-called diagon plotstill yields one of the best visual comparisons of sequence relatedness. An example is illustrated in Figure Q911,...
-
File to edit sprintf ~~~~~~~~~~~~~~~~~ #sprintf! #$a0 has the pointer to the buffer to be printed to #$a1 has the pointer to the format string #$a2 and $a3 have (possibly) the first two substitutions...
-
Use lHpitals rule to find the limit. 31 + 3 43 14t - t + 3 lim
-
Consider a teal, causal sequence x[n] with discrete-time Fourier transform X(e j? ) = X R (e j? ) + jX I (e j? ). The imaginary part of the discrete-time Fourier transform is? X I (e j? ) = 3...
-
Wilmington Chemical Company produces three products: ethylene, butane, and ester. Each of these products has high demand in the market, and Wilmington Chemical is able to sell as much as it can...
-
Show that the following eight vectors are pairwise orthogonal: \[\begin{aligned}& s 1=(1,1,0,0,0,0,0,0)^{T} \\& s 2=(0,0,1,1,0,0,0,0)^{T} \\& s 3=(0,0,0,0,1,1,0,0)^{T} \\& s 4=(0,0,,0,0,0,1,1)^{T}...
-
This case can be assigned as a group activity. Additional instructions and material for this activity can be found on the Instructor Resource site and in WileyPLUS. Kenmare Architects Ltd. (KAL) was...
-
-What kind of the four retailing concepts from the four (customer orientation, coordinator effort, value driven, and goal orientation) does Ulta Beauty uses? -Identify how the retailer develops its...
-
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...
-
Learn the basics of how to use Blender to create a 3D object of your own. To make full use of Blender with your OpenGL applications, youll want to learn how to use Blenders UV-unwrapping tools to...
-
Accounting firm was convicted in the U.S. District Court for the Southern District of Texas, Melinda Harmon, J., of obstructing Securities and Exchange Commission (SEC) proceeding, and it appealed....
-
A passenger on a maglev traveling at a constant velocity of 17m/s from East Lansing to Chicago begins to walk to the back of the maglev with a velocity of 1.5m/s. What is the passenger's relative...
-
An echocardiogram uses 4.4 MHz ultrasound to measure blood flow in the aorta. The blood is moving away from the probe at 1.2 m/s. The speed of sound Medium Air (0 C) Air (20 C) Heluim (0 C) Ethyl...
-
A painter on a 6.00 m platform drops a 1.50 kg can of paint What is the initial total energy? What are the velocity, kinetic, potential and total energies of the can at 4 m?
-
given by A solid sphere is free to rotate about the z axis, as shown. It's angular position as a function of time is e(t)=0.77 rad + (20.61 rad/s/2)+3/2 - (2.58 rad/s5/2) +5/2 33% Part (a) What is...
-
A person picks a 2.00-kg box of macaroni from off the shelf and lowers it 1.00 m into a shopping cart. The work done on the macaroni by the person is - 2.0 J 2.0 J 19.6 J OJ - 19.6 J
-
The following information pertains to Worthy Tours: 1. Cash balance per bank, July 31, $7,263. 2. July bank service charge not recorded by the depositor $28. 3. Cash balance per books, July 31,...
-
A survey of 70 college freshmen asked whether students planned to take biology, chemistry, or physics during their first year. Use the diagram to answer each question. How many of the surveyed...
-
Dread Corporation operates in a high-tax state. The firm asks you for advice on a plan to outsource administrative work done in its home state to independent contractors. This work now costs the...
-
Indicate whether each of the following items should be allocated or apportioned by the taxpayer in computing state corporate taxable income. Assume that the state follows the general rules of UDITPA....
-
Regarding the apportionment formula used to compute state taxable income, does each of the following independent characterizations describe a taxpayer that is based in-state or out-of-state? Explain....
-
Uploading the data and keeping the information accurate is one of the most important goals for the project. Having issues with the data could impact the relationship with clients and profits. If the...
-
Do an essay on how is Jamaica healthcare system dealing with the current pandemic( Make reference to Social development goals 3, 4 and 17) Essay should be about three pages long. Also include...
-
Adjusted Trial Balance for Keem Motor Sdn Bhd as at 31 December 2021 DEBIT (RM) CREDIT (RM) Delivery van Furniture and fittings Account Receivables 21,300 18,700 36,900 Accounts Payable Purchases...
Study smarter with the SolutionInn App