Construct a function to display your composite objects

Assignment Help Computer Graphics
Reference no: EM13909716

Instructions

Open the file "Lab 3.sln". You are given a skeleton program that displays a ball with only flat shading.

Step 1: Add in the normals for smooth shading.

357_Skeleton program.png

By pressing ‘S', the program will switch to smooth shading and turn the variable m_Smooth to be true. You have to put in the correct normal for each vertex in the function drawSphere(). Also please put suitable comments to explain why and how your normal is computed. After adding the normal computation, your sphere should look like the figure on the left.

Step 2: Add in the highlight.

By pressing ‘H', the specular term will be active and there should be some highlight in your object. You should put in the material property if the variable m_Highlight is on. So your sphere should look like the right figure above.

1125_Skeleton program1.png

Step 3: Create your own object(s).

Now, it is the turn for you to show your creativity and make your own object. The main drawing routine is the function display() in the file main.cpp. Modify it if necessary and make your program to display another primitive object by pressing ‘2'. You have freedom to create any object that is not totally flat. Namely, your new object must have some curved surfaces, e.g. an ellipsoid, a cone, a paraboloid, etc.

Do not create an object which only consists of flat surfaces such as a cube or a tetrahedron. Your new object must be able to be displayed in all flat shading, smooth shading and with or without highlight modes. You can create more than one primitive object if you want.

Step 4: Create your own composite objects.

A composite object is constructed by various transformations and copies of your primitive objects. Construct a function to display your composite objects and name your creation an artistic title. The sample program gives two such objects, the one in the very first beginning of this document is called "Da Human Code" and another named "Diamond" in the figure below. In this assignment, construct two such composite objects (for ‘3' and ‘4').

587_Skeleton program2.png

We will grade how innovative and beautiful your objects are as well as how compact and clever your program is, e.g., the examples above are only about ten lines of C++ code. However, please do NOT create any offensive objects that cause any harassment.

In this assignment, you cannot use any library, e.g. drawSolidSphere() in GLUT library, to help you create an object. You must specify the polygon vertices of your object by yourself.

Attachment:- Assignment.rar

Reference no: EM13909716

Questions Cloud

Past interpretations of government and its role? : past interpretations of government and its role?
Explain relationship between discount rate and present value : Although the payment made on an amortized loan is constant, it can be decomposed into two components. What are the TWO (2) components? Describe the patterns of each component over time.
Justification for implementing a database management system : You have been hired as a consultant for a small retail company that sells widgetsonline. The company is interested in learning how to use their data to improve theirbusiness. They have asked you to write a business case (search term business casetemp..
Hi test company uses the weighted average method : Hi Test Company uses the weighted average method of process costing to assign production costs to its products.
Construct a function to display your composite objects : You are given a skeleton program that displays a ball with only flat shading - Construct a function to display your composite objects and name your creation an artistic title. The sample program gives two such objects.
What is the cost of capital for this project : Suppose CFO will borrow 50% of capital from a bank with 10% interest, and 50% of capital through equity with 22% of require rate of return. What is the cost of capital for this project?
Find the mean and variance of x : Find the mean and variance of X. Assuming that {Xm; m ≥ 1} is an IID sequence with the distribution of X and that Sn = X1 + ··· + Xn for each n, find the mean and variance of Sn. (No explanations needed.)
Find the moment generating function of x : Find the moment generating function (MGF) of X (or find the Laplace transform of fX (x)), and use this to find the moment generating function (or Laplace transform) of Sn = X1 + X2 + ··· + Xn. Invert your result to find fSn (t).
What is the cash flow at the end of the 4th year : At an inflation rate of 9 percent, the purchasing power of RM1 would be cut in half in 8.04 years. How long to the nearest year would it take the purchasing power of RM1 to be cut in half if the inflation rate were only 4 percent?

Reviews

Write a Review

Computer Graphics Questions & Answers

  Display the properties that correspond to the search

Display the properties that correspond to the search made by the user on the search page. 10% for search functionality - 10% for the displaying the results in an effective and pleasant way

  Bundled attribute what is bundled attribute types of

what is bundled attribute ? ltbrgttypes of bundled attribute? ltbrgtexplain abount over all bundled atttribute?

  Specify a triangle with three mouse presses

Write a program that allows the user to specify a triangle with three mouse presses. After the first mouse press, draw a small dot. After the second mouse press, draw a line joining the first two points.

  Website template design

Recognize a few sites that appear to be designed using either a template or style sheet. What types of documents lend themselves easily to templates?

  Create a gui message panel that uses 4 different fonts

Create a GUI message panel that uses 4 different fonts, colors and styles ( bold ect ) with messages of your choice.

  Potential multimedia presentation

Create a short description of a potential multimedia presentation that could be implemented across the WWW for a particular subject of interest to you.

  What is meant by diminishing marginal returns?

What is meant by diminishing marginal returns? Explain how this concept is equivalent to increasing marginal cost.

  Draw and explain the diagram of a raster scan system

Draw and explain the diagram of a Raster scan system with a display processor. Explain each unit of the diagram.

  What will the histogram of pixel intensities look like

Draw the cumulative histogram for this image (see Figure 1). What will the histogram of pixel intensities look like after applying histogram equalization?

  Write a gui-based program that analyzes a round of golf

Write a GUI-based program that analyzes a round of golf. You will retrieve the data from 18 holes from a text file. On each line in the file will be the par for the hole(3, 4, or 5) and your score for that hole. Your program should read the file a..

  How to work on datasturetur assignment how to work on

how to work on datasturetur assignment how to work on datasturetur assignment how to work on datasturetur assignment

  Shadow effect while rolling a sphere

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

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