CS 418 Interactive Computer Graphics Assignment

Assignment Help Computer Graphics
Reference no: EM132491103

CS 418 Interactive Computer Graphics - University of Illinois

MP3: Environment Mapping

Your goal is to write an app that loads the Utah teapot from a file and renders it.

Your app should have the following features:

Rendered in perspective
Skyboxing
Allow the user view to orbit around the teapot.
Allow the user to make the teapot rotate.
A control in the HTML that allows the user to switch between
simply shading the teapot
making the teapot reflective
making the teapot refractive.
Your code should use a cubemap for the required texture effects.
Reflection on the teapot should always be consistent with the scene rendered on the skybox
When using the cube map on the teapot, you do not have to also use Phong relection.
How to Work on the MP
You should work on the MP incrementally. Test each piece before moving on. Start now. Here's a suggested plan of attack:

Week 1: Implement the skybox and cubemap and orbit.
Create a mesh of a cube using 12 triangles centered at origin. Test.
Add the cube map and move the view inside the cube to see the skybox. Test.
Add in the ability to orbit the view inside the skybox around the origin. Test.
Week 2: Implement reader for the teapot and reflective shader and rotation
Incorporate the OBJ reader code to load the teapot.
Add a reflective shader for the teapot. Test.
Add rotation for the teapot. Test.
Week 3: Implement phong shader and refractive shader
Implement refraction. Test.
Implement phong shader. Test.

Multiple Shaders
You should implement more than one shader program for this MP. At a minimum, it makes sense to have separate shaders for the teapot and skybox. You could break it down even further and have three shader programs for the teapot (Phong, reflective, and refractive). Be very careful if you cut and paste code when doing this. In given code using single shaders, lots of information, e.g. location of attributes in the shader program, is stored as attributes of the program object. You will need to handle these correctly for each shader program.

Skyboxing
Create and draw an environment using skyboxing...render a large cube surrrounding the viewer...this is the skybox. Use the cube map images to texture map the inside of the skybox. You should use the same set of six images that you will use for the teapot environment map later in Part 2 of this MP.

Just to be clear, instead of texture mapping each side of the skybox independently, you should use the cubemap use that...you just have to figure out what direction vector to use when accessing the environment map to color a fragment on the box.

Background Reading and Resources
A set of 6 image files forming a cubemap are available in this zip file. You can use these for the MP if you wish.

A good tutorial about using cube maps is available from webglfundamentals.org

You can make your own cubemaps as well. Alternatively you can try to use one of the cubemaps from this collection.

Teapot Mesh
You can grab an OBJ file containing the famous Utah Teapot Mesh here.

Background Reading and Resources
The OBJ file format is documented in this wikipedia article. You will need to get the OBJ file from the server, and then parse it to generate the vertex and face arrays. You can reuse code you completed for the in-class lab exercise on meshes.

If you didn't do the exercise, you can use the function given in readText.js to get a file and send it to the function you will write to parse the file.

Use the above linked teapot model, which consists only of vertices and triangular faces. Load the vertices into a vertex position array, and the triangle faces into a face array whose elements are triples of vertex indices. Note that the indices of the vertices in the OBJ start at 1. This means you will need to adjust them assuming your arrays start indexing at 0. You will need to create per-vertex normals for the mesh as well, which you should compute as the average normal of the the trangles incident on the vertex.

Running a Local Server
To get around the issue of reading files from the local filesystem, it is best to test by running a local webserver. There are two relatively easy ways to do this:

If you use the Brackets editor, the live preview function will start up a server (and browser) to test your code. Just have Chrome open, and the open your html file in Brackets. Click the lightning bolt icon in the top right of the Brackets window.

Alternatively, you can install node.js Then install and run httpserver to serve the directory that it is run from.

User Interface
Your user interface should alllow to the user view to orbit the teapot (just letting the view circle the teapot by rotating around the y-axis is fine, it needn't employ quaternions). This effect can be achieved by rotating the world (teapot and enclosing environment box) assuming the teapot is at the origin. Or you can implement it as part of the view tranformation.

You should also allow the user to make the teapot rotate. Again you can simply keep track of an angle of rotation around Y, and apply this transformation only to the teapot.

Lighting
Use a point light source to light the model from the direction (1,1,1). You can adjust the ambient light as you wish, but it must be possible to see the effects of diffuse shading and a specular highlight on the teapot. Use the Blinn-Phong or Phong reflectance model and Phong shading.

Comment appropriately
You should comment each file with an author comment and comment each function you write with a header. Use JSDoc comments with the appropriate tags and types. Details can be found in the Google JavaScript Style Guide.

Attachment:- Interactive Computer Graphics.rar

Reference no: EM132491103

Questions Cloud

Would prevention intervention program in schools : Would you consider using Evidence-based intervention prevention intervention program in schools such as the JUST SAY NO campaign?
Describe changes to geico total rewards program : Assuming employees are unhappy with the current plan, offer two (2) improvements or changes to Geico's total rewards program. Use at least five (5) quality.
Evaluate one strength and one limitation of feminist theory : Explain how, specifically, you will set the tone throughout your work with the client to reduce the hierarchical relationship and make it more collaborative.
What are some violence indicators an employee might display : What are some violence indicators an employee might display? What are some actions management can take to help prevent workplace violence?
CS 418 Interactive Computer Graphics Assignment : CS 418 Interactive Computer Graphics Assignment help and solution, University of Illinois - assessment writing service - Environment Mapping
What are the issues surrounding with cocos : What are the issues surrounding with CoCos( Contingent convertible bonds). Can you list some problems and explain it.
Did kendyl use the correct statistical test : Which statistical test should Kendyl use to analyze her data and answer the research question? did Kendyl use the correct statistical test
Discuss which bond portfolio management strategy : Discuss which bond portfolio management strategy- Bullet or Barbell will you adopt under each scenario and why?
What are the effects on cash flow : What are the effects on cash flow, if sales increase from $14 million to $15.4 million? (Input the amount as positive value. Enter your answer in dollars not in

Reviews

Write a Review

Computer Graphics Questions & Answers

  Redraw the circle

In the first round, the circle should stay visible for 1 second and each subsequent round the visible time should be 25% shorter than the previous round

  State the reason why we prefer unit x interval or unit y

State the reason why we prefer unit x interval or unit y interval while scan converting various geometric forms. (b) Implement DDA algorithm to compute pixels along the line AB from A (0,0 ) to B (-5, -5 ). Consider a parallel projection with the pla..

  Provide a visual to show how you would improve it

In interview scenarios, the common kind of 'test' comes in the form of (i) asking you to comment on an existing/given visualisation

  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?

  The html tag that specifies a link

The HTML tag that specifies a link, or the text associated with the reference that is highlighted in the document

  Write Bresenham line drawing algorithm

Write Bresenham's line drawing algorithm. Consider the line from (20, 10) to (30, 18). Use the Bresenham's algorithm to rasterize the line

  Develop and prototyp a new interface design

The menu structure for Holiday travel vehicles existing character based system is shown here. Develop and prototyp a new interface design for the systems functions, using a graphical user interface

  Question 1jarum industrial tools is considering a 3-year

question 1jarum industrial tools is considering a 3-year project to improve its production efficiency. buying a new

  Write a narrative that describes how about designing

Write a narrative that describes how you went about designing and implementing these modifications, how you tested your program. Did you use the test case during development or did you use the final words.txt from the start, or what?

  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.

  State one advantage of using a wireless connection

State one advantage of using a wireless connection compared to a cabled connection.

  Website designs with exemplary design features

Identify two Web websites that you feel exhibit exemplary design features. Explain why you selected each site. What design features stand out on each website?

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