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

  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