Create a gouraud light model

Assignment Help Computer Graphics
Reference no: EM13872570

Task 1 - Setting up the space

Purpose:
a. Create a Gouraud light model
b. Experiment with the different component of light

To do:

1. Create a new project (you can use a project or code from previous assignments or tutorials.

Create three spheres close to each other so that you will be able to compare the results of the light models. For example positions the spheres at position 100, 0, 100 and at position 140, 0, 100. The radius of the spheres should be 10 or so, in order to be able to see the effect of the light models.

Colour the spheres red.

Set up a camera view position so that you can see the spheres. (e.g., 200,200,200) and set up the transformation matrix so that you can see the sphere.
Set up perspective projection (e.g., symmetric).

2. Create a camera class that will enable the user to manipulate the camera. You can use the camera code from the tutorial.
Keep with the camera three variables: position, look at vector, and up vector.

The user can manipulate the camera as follows:

Pitch operation - the up and down arrow keys will rotate the camera around the x- axis by +1 degree and -1 degree respectively.
Yaw operation - the left and right arrow keys will rotate the camera around the y- axis by +1 degree and -1 degree respectively.
Roll operation - the "a" and "d" keys will rotate the camera around the z-axis by
+1 degree and -1 degree respectively.
Forward motion - the "w" key will move the camera forward by 1 unit along the "look at" vector.
Backward motion - the "s" key will move the camera backward by 1 unit along the "look at" vector.
3. Display the spheres.


2. Task 2 - Create the Gouraud light model
1. Create the Gouraud light model
2. Use the Gouraud light model on the sphere at position (100, 0, 100)
3. Use the Object material
Material data is -
3.1.1. Ambient (0.2, 0.2,0.2)
3.1.2. Diffuse (0.75, 0.75, 0.75)
3.1.3. Specular (0.8, 0.8,0.8)
Level of shininess is 5 (allow user to change the level of shininess by)
„+? - increases the level of shininess by 2
„-? - decreases the level of shininess by 2 (note minimum should be 0)
4. Light source
Light source is white light
Light position is at 240,210,200

3. Task 3 - Create the Phong light model
1. Create the Phong light model
2. Use the Phong light model on the sphere at position (140, 0, 100)
3. Use the Object material
Material data is -
3.1.1. Ambient (0.2, 0.2,0.2)
3.1.2. Diffuse (0.75, 0.75, 0.75)
3.1.3. Specular (0.8, 0.8,0.8)
Level of shininess is 5 (allow user to change the level of shininess by)
„+? - increases the level of shininess by 2
„-? - decreases the level of shininess by 2 (note minimum should be 0)

4. Light source
Light source is white light
Light position is at 240,210,200

4. Light Models controls
1. Controls
Turning lighting model components on and off
„M? - turn ambient light off
„m? - turn ambient light on
„N? - turn diffuse light off
„n? - turn ambient light on
„B? - turn specular light off
„b? - turn specular light on

Scaling - enable scaling in the x and y directions using the i,j,k,l keyboard strokes -
Pressing on „i? means increment the scale in the x-direction by 0.5 increments;
Pressing on „j? means decrement the scale factor in the x-direction by 0.5. Min scale is 1;
Pressing on „k? means increment the scale in the y-direction by 0.5 increments;
Pressing on „l? means decrement the scale factor in the y-direction by 0.5. Min scale is 1;
Pressing on „r? resets the scale in the x,y,z directions to 1.

5. Task 3 - Compare the lighting models
1. Submit with the code project a short report about the two models:
What is the difference between the models with respect to computation
Compare the two models and state your opinion:
Which model has better visualization? Why?
Add image output of your assignment to demonstrate the differences.
To your opinion is it worth to use the Phong model from performance point of view and from programming efforts point of view?

6. Task 4 - Perform bilinear interpolation
2. Assume that vertex shader has computed the following values at vertices v1, v2, v3:
• V1 - position(5,1,0), (colour (0.9, 0.7, 0.1), normal(1, 3, 3)
• V2 - position(1,3,0), colour (1.0, 0.3, 0.9), normal( 2, 2, 2)

• V3 - position(6,5,0), colour (1.0, 1.0, 0.1), normal( 0, 2, 2)

Assume that:
• Colour and normal are declared as varying at the vertex shader and the fragment shader.
• The fragment shader is currently processing a fragment at position (4,2,0).

What values of colour and normal be transferred to the fragment shader by the GPU?

1786_Create the Gouraud light model.png

7. Bonus1 - Using half vectors
Modify your code in Tasks 2 and 3 and to show the models results when half vectors are used.
1. Controls
Switch to half vectors by using:
„H? - switch to half vector
„h? - switch back to normal view
2. Compare the results to those obtained in Tasks 2 and 3
Are you satisfied with the results
Add comparisons between the models.

8. Bonus2 - Create another light source
1. Create a second light source, which is a spot light.
2. The light cone angle should start at 35 degrees.
Allow the user to control the light cone by pressing
„0? - to increase the cone opening angle in increments of 1 degree. Max angle is 120.
„9? - to decrease the cone opening angle in increments of 1 degree. Min angle is 1
3. Allow the user to control the light focus intensity (angular attenuation)
„8? - to increase the light angular attenuation in increments of 3.
„7? - to decrease the light angular attenuation in increments of 3. Min value is 1 or 0
4. The spot light source should be aimed towards the centre of the sphere
5. The spot light should be positioned at (190, 200, 190)
6. Time permitted add radial attenuation

Reference no: EM13872570

Questions Cloud

How this error would effect the amounts ofcost of goods sold : Repeat M7-16, except assume the 2015 ending inventory was over stated by $ 100,000. Refer M7-16 Assume the 2015 ending inventory of Shea's Shrimp Shack was understated by $ 10,000. Explain how this error would affect the amounts reported for cost of ..
Employees to accumulate vacation leave and to receive : Sophie County allows its employees to earn 10 days of vacation leave every year. It also allows employees to accumulate vacation leave and to receive cash for up to 20 days of leave on termination or retirement
Determine the fair value of the warranty liability for sales : Determine the fair value of the warranty liability for the sales made in 2013. Use expected cash flow and present value techniques. Use an annual discount rate of 6%.
A company incurs the following costs : A company incurs the following costs, which may be capital expenditures or operating expenditures.
Create a gouraud light model : Create a Gouraud light model - Experiment with the different component of light and create a camera class that will enable the user to manipulate the camera.
Determining the initial speed : A proton (mass m = 1.67 x 10-27 kg) is being accelerated along a straight line at 3.6 x 1015 m/s2 in a machine. If the proton has an initial speed of 2.4 x 107 m/s and travels 3.5 cm, what then is?
The town counsel thought he could settle the second claim : The town counsel thought he could settle the second claim for about $ 11,000, but he expected negotiations to drag on for 18 months before reaching agreement. Based on this information, prepare the journal entry (if needed) to adjust Punkeytown 20..
What is the value of c : A particle moves along a straight path through displacement d = (8 m)i + cj while force F = (2 N)i - (4N)i acts on it. (Other forces also act on the particle.) What is the value of c if the work done by F on the particle is?
What is the amount of each payment that patricia must make : What is the amount of each payment that Patricia must make at the end of each of six years to accumulate a fund balance of $35,000 by the end of the sixth year?

Reviews

Write a Review

Computer Graphics Questions & Answers

  Create a simple warm-up program using your g3d

Create a simple warm-up program using your G3D programming and graphics environment.

  Shadow effect while rolling a sphere

Shadow effect while rolling a sphere as well as the options of shading and lighting.

  Relative positioning and interactive positioning

Relative Positioning and Interactive Positioning by Dragging and Clicking and some Simple Animation

  Draw a teapot at the global origin

Draw a teapot at the global origin

  Concepts of computer graphics

Concepts of Computer Graphics and develop a program using OpenGL

  The security policy document outline

Using the GDI Case Study below, complete the Security Policy Document Outline

  Develop the image manipulations

Develop the image manipulations

  What does resolution mean

What does resolution mean How is resolution connected to ppi and dpi units

  Differentiate between a bitmap image and a vector image

Differentiate between a bitmap image and a vector image Explain the following terms

  Essential elements of a design pattern

configuration of an Iterator pattern, patterns could be used in a Library System, Singleton, Template, Decorator, Façade,What does Alexander means by the following declaration "But it is impossible to form anything which has the temperament of natu..

  Framework of user interface design

design of user interfaces, natural mapping, GUI applications, web page design different to designing for printed media, risks exposed in this "phone as individual proxy" approach, interaction designers of ubicomp applications, Storyboards are usual..

  What are the factors affecting picture composition

Define picture composition What are the factors affecting picture composition. Elaborate on each factor Describe the basic lines present in a composition

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd