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

  Choose two 2 public corporations in an industry with which

choose two 2 public corporations in an industry with which you are familiar - one 1 that has acquired another company

  Critical review and application due date05-jun-2013 return

critical review and application due date05-jun-2013 return date 28-jun-2013 length3000 words submission method options

  Question 1a you are working as tv producer for the national

question 1a you are working as tv producer for the national tv station in your country. as such you have been assigned

  Develop a five-year strategic plan with cost estimates and

develop a five-year strategic plan with cost estimates and a time line.describe the situation facing mensa at the time

  Choose an organisation that you have some basic familiarity

choose an organisation that you have some basic familiarity with. it could be the organisation you are currently

  It security report and presentation

The presentation must include appropriate graphics, and may be in a Microsoft PowerPoint presentation format.Online students will submit a presentation that must include detailed speaker notes.

  Modifying the product program through gui

Modify the product Program to use a GUI. The GUI should show the data one product at a time, including the product number, the name of the item, the number of units in stock.

  How graphics will be used in the site

how graphics will be used in the site

  Display the average in the student information

Use this class so that you can input the student's name, their grades and then display the average in the student's information in a label (include the name and their average).

  Select a pair of articles on an identical topic from your

select a pair of articles on an identical topic from your annotated bibliography. this pair can be comprised of a one

  Provide a snapshot of a large amount of data

provide a snapshot of a large amount of data or to illustrate a topic. Poorly-designed pages can take away from the intended message of the document.

  Rank document relevance by number of times input keyword

You should also rank document's relevance by number of times input keyword occurs in document. How to rank document's relevance by number of times input keyword occurs in document.

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