The purpose of Project 5 is to practice texturing.
Add the four WebGL utility libraries and copy your HTML and JavaScript sources from Project 4, renaming them for Project 5.
webgl-utils.js
webgl-debug.js
cuon-utils.js
cuon-matrix.js
prog5.js
prog5.html
This application will take tables of vertex positions, vertex normals, and triangle indices, as before, with the new addition of vertex texture coordinates. Render this data using per-fragment illumination with texturing and a point light source. Follow the texture mapping template in the notes, but integrate the shading technique shown there with the lighting model shader. Note that the texture image is an attribute of the Model, not the Shader, and design your objects accordingly.
Allow the user to tumble the shaded model by dragging in the canvas. Add range input sliders to the HTML source allowing the position of the point light source to be given in the range −5 to +5 along the X, Y, and Z axes.
The data and texture are given here:
The output should look something like the image at the upper-right.
You might need to use this URL for the texture, as your browser will probably forbid a cross-origin request for an image on your hard drive.
Since you copied your source forward from Project 4, there might be dead code. Eliminate it. And again, format carefully. Upload all of your project files to your prog5
directory on classes.csc.lsu.edu and p_copy
them before the deadline.