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% (3 reviews)
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...
-
Determine the volume of the solid formed by revolving the shaded area about the x axis using the second theorem of Pappus?Guldinus. The area and centroid of the shaded area should first be obtained...
-
18-11. Qu herramienta promocional de ventas es ms comn para los productos nuevos?
-
How important was Ians knowledge of the billing procedures used within the steel industry in his being able to establish his business? Given his cash position when he opened his business, do you...
-
Grace Carol Associates surveys American eating habits. The company's accounts include Land, Buildings, Office Equipment, and Communication Equipment, with a separate Accumulated Depreciation account...
-
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...
-
1a. Some common numerical thresholds and benchmarks for overall materiality judgments are 5% of net income and 1% of assets. The materiality level at which items are considered clearly trivial-a...
-
Description: duff owes relatives $13,000 for college loans. find the required quarterly payment into a sinking fund if duff pays off the loan in 3 years and the interest rate is 8% per year...
-
1 3 , 9 5 0 ) Repairs and Maintenance ( $ 2 , 8 5 0 ) Utilities Expense ( $ 8 8 0 ) Operating Income $ 1 0 , 2 4 2 Other Income - Gain on Sale $ 3 0 0 Interest Expense ( $ 2 5 0 ) Earnings Before...
-
Description: The company currently has outstanding a bond with a 5.5 percent coupon rate and another bond with a 3.5 percent coupon rate. The firm has been informed by its investment banker that...
-
Find the equation of line joining the points (4, -3) and (-2, 7).
-
Calculate the work of reversible expansion of 1 mole of ideal gas at 25 degree celsius from 10 L to 20 L.
-
Why is it unwise to base your research conclusion solely on what you read in a reference service?
-
Proposals have been made to ?sail? spacecraft to the outer solar system using the pressure of sunlight, or even to propel interstellar spacecraft with high-powered, Earth-based lasers. Sailing...
-
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...
-
Sweeten Company had no jobs in progress at the beginning of March and no beginning inventories. The company has two manufacturing departments --Molding and Fabrication. It started, completed, and...
-
Horizontal Analysis The comparative accounts payable and long-term debt balances of a company are provided below. Current Year Previous Year Accounts payable $47,286 $63,900 Long-term debt 85,492...
-
On January 1, Year 1, Price Company issued $140,000 of five-year, 7 percent bonds at 97. Interest is payable annually on December 31. The discount is amortized using the straight-line method. Record...
Study smarter with the SolutionInn App