Rotating Triangles (webgl)
The are 3 files here, but only the Triangle.js file needs to be modified.
The program only works if the files are in the same location as the common file (uncompressed)
The html file should show 3 inactive triangles when clicked on. That was all I could do with my skill level. I need each triangle to rotate around its centroid using an identity matrix transformation.
Here is how it should work:
"use strict";
function transformTriangle (triangle, centroid, theta)
{
// rotate the triangle around the centroid for theta degrees counter-clockwise
// perform transformation here
// do not modify the original triangles
// return a newly created (and transformed) triangle instead
return triangle;
}