Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE HELP i need help putting this into coding language java Pig 9 - 18 b. What is Gouraud shading? Explain it with an example.

PLEASE HELP image text in transcribed
image text in transcribed
image text in transcribed
i need help putting this into coding
language java image text in transcribed
Pig 9 - 18 b. What is Gouraud shading? Explain it with an example. What are its drawbacks? Answer: (8) Gouraud shading is a method for linearly interpolating a colour or shade across a polygon. It was invented by Gouraud in 1971. It is a very simple and effective method of adding a curved feel to a polygon that would otherwise appear flat. It can also be used to depth que a scene, giving the appearance of objects in the distance becoming obscured by mist. On the left is a curved surface rendered using flat shaded polygons, the other is Gouraud shaded. It is quite clearly smoother and more attractive and well worth spending the time to code. Unlike a flat shaded polygon, you can specfy a different shade for each vertex of a polygon, the rendering engine then smoothly interpolates the shade across the surface. The technique is very similar to the standard scan converting, and can be handled very quickly with integer maths. Some points to note though: It is best to restrict gouraud shading to three sided polygons. Sometimes polygons may not look quite as you expect when they have more than three. Gouraud shading is by no means perfect, but it can make a real difference over flat shaded polygons. Problem with Gouraud shading occur when you try to mix light sourcing calculations with big polygons. 0.7 a. What is random midpoint displacement method? Explain with an example. (10) Answer: Random midpoint displacement method Random midpoint displacement method introduced by Fourineret al. which represents de facto standard in fractal terrains generation techniques. The principle is as follows. An initial square is subdivided into four smaller squares. Let us have four In the next step we virtually rotate the square back by 45 and we recursively apply the first two steps on the four new squares as is mentioned above. This recursive process ends after given number of iteration. Fractal dimension Dof surface is obtained by D=3- H. The fractal dimension of this surface is D=2.5. (a) (b) Figure: Example of fractal terrain with fractal dimension D-2.5. (a) wire frame model (b) the same model textured b. Explain the concept of simulating accelerations in animation. Answer: Simulating Accelerations: - An animation can be specified by giving motion parameters (position, acceleration). This determines the rejections for the in between frames. To simulate accelerations the time spacings can be adjusted for the in between frames (a)Zero Acceleration: - For constant acceleration equal time interval spacing is used in the in between frames motion path can be generated by using sp line curves or any straight line motion path. (b)Non Zero Acceleration: - They are used to display speed changes, particularly at the beginning and the end of the motion sequence. We can model the startup and slow down portions of an animation path with spline or trigonometric functions or through Parabolic Curves. (1) Positive acceleration: - To model increasing speed the time spacing between the frames is increased so that greater changes in position occurs as the object moves faster. (ii)Decreasing accelerations: - The in between spacing is decrease to make the movement of object slaves e. Write a short note on Self Similar fractals. Answer: [10, 40, f (10,80)], 31, 90, f (*1, )], [70, 91, (70, 1)], [11, 01, f (*1, 0,1)] points . In the first step we add one vertex 1 1/2, 1/2, f (*1/2, 1/2)] into the middle. The vertex is denoted where 11/2 = 540 +22)91/2 5(30+11) (31/2, 01/2) = (30,) + F(*., De) + f(70, 9:) + f($1,5:)) The added vertex is shifted in 2-coordinate direction by random value denoted by This procedure is recursively repeated for each subsquare, then for every their descendants, and so on Figure 2: First four steps in random midpoint displacement method In order to be resulting surface fBm, the random number must be generated with Gaussian In=0,0 = 1 distribution and in the i-th iteration step the variation have to be modified according to 01 gauto" where H denotes Hurst exponent (1 H 2 ). From equation (1) we can see that the first iteration has the biggest influence to the resulting shape of the surface and influence of the others decreases. In the second step we calculate the points on the edges of initial square. We virtually rotate square by 45" and calculate the values as in the previous step. The problem is in the cases when the new point has just three neighbors. In this case we calculate the average of three neighbors only. The error produced on the border could be neglected. O IETE 18 2.1 Random midpoint displacement method Random midpoint displacement method introduced by Fourineret al. [4represents de facto standard in fractal terrains generation techniques. The principle is as follows. An initial square is subdivided into four smaller squares (see Figure 2) Let us have four points . . . .. ... ... In the first step we add one vertex into the middle. The vertex is denoted by a f a ll, where + ya. - Urs)+F9)+Ff93)+22) The added vertex is shifted in a-coordinate direction by random value denoted by 6. This procedure is recursively repeated for each subsquare, then for every their descendants, and so on. Figure 2: First four steps in random midpoint displacement method In order to be resulting surface Bm, the random number & must be generated with Gaussian distribution la = 0,= 1 and in the i-th iteration step the variation have to be modified according to where H denotes Hurst exponent [6] (152 ). From equation (1) we can see that the first iteration has the biggest influence to the resulting shape of the surface and influence of the others decreases In the second step we calculate the points on the edges of initial square. We virtually rotate square by 45 and calculate the values as in the previous step. The problem is in the cases when the new point has just three neighbors (the encircled points in Figure 2). In this case we calculate the average of three neighbors only. The error produced on the border could be neglected. In the next step we virtually rotate the square back by and we recursively apply the first two steps on the four new squares as is mentioned above. This recursive process ends after given number of iteration Fractal dimension Dof surface is obtained by D-3-H. An example of fractal terrain obtained with random midpoint displacement algorithm is in Figure 3. The fractal dimension of this surface is D-2.5. Figure: Example of fractal terrain with fractal dimension D-2.5. (a) wire frame model (b) the same model textured Pig 9 - 18 b. What is Gouraud shading? Explain it with an example. What are its drawbacks? Answer: (8) Gouraud shading is a method for linearly interpolating a colour or shade across a polygon. It was invented by Gouraud in 1971. It is a very simple and effective method of adding a curved feel to a polygon that would otherwise appear flat. It can also be used to depth que a scene, giving the appearance of objects in the distance becoming obscured by mist. On the left is a curved surface rendered using flat shaded polygons, the other is Gouraud shaded. It is quite clearly smoother and more attractive and well worth spending the time to code. Unlike a flat shaded polygon, you can specfy a different shade for each vertex of a polygon, the rendering engine then smoothly interpolates the shade across the surface. The technique is very similar to the standard scan converting, and can be handled very quickly with integer maths. Some points to note though: It is best to restrict gouraud shading to three sided polygons. Sometimes polygons may not look quite as you expect when they have more than three. Gouraud shading is by no means perfect, but it can make a real difference over flat shaded polygons. Problem with Gouraud shading occur when you try to mix light sourcing calculations with big polygons. 0.7 a. What is random midpoint displacement method? Explain with an example. (10) Answer: Random midpoint displacement method Random midpoint displacement method introduced by Fourineret al. which represents de facto standard in fractal terrains generation techniques. The principle is as follows. An initial square is subdivided into four smaller squares. Let us have four In the next step we virtually rotate the square back by 45 and we recursively apply the first two steps on the four new squares as is mentioned above. This recursive process ends after given number of iteration. Fractal dimension Dof surface is obtained by D=3- H. The fractal dimension of this surface is D=2.5. (a) (b) Figure: Example of fractal terrain with fractal dimension D-2.5. (a) wire frame model (b) the same model textured b. Explain the concept of simulating accelerations in animation. Answer: Simulating Accelerations: - An animation can be specified by giving motion parameters (position, acceleration). This determines the rejections for the in between frames. To simulate accelerations the time spacings can be adjusted for the in between frames (a)Zero Acceleration: - For constant acceleration equal time interval spacing is used in the in between frames motion path can be generated by using sp line curves or any straight line motion path. (b)Non Zero Acceleration: - They are used to display speed changes, particularly at the beginning and the end of the motion sequence. We can model the startup and slow down portions of an animation path with spline or trigonometric functions or through Parabolic Curves. (1) Positive acceleration: - To model increasing speed the time spacing between the frames is increased so that greater changes in position occurs as the object moves faster. (ii)Decreasing accelerations: - The in between spacing is decrease to make the movement of object slaves e. Write a short note on Self Similar fractals. Answer: [10, 40, f (10,80)], 31, 90, f (*1, )], [70, 91, (70, 1)], [11, 01, f (*1, 0,1)] points . In the first step we add one vertex 1 1/2, 1/2, f (*1/2, 1/2)] into the middle. The vertex is denoted where 11/2 = 540 +22)91/2 5(30+11) (31/2, 01/2) = (30,) + F(*., De) + f(70, 9:) + f($1,5:)) The added vertex is shifted in 2-coordinate direction by random value denoted by This procedure is recursively repeated for each subsquare, then for every their descendants, and so on Figure 2: First four steps in random midpoint displacement method In order to be resulting surface fBm, the random number must be generated with Gaussian In=0,0 = 1 distribution and in the i-th iteration step the variation have to be modified according to 01 gauto" where H denotes Hurst exponent (1 H 2 ). From equation (1) we can see that the first iteration has the biggest influence to the resulting shape of the surface and influence of the others decreases. In the second step we calculate the points on the edges of initial square. We virtually rotate square by 45" and calculate the values as in the previous step. The problem is in the cases when the new point has just three neighbors. In this case we calculate the average of three neighbors only. The error produced on the border could be neglected. O IETE 18 2.1 Random midpoint displacement method Random midpoint displacement method introduced by Fourineret al. [4represents de facto standard in fractal terrains generation techniques. The principle is as follows. An initial square is subdivided into four smaller squares (see Figure 2) Let us have four points . . . .. ... ... In the first step we add one vertex into the middle. The vertex is denoted by a f a ll, where + ya. - Urs)+F9)+Ff93)+22) The added vertex is shifted in a-coordinate direction by random value denoted by 6. This procedure is recursively repeated for each subsquare, then for every their descendants, and so on. Figure 2: First four steps in random midpoint displacement method In order to be resulting surface Bm, the random number & must be generated with Gaussian distribution la = 0,= 1 and in the i-th iteration step the variation have to be modified according to where H denotes Hurst exponent [6] (152 ). From equation (1) we can see that the first iteration has the biggest influence to the resulting shape of the surface and influence of the others decreases In the second step we calculate the points on the edges of initial square. We virtually rotate square by 45 and calculate the values as in the previous step. The problem is in the cases when the new point has just three neighbors (the encircled points in Figure 2). In this case we calculate the average of three neighbors only. The error produced on the border could be neglected. In the next step we virtually rotate the square back by and we recursively apply the first two steps on the four new squares as is mentioned above. This recursive process ends after given number of iteration Fractal dimension Dof surface is obtained by D-3-H. An example of fractal terrain obtained with random midpoint displacement algorithm is in Figure 3. The fractal dimension of this surface is D-2.5. Figure: Example of fractal terrain with fractal dimension D-2.5. (a) wire frame model (b) the same model textured

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

=+9. Think about a campaign direction.

Answered: 1 week ago

Question

=+Who is the audience?

Answered: 1 week ago