Modify Program 13.1 so that it moves each vertex slightly toward the center of its primitive triangle.
Question:
Modify Program 13.1 so that it moves each vertex slightly toward the center of its primitive triangle. The result should look similar to the exploded torus in Figure 13.5, but without the overall change in torus size.
Program 13.1
Figure 13.5
Transcribed Image Text:
#version 430 layout (triangles) in; in vec3 varying Normal [ ]; in vec3 varying LightDir[]; in vec3 varying HalfVector[]; // inputs from the vertex shader out vec3 varying NormalG; // outputs through the rasterizer to the fragment shader out vec3 varyingLightDirG; out vec3 varyingHalfVectorG; layout (triangle_strip, max_vertices=3) out; // matrices and lighting uniforms same as before void main (void) { //move vertices along the normal, and pass through the other vertex attributes unchanged
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 100% (QA)
Answered By
OTIENO OBADO
I have a vast experience in teaching, mentoring and tutoring. I handle student concerns diligently and my academic background is undeniably aesthetic
4.30+
3+ 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
-
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...
-
1. How strong are the competitive forces confronting J. Crew in the market for specialty retail? Do a [Michael Porter] five-forces analysis to support your answer. (see chapter 3 in the textfor...
-
How do sociological theories of deviance and social control elucidate the construction of criminality, the enforcement of laws, and the stigmatization of marginalized groups within society ?
-
PWX Inc. has the following information for its years ended June 30: Required: Calculate the accounts receivable turnover and average collection period for 20X3 and 20X2. Comment on the trend. What...
-
x[n] is a real, causal sequence with discrete-time Fouorier transform X(e j? ). The imaginary part of X(e j? ) is? jm{ X(e j? ).} = sin ?, and it is also known that? > x[n] = 3.
-
Green Thumb Garden Tools Inc. produces and sells home and garden tools and equipment. A lawnmower has a total cost of $ 230 per unit, of which $ 160 is product cost and $ 70 is selling and...
-
(The Martingale problem on \(L)\) Let \(f, g)\) be a pair of functions in \(L\). Find a process \(\left\{X_{t} ight\}_{t}\) defined on \(E\) such that \[M_{t}=f\left(X_{t} ight)-f\left(X_{0}...
-
Jo and Velma are equal owners of the JV Partnership. Jo invests $500,000 cash in the partnership. Velma contributes land and a building (basis to her of $125,000, fair market value of $500,000). The...
-
The balance sheet for Carla Vista Co. is as follows: Carla Vista Co. Balance Sheet December 31, 2022 Cash $ 24,000 Accounts payable $ 3,800 Accounts receivable 22,700 Salaries and wages payable 2,800...
-
Modify Program 13.4 to additionally render the original torus. That is, render both a lighted torus and the outgoing line segments (using a geometry shader) so that the hair looks like it is coming...
-
Modify Program 14.4 (the version including the modification in Figure 14.10 that produces a 3D cubed texture) so that it instead textures the Studio 522 dolphin. Then observe the results. Many people...
-
Investors and management use the statement of cash flows to evaluate a firm's profitability. A. True B. False
-
1. Suppose that the telephone calls arriving at a particular switchboard follow a Poisson process with an average of 10 calls coming per hour. Find each of the following, and round your answers to...
-
Consider the below printed, incomplete Python 3 program to perform clustering on a list of two-dimensional points, given initial centroids. # Call this function to update the centroid of a cluster...
-
Find the precise offset location of each ASCII character or data in the following: ORG 20H 0020:xx DATA1 DB 0040:xx ORG DATA2 DB ORG DATA3 DB ORG DATA4 DW DATA5 DW ORG DATA6 DD DATA7 DQ For DATA2:...
-
For the below tree find: 1- Level order 2- Pre-Order 3- Post-Order 4-in-Order 6 2 7 5 2 11 5 4
-
used, when demultiplexing data up to a TCP socket? Which of the following datagram and segment header fields are Source and destination IP addresses, and source and destination port numbers. O...
-
The following payroll liability accounts are included in the ledger of Miltons Brewery and Grille on January 1, 2010: FICA Taxes Payable .....................$ 662.20 Federal Income Taxes Payable...
-
The figure shows six containers, each of which is filled from the top. Assume that water is poured into the containers at a constant rate and each container is filled in 10 seconds. Assume also that...
-
As the director of the multistate tax planning department of a consulting firm, you are developing a brochure to highlight the services it can provide. Part of the brochure is a list of five or so...
-
Castle Corporation conducts business in States 1, 2, and 3. Castle's $630,000 taxable income consists of $555,000 apportionable income and $75,000 allocable income generated from transactions...
-
Complete the following chart by indicating whether each item is true or false. Explain your answers by referencing the overlap of rules appearing in Federal and most state income tax laws. True or...
-
Manometer computations for the figure below yield a pressure of 16.8 lb/in. (psi) if h=3 ft. If the fluid in the pipe was oil (S.G. = 0.80) under the same pressure, would the manometer measurements...
-
Increasing the temperature of the reaction below will: HBr (1) H Br Br H and (1) (1) A B decrease the rate of reaction and decrease the amount of products at equilibrium decrease the rate of reaction...
-
signal below, periodic with period T = 2. f(t) = t(x-t), Consider the (a) What is wo for this signal? (b) Draw a picture of this signal for -
Study smarter with the SolutionInn App