Modify Program 4.4 so that the view matrix is constructed using the look-at function. Then experiment with
Question:
Modify Program 4.4 so that the “view” matrix is constructed using the “look-at” function. Then experiment with setting the “look-at” parameters to various locations, such as looking at the sun (in which case the scene should appear normal), looking at the planet, or looking at the moon.
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);
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 0% (1 review)
Answered By
Cristine kanyaa
I possess exceptional research and essay writing skills. I have successfully completed over 5000 projects and the responses are positively overwhelming . I have experience in handling Coursework, Session Long Papers, Manuscripts, Term papers, & Presentations among others. I have access to both physical and online library. this makes me a suitable candidate to tutor clients as I have adequate materials to carry out intensive research.
4.90+
1538+ Reviews
3254+ 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
-
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...
-
In Program 9.2, add the ability to move the camera around with the mouse or keyboard. To do this, you will need to utilize the code you developed earlier in Exercise 4.2 for constructing a view...
-
THIRD AVENUE SOFTWARE HEALTH-CARE APP PROJECT This case is new for the ninth edition of Information Technology Project Management . The case provides an opportunity to apply agile and Scrum...
-
Graph the sets of points whose polar coordinates satisfy the equations and inequalitie. 0 /6, r 0
-
Let x[n] = cos(2n/5) and v[n] be the sequence obtained by applying a 32-point rectangular window to x[n] before computing V(e j ). Sketch |V(e j ) for , labeling the frequencies of all peaks and...
-
1. What were the key components of Laker Airways' operating exposure? 2. What options did it have to hedge its operating exposure? 3. Could Laker have hedged its ''natural'' dollar liability...
-
What are some of the disadvantages of using social media?
-
On June 30, the end of the current fiscal year, the following information is available to Heart Companys accountants for making adjusting entries: a. One of the companys liabilities is a mortgage...
-
Accounts Debit Credit Cash $24,100 Accounts Receivable 5,500 Supplies 3,400 Land 53,000 Accounts Payable $3,500 Common Stock 68,000 Retained Earnings 14,500 Totals $86,000 $86,000 During January...
-
Learn the basics of how to use Terragen [TE16] to create a simple cube map. This generally entails making a world with the desired terrain and atmospheric patterns (in Terragen), and then positioning...
-
Modify Program 2.5 so that it draws an isosceles triangle. Program 2.5 Vertex Shader #version 430 void main(void) { if (gl_VertexID== 0) gl_Position = vec4( 0.25, -0.25, 0.0, 1.0); else if...
-
A statistician conducted an informal mail survey of several countries around the world. Among other things, the statistician wanted to gauge how the citizens of each country felt about immigration....
-
The following selected ledger accounts of Cameron Company are for February (the second month of its accounting year): Materials Inventory Feb. 1 balance 113,400 February credits 406,800 February...
-
Explain why it is important for team members and stakeholders need to be aware of quality requirements? Why are quality requirements and metrics effective tools to use when measuring performance?...
-
These are videos on Recursion https://youtu.be/coG4zDavl40 https://youtu.be/6adwO_ILBXw Recursive Algorithms Assignment 2: Printing Triangles Put all methods within one file called...
-
In the synthesis of a pheromone outlined below, on which step the carbon skeleton is constructed (a new carbon-carbon bond is formed)? HBr, CH 60-63% H, Lindlar, quinoline 75-85% HO Br =1/ 2 eq....
-
Terrorists use a combination of legitimate and illicit funding sources and financial methods to support their operations. Describe one of these sources or methods and discuss an innovative (yet...
-
On September 1, Eden County Club had an inventory of 30 golf shirts at a cost of $18 each. The company uses a perpetual inventory system. During September, the following transactions occurred. Sept....
-
Heineken N.V., a global brewer based in the Netherlands, reports the following balance sheet accounts for the year ended December 31, 2016 (euros in millions). Prepare the balance sheet for this...
-
A supermarket chain is planning to open a number of new stores to appeal to Hispanics in southern California. Give some examples that indicate how the four Ps might be adjusted to appeal to the...
-
How should social class influences affect the planning of a new restaurant in a large city? How might the four Ps be adjusted?
-
Illustrate how the reference group concept may apply in practice by explaining how you personally are influenced by some reference group for some product. What are the implications of such behavior...
-
Matt and Meg Comer are married and file a joint tax return. They do not have any children. Matt works as a history professor at a local university and earns a salary of $ 7 0 , 0 0 0 . Meg works part...
-
(a) Nickel has melting temperature of 1455C and often does not nucleate until 1136C. Find the critical radius (r) and activation free energy (AG) for the solidification of nickel. Nickel has a latent...
-
Most successful businesses today actively develop loyal customers who buy their brands again and again. After all, getting current customers to buy more is much easier than constantly seeking new...
Study smarter with the SolutionInn App