Add animation to Program 8.1, such that either the objects or the light (or both) move around
Question:
Add animation to Program 8.1, such that either the objects or the light (or both) move around on their own—such as one revolving around the other. The shadow effects will be more pronounced if you add a ground plane to the scene, such as the one illustrated in Figure 8.14.
Program 8.1
Figure 8.14
Transcribed Image Text:
// Much is the same as we have seen before. New sections to support shadows are highlighted. // The imports necessary for lighting, etc., would be included at the start, are the same as before, // and are not shown here. public class Code extends JFrame implements GLEventListener { // variable declarations for rendering programs, buffers, shader sources, etc., would go here. private ImportedModel pyramid = new ImportedModel("pyr.obj"); // define the pyramid private Torus myTorus= new Torus (0.6f, 0.4f, 48); // define the torus private int numPyramidVertices, num Torus Vertices, num TorusIndices; // locations of torus, pyramid, camera, and light private Vector3f torusLoc = new Vector3f(1.6, 0.0, -0.3); private Vector3f pyrLoc = new Vector3f(-1.0, 0.1, 0.3); private Vector3f cameraLoc = new Vector3f(0.0, 0.2, 6.0); private Vector3f lightLoc= new Vector3f(-3.8f, 2.2f, 1.1f); // properties of white light (global and positional) used in this scene private float[] globalAmbient = new float[] { 0.7f, 0.7f, 0.7f, 1.0f};
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (1 review)
java Override public void display GLAutoDrawable drawable final GL4 g1 GL4 GLCon...View the full answer
Answered By
Ali Khawaja
my expertise are as follows: financial accounting : - journal entries - financial statements including balance sheet, profit & loss account, cash flow statement & statement of changes in equity -consolidated statement of financial position. -ratio analysis -depreciation methods -accounting concepts -understanding and application of all international financial reporting standards (ifrs) -international accounting standards (ias) -etc business analysis : -business strategy -strategic choices -business processes -e-business -e-marketing -project management -finance -hrm financial management : -project appraisal -capital budgeting -net present value (npv) -internal rate of return (irr) -net present value(npv) -payback period -strategic position -strategic choices -information technology -project management -finance -human resource management auditing: -internal audit -external audit -substantive procedures -analytic procedures -designing and assessment of internal controls -developing the flow charts & data flow diagrams -audit reports -engagement letter -materiality economics: -micro -macro -game theory -econometric -mathematical application in economics -empirical macroeconomics -international trade -international political economy -monetary theory and policy -public economics ,business law, and all regarding commerce
4.00+
1+ 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
-
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...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
In the early afternoon, three Nucor electricians got a call from their Hickman, Arkansas, plant colleagues. The Hickman mill's electrical grid had failed, which meant the mini-mill couldn't melt the...
-
Find the lengths of the curves. x = 5 cos t - cos 5t, y = 5 sin t - sin 5t, 0 t /2
-
A signal x[n] is analyzed using the time-dependent Fourier transform X r [k], as defined in Eq. (10.36). Initially, the analysis is performed with an N = 128 DFT using an L = 128-point Hamming window...
-
Assume that you are the owner of Campus Connection, which specializes in items that interest students. At the end of January 2014, you find (for January only) this information: a. Sales, per the cash...
-
Identify the important legal provisions governing information security and privacy in your country.
-
The following information is available for Pacilio Security Services Inc. for 2011, its first year of operations. Pacilio provides security services for local sporting events. The following summary...
-
Big Data and Business Intelligence in Amazon (MO2-3) Amazon, one of the world's leading e-commerce platforms, serves millions of customers each day. The amount of data generated from customers'...
-
Modify Program 2.5 so that the vertex shader includes one of the buildRotate() functions from Program 3.1 and applies it to the points comprising the triangle. This should cause the triangle to be...
-
Modify Program 2.6 so that it calculates the amount of movement for the triangle based on elapsed time, rather than a constant amount as it is currently implemented. One approach for this is to get...
-
Following the terrorist attack on the United States, the valuations of many MNCs declined by more than 10 percent. Explain why the expected cash flows of MNCs were reduced, even if they were not...
-
Water-treatment processes that generate hydroxyl radicals are often used to remove organic chemicals that contaminate groundwater. The hydroxyl radical (OH) is a very reactive free-radical species...
-
1. import java.util.Scanner; 2. public class root 3. { 4. public static void main(String[] args) 5. { 6. 7. 8. Scanner input= new Scanner(System.in); double number = input.nextDouble(); double a = 2;...
-
Consider the following CIE Diagram. W is the white point. 520 54 510 X M 500 H 490 480 400 B 560 K E G 380 D600 R700nm F (a) (2 points) What color (point) can be regarded as the hue (as a spectral...
-
For the code given below, when m=387 and n=33, show the steps of the Euclidean algorithm. I have provided the pseudocode and shown the first 5 steps below. count = 0 while ((r = m mod n) != 0) m = n...
-
What is the output of the following program? #include using namespace std; main() { } int r, x = 2; float y = 5; r= y%x; cout
-
The income statement for J and T Seafood appears below. J AND T SEAFOOD Income Statement For the Year Ended December 31, 2008 Sales ...........................$400,000 Cost of goods sold...
-
A company has the following incomplete production budget data for the first quarter: In the previous December, ending inventory was 200 units, which was the minimum required, at 10% of projected...
-
Describe the situations that would lead to the use of the three different buying processes for a particular productlightweight bumpers for a pickup truck.
-
Why would an organizational buyer want to get competitive bids? What are some of the situations when competitive bidding cant be used?
-
How likely would each of the following be to use competitive bids? ( a ) a small town that needed a road resurfaced, ( b ) a scouting organization that needed a printer to print its scouting...
-
How can critical cultural analysis inform strategies for promoting cultural inclusivity, equity, and social justice in policy-making and institutional practices ?
-
Altira Corporation provides the following information related to its inventory during the month of August 2024: August 1 Inventory on hand-3,800 units; cost $6.20 each. August 8 Purchased 15,200...
-
The BEA plans to retrospectively revise U.S. GDP data using this new methodology. Given that the debt-to-GDP ratio is a measure of a country's debt in relation to its GDP, how will this ratio be...
Study smarter with the SolutionInn App