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...
-
Youngstown Glass Company manufactures three types of safety plate glass: large, medium, and small. All three products have high demand. Thus, Youngstown Glass is able to sell all the safety glass...
-
Consider the periodic signal \[f(t)=\left\{\begin{array}{lr}\cos (t)+D, & -1 \leq t \leq 0 \\\sin \left(t^{6} ight) / t^{3}, & 0 \leq t\leq 2\end{array} ight.\] where \(D=\sin \left(2^{6} ight) /...
-
Justin Fawber is a divisional manager within Monmouth GPS Guidance Systems. Haas is concerned about the amount of the divisions production. The following production data are available for April 2013:...
-
ORIOLE COMPANY INCOME STATEMENT FOR THE YEAR ENDED DECEMBER 31, 2020 Sales revenue $6,960 Cost of goods sold 4,780 Gross margin 2,180 Selling and administrative expenses 920 Income from operations...
-
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...
-
Describe how the Young Village Officials Farm and Jumia are trying to overcome the limitations of electronic commerce. Provide specific examples to support your answer.
-
Which of the following is true about ISO 14001? A. ISO 14001 completely replaces and ISO 9001 .B. ISO 14001 is an internationally recognized environmental management system standard. C. The overall...
-
A human resource manager is evaluating compensation for their firm's expatriates due to reentry problems it is facing. Repatriates are leaving shortly after returning home due to lower rates of...
-
Outside our solar system, a planet is discovered orbiting another star. We measure the planet's orbital period to be 340 days and its semi-major axis to be 0.65 AU. What is the total mass of the star...
-
What does the following C function do for a given character array "str"? void fun1(char str[]) { char c = str[0]; if(c != '\0') fun1(++str); printf("%c",c); } A. Print the array. B. Print the array...
-
1. What is V, in this circuit? 20 V-15VM 250 k 2. If Vo is 0.5V, what is V, in this circuit?
-
The cash records of Sugar Land Country Club (SLCC) show the following four situations: 1. The June 30 bank reconciliation indicated that deposits in transit total $920. During July the general ledger...
-
The polar coordinates of a point are given. Find the rectangular coordinates of the point. (-1, - /3)
-
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...
-
Clearly define the research question(s) by using the six-stage process or the inverted triangle rule for Research proposal on Significance of Undergraduate Degree for Professional Success in Maritime...
-
In this assignment research project meeting best practices, and call on your personal experience of some best practices you observed. You will focus on increasing collaboration through the creation...
-
Choose a journal article related to change management within projects (do not re-use a journal from a prior course). Write a two to three pages review of your chosen journal article. Please choose a...
Study smarter with the SolutionInn App