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% (6 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...
-
Determine the normal force, shear force, and moment at a section passing through point D. take w = 150N/m A -4 m- -4 m -4 m-
-
17-10. Cules son las caractersticas de los buenos objetivos de promocin ?
-
Americas Company has a plant capacity of 100,000 units per year, but its bud get for this year indicates that only 60,000 units will be produced and sold. The entire budget for this year follows. 1....
-
Alice takes a housing loan with 24 months to maturity, with a principal of 200,000. The interest rate is 6% per annum. There are no servicing or guaranteeing fees. The Single Month Mortality (SMM) is...
-
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...
-
What is meant by the terms group and team? Explain the importance and influence of group values and norms, and give practical examples from within your own organisation.
-
4. What is the time complexity of the following procedure for in/2 to n do j 2 end for while (j
-
If the concentration of a constituent in the influent to the equalization basin is constant over the 24 h period, will the load of the constituent from the basin be constant? If the concentration of...
-
A three-phase transmission line of a 60 Hz circuit has a length of 370 km (230 miles). the conductors are of the 795,000cm (54/7) type with horizontal spacing of 25 feet between them. The load on the...
-
Simulate rolling a dice using Math.random() . Your roll function should allow the caller to specify any number of sides, but default to 6 if no side count is given: roll() assumes a 6 sided dice,...
-
Drama Read the excerpt from a play. Then, answer the question(s). (1) (2) Belle: Having trouble deciding what will make you look like both a power to be reckoned with and a fetching young lady while...
-
Tom Speeder is a new client. From reviewing his client questionnaire, you were able to gather the following facts. He is 50 years old and was recently hired as a middle-level manager with a car...
-
Find the velocity, acceleration, and speed of a particle with the given position function. r(t) = (t 2 , sin t - t cos t, cos t + t sin t), t > 0
-
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....
-
Eye Deal Optometry leased vision - testing equipment from Insight Machines on January 1 , 2 0 2 4 . Insight Machines manufactured the equipment at a cost of $ 2 0 0 , 0 0 0 and lists a cash selling...
-
help! ee all photos + Add to o e D C N X Edit & Create Share Table of Contents No sales to an individual customer accounted for more than 10% of revenue during any of the last three fiscal years. Net...
-
Business law A person may have the liability of a partner even though no partnership exists True False
Study smarter with the SolutionInn App