Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Graphics Expert

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

Computer Graphics, Computer Science

  • Category:- Computer Graphics
  • Reference No.:- M91537680
  • Price:- $180

Guranteed 48 Hours Delivery, In Price:- $180

Have any Question?


Related Questions in Computer Graphics

The saffir-simpson hurricane scale classifies hurricanes

The Saffir-Simpson Hurricane Scale classifies hurricanes into five categories numbered 1 through 5. Write an application named Hurricane that outputs a hurricane's category based on the user's input of the wind speed. CA ...

You have a program draw a rectangle on the screen and allow

You have a program draw a rectangle on the screen and allow the user to change the color/size of the rectangle. The program will store in the browser the settings of the color/size so that upon revisiting the page, the v ...

The problemyou are to search a bitmap in rgb format and

The problem: You are to search a bitmap in RGB format and count the number of pixels which match a set of colors. The bitmap will be 1024 by 1024 pixels for the purposes of explaining this problem. The set of colors will ...

Please read my question if you post copy and pasted code

Please read my question if you post copy and pasted code you will get a negative review. This is java In this graphical program, you are going to simulate arcade car racing game. You need a single player that is movable ...

Question a describe the architecture of simple raster

Question : a) Describe the architecture of simple raster graphics system? b) Explain raster scan display processor?

The problemsit is strongly recommended that you tackle the

The problems: It is strongly recommended that you tackle the following tasks in a modular way -- a separate standalone function for each task. Draw a rectangle as a Rectangle and as a Polygon. Make the lines of the Polyg ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As