Starting from:

$34.99

cs405 CS 405 Project 2: Textures + Illumination Solution

Instructions
Please Download the assignment content from SUcourse. Inside the folder, you should see the resources folder and 3 files: project2.html, project2.js, and obj.js.

If you open project2.html in your browser, you should see a screen where you can upload mesh and texture data to render them on your screen:

In this project, you should complete 2 tasks to get full points.
Important note: For all tasks, please only modify the project2.js file. Any submission that modifies the project2.html will not be graded.
Task1
In this task, you should modify the setTexture method inside the project2.js file. The current implementation of this method only accepts pictures that have width and height values of a power of two. To allow any sized images to be used as textures, you should modify the following section:

To test whether your implementation supports any sized images, you can try using the image leaves.jpg under the resources.
Task2
In this task, you should implement basic lighting for this scene. The lighting should at least include ambient light and diffuse light. For this task, you should modify the constructor, setMesh, draw, enableLighting, and setAmbientLight methods, and you should modify the fragment shader(meshFS). If you have implemented the light properly, your scene should look like this:

Without Light

With Lİght You should also be able to change the ambient parameter by using the “Ambient Light Density” slider to get full points from Task 2. Additionally, if the light is working properly, pressing the arrow buttons should change the light’s location. Please check the project2.js file for more information about the task 2.
Report
Additionally, we expect you to write a report that clearly explains your methodology. Any submission without the report will not be graded!
Submission Guidelines
You should upload your work to both GitHub and SuCourse.
GitHub: Uploading the codes only is sufficient. Once you upload your code to GitHub, write the repository link to a txt file named github-link.txt and include that file with your submission to SuCourse.
SuCourse: You should zip all of your work (report, the code(s), and github-link.txt file) and upload it to SuCourse.

More products