webgl代写 | Computer Graphics代做 | 代写mining | project | html代做 | assignment – CSE 470 Introduction to Computer Graphics

CSE 470 Introduction to Computer Graphics

webgl代写 | Computer Graphics代做 | project | html代做 | assignment – 本题是一个利用webgl进行练习的代做, 对webgl的流程进行训练解析, 涉及了Computer Graphics等代写方面, 这是值得参考的assignment代写的题目

ass代做 assignment代写 代写assignment

CSE 470 Introduction to Computer Graphics HW 3 Lights, Camera, Action! Instructor: Dianne Hansford? Spring Semester 2020

Objectives: Gain experience with the following.

  • creating parameters for the Phong illumination model
  • Gouraud shading and the vertex shader
  • drawing multiple objects
  • LookAt and perspective functions
  • parametric surfaces and surface normals
  • building a triangulation data structure
  • interaction and event handlers

Big Picture You will develop an application that displays a surface of revolution. The user can select from two surfaces. The surface will be Gouraud shaded, using Phong illumination based on exact vertex normals. The application allows for different lighting and material effects and modification of the perspective field of view parameter. Details of these program features are described below.

Specifications Build your program based on the code provided with these specifications.

  1. Surface of Revolution (SOR) (a) Createtwo surfaces of revolution (SOR) : a cylinder and an inter- esting shape of your choosing (excluding a sphere). Let the SOR be s(t,) over the domain[0, 2 ] andt [a,b], wherea andbare real numbers of your choice. The SOR is defined by a generating curve (generatrix),
g(t) =



rotated around they-axis, wheref(t) is a function. For the cylinder,
you could choosef(t) = 1.0 and lets choosea=1 andb= 1.
(b) The surface creation function should have the number of evaluations
in thet- and-directions as input in order to make testing easy.
(c) Calculate exact normals at the vertices. (See Lighting and Shading
ppt, slide 37.)
(d) Create a triangulation  Data structure using an index array that points
to the vertex and normal arrays. Drawing the triangulation will be
done usingdrawElements. (See cube.zip and cubev program for an
implementation example. See Week 5, Geometry Part 2 notes for a
description of the data structure.)
(e) For each SOR, create a minmax box. This will be helpful for deter-
 mining perspective parameters and a good light position. Print this
minmax box to the console.
(f) Tip: Get this working for the cylinder first.
(g) I recommend putting all the vertices for the cylinder and custom
surface in one points/normals data structure. At the time of drawing,
you can use an offset to access the second surfaces data.
(h) Render the surface with the Phong illumination model (as done in
shadedspher1 demo) with Gouraud/vertex shading.
(i) The surface construction code must be in a file, called last-
Namegeometry.js, which is separate from the initialization and event
  1. Materials
(a) Createtwodistinct materials.
(b) Create a user interface to toggle between materials.
(c) Give these materials names to characterize them, not material 1.
(d) The material names should appear with the user interface in the
 html page.
  1. Light
(a) Set the initial light color to white.
(b) Provide a user interface to toggle between white and a different color.
(This second color should not produce a black object.)
(c) You can choose the initial position, but it must illuminate the object
for the viewer. (This should not be at the eye.)
(d) Provide a user interface to move the light to the eye/viewer position.
  1. Modeling and Viewing
(a) Use the LookAt function from MV.js.
(b) Use the perspective function from MV.js
(c) Initialize the aspect ratio to be one and the field of view (fov) to be
60 degrees. Determine reasonable near and far parameters.
(d) A slider will allow the user to adjust the fov.
(e) You must use the supplied code that rotates the object via the mouse.
  1. User interaction All controls (buttons, sliders, etc) must be accompanied by descriptive text. Organize buttons into sections based on functionality and add text that identifies these sections. (a) The SOR can be rotated via click and mouse movements using code supplied to you. (b) Add a control to allow selection between the two SORs. (c) Add a control to allow the user to change the material properties to two different settings. (d) Add a slider to allow the shininess factor to change from 1 to 100. (See rotatingSquare3 program for a slider example.) (e) Add a controls to allow change in the lights color. (f) Add a slider to allow the fov to change from 10 to 100 degrees.
  2. Print to the console Each value printed must be accompanied by text that describes the value. (a) The minmax box dimensions for the two SORs (b) Initial Eye, At, Up (c) Initial perspective arguments
(d) Initial light position

Other Program Details

  1. Create three files: lastNamehw3.html, lastNamehw3.js, last- Namegeometry.js.
  2. Next to the canvas, display
    • Your name
    • Date
    • Program description
    • Resources you used

General Guidelines

  1. Add your name to the top of each file.
  2. Name your zip file: lastNameHW3.zip.
  3. Files in zip folder should be lastNamehw3.html, lastNamehw3.js, last- Namegeometry.js.
  4. Turn in your assignment on Canvas.
  5. We will grade the last submission only.

More Tips

  1. The code you have been given does not function correctly. You might want to start from scratch and add the pieces when you are ready.
  2. Map out on paper, how you want to proceed, step by step.
  3. Dont hack out code. Have equations and code structure on paper first.
  4. Work on one piece of functionality at a time and test.
  5. Print out intermediate and final values to test for correctness.
  6. Ask for help if you are unsure how to start or you run into a bug you cant find.
  1. You can discuss the project with classmates, but be very careful about sharing code/variable names. Be sure you are aware of the Student Code of Conduct and Integrity policy. Links are provided in the class syllabus.

Extra Credit Do not attempt the extra credit functionality until you have the HW fully functioning. If you do extra credit, create and label a separate section in the html document with the controls for this extra functionality.

  1. A button to animate the light source, rotating it around the object.
  2. Create a button to toggle display surface normals
  3. If you have an idea, talk with the instructor.