Date: April 11, 2021
A program that utilizes VSHADERS, FSHADERS, and buffers in order to sketch out a cylinder polygon given the user input to calculate coordiantes. When the program runs and is given a number value input, it will draw a 3D cylinder in a 2D perspective. Depending if the end caps are declared to be drawn by the checkbox on the webpage, the program will draw a cylinder either with or without end caps.
What was implemented were functions that saved the polygon and coordinates of the n polygon that the user asked for. Other functions implemented were functions to properly format the downloadable files, account for whether the user wants end caps drawn, update the most recent coordinates and polygons for saving, calculate the points for both coordinates and indices, and draw the n polygon. Drawing the coordinates of the polygon utilized VSHADERS and FSHADERS, along with calculations of the Unit Circle, in order to sketch out the skeleton of the polygon.
The user types in a number into the textbox to create a polygon that has N sides. Users can click on the checkbox next to the textbox to decide whether they want to have the end caps of the cylinders drawn or not. Once the user has decided, they may draw the polygon by clicking "Draw" to observe the output.
Below the inputs are options to save files that contain coordinates and polygons. Each textbox is associated with the name of the file and a button to save. Users can name the file they want to save and they can click on either box to save the contents of the coordinates or the polygons.
* A file cannot be saved if there is no output currently on the canvas. The user must draw something in order for the contents to be saved.
* Once a file has been saved, the canvas will reset and if the user wants both .coor and .poly files, they must reinput their value and download the other file. (Ex./ User types in N = 3 and saves .coor. The canvas will reset and must reinput N = 3 to save .poly.)
N = 12 / End Caps = false
N = 5 / End Caps = true
N = 3 / End Caps = false
N = 17 / End Caps = true