CS 432 Interactive Computer Graphics
Computer Graphics | 代做html | 代写webgl | opengl代写 – 本题是一个利用CG进行练习的代做, 对CG编程的流程进行训练解析, 涉及了webgl opengl等代写方面, 这个项目是assignment代写的代写题目
assignment 7 Lighting
- Add material properties to your objects and compute colors using lighting effects.
In this assignment you will build a small world consisting of three objects each with different material properties. You will also have two different light sources to illuminate the scene.
The background should be light gray (0.9, 0.9, 0.9, 1.0) on a square canvas with the viewport populating the entire canvas.
There will be three objects in the scene:
- A ground plane.
- A sphere sitting atop the ground plane.
- A cube, also sitting atop the ground plane.
Description of the how the objects are to be rendered, the camera interface, and the material- light interactions are described in the next sections.
You can decide the size of your ground plane and its material properties. However, the location of its vertices must be computed using recursive subdivision so that we can have good lighting effects. Since we are doing light effects, all our objects should also have per- vertex normal attributes placed on the GPU.
Your sphere can be created however you like (parametrically, via recursive subdivision, loaded model, etc..). Your per-vertex normal attributes should be either computed using Gourauds method or based on the parametric equation of a sphere. Material properties of the sphere are up to you.
Your cube should be based on the code shown in the lecture material. Once again, well now also need per-vertex normal attributes on the GPU and you may choose the material properties of the cube.
You should have one directional light that acts like a sun in that it rises in the east (right) and sets in the west (left). To do this you will change the direction of the light via animation.
The second light is a flashlight implemented as a spotlight always positioned at the center of the camera, pointed in the direction of the camera.
Your scene should look something like this.
You must have some camera interface so that the user can explore the world. The nature of the interface is up to you, but there should be instructions in the html document so that a user knows how to use it.
Your camera should use perspective projection, although the parameters of it are up to you.
- key (spacebar): This toggles between the flashlight being on and off.
What to submit?
Submit a single zip file containing all the files needed to run your code.
We should be able to extract your file, navigate to your directory, run an http server there and run your code in a browser.
- Objects placed logically/correctly in the world: 2pts
- Camera interface documented and behaves properly: 2pts
- Directional light behaves properly: 2pts
- Flashlight behaves properly: 2pts
- Toggling the flashlight on and off works: 2pts