Description
COMP.4270/5460 Programming Assignment 1 Solution
WebGL Introduction
This assignment will use the gasket1.html and gasket1.js which are explained in Ch 2. Using these files
as the baseline, do following
• move all JS code out of html file
• draw following in continuous loop—say 10 times
◦ change color—each iteration will be different color
◦ change size of image—large to small in steps and back to original size
◦ vary number of points in steps of 500-5000
Files may be found in
http://cs.uml.edu/~kseethar/Spring2020/programs/p1/
Deliverables
• Source files
• Sample Input/output
• 1 page report : Write about issues faced, lessons learned, any remaining bugs etc.
Extra Credit
• any other functionality …. – please document in report and code.
Deadline and Late Submissions
• The assignment is due on the date specified above at 11:59:59 PM
• Each day late will incur a penalty of 5% of the grade for the assignment; for example, if the
assignment is 3 days late, the maximum grade will be 85 out of 100—15 will be subtracted
from whatever grade is assigned.
COMP.4270/5460 Programming Assignment 2 Solution
User Interaction/Callbacks
This assignment will extend the assignment 1 by adding the following input controls and callback
handlers:
• number of points through a slider
• color thro either rgb text boxes or color picker
• buttons to perform specific actions
• display status as processing happens
Here is a mockup—you are free to design your own interface:
use the gasket1.html and gasket1.js which are explained in Ch 2. Using these files as the baseline, do
following
• move all JS code out of html file
• draw following in continuous loop—say 10 times
◦ change color—each iteration will be different color
◦ change size of image—large to small in steps and back to original size
◦ vary number of points in steps of 500-5000
Files may be found in
http://cs.uml.edu/~kseethar/Spring20 20 /programs/p1/
Deliverables
• Source files
• Sample Input/output
• 1 page report : Write about issues faced, lessons learned, any remaining bugs etc.
Extra Credit
• any other functionality …. – please document in report and code.
Deadline and Late Submissions
• The assignment is due on the date specified above at 11:59:59 PM
• Each day late will incur a penalty of 5% of the grade for the assignment; for example, if the
assignment is 3 days late, the maximum grade will be 85 out of 100—15 will be subtracted
from whatever grade is assigned.
COMP.4270/5460 Programming Assignment 3 Solution
Rubberbanding & Transformations
Implement the following 2d transformations using HTML Canvas/Javascript. You can use Canvas
primitives to draw shapes only. The transformation should be applied using rubber banding. Define
appropriate event handlers to do the transformations and rubberbanding.
• Translation
• Scaling
• Rotation
Apply the transformations to the following shapes:
• Line
• Circle
• Rectangle
• Triangle
• Polygon
Deliverables
• Source files
• Sample Input/output
• 1 page report : Write about issues faced, lessons learned, any remaining bugs etc.
Extra Credit
• any other functionality …. – please document in report and code.
Deadline and Late Submissions
• The assignment is due on the date specified above at 11:59:59 PM
• Each day late will incur a penalty of 5% of the grade for the assignment; for example, if the
assignment is 3 days late, the maximum grade will be 85 out of 100—15 will be subtracted
from whatever grade is assigned.
COMP.4270/5460 Programming Assignment 5 Solution
Basic 2d Shapes
Implement the following 2d algorithms using HTML Canvas/Javascript. You cannot use direct
Canvas primitives—assume you can draw a single point and develop these algorithms.
• DDALine
• MidpointLine – handle all slopes
• MidpointCircle
• MidpointEllipse
There should be buttons to select the algorithm/shape.
There should be text boxes to accept (x1, y1) and (x2, y2) for line; and (x,y) and r for circle
Handle all slopes/quadrants—supplied code does not
Draw the same shapes using Canvas primitives and compare if they are identical or not; analyze and
write in your report.
Sample code may be found at
http://www.cs.uml.edu/~kseethar/Spring2020/programs/p5/
Deliverables
• Source files
• Sample Input/output
• 1 page report : Write about issues faced, lessons learned, any remaining bugs etc.
Extra Credit
• any other functionality …. – please document in report and code.
Deadline and Late Submissions
• The assignment is due on the date specified above at 11:59:59 PM
• Each day late will incur a penalty of 5% of the grade for the assignment; for example, if the
assignment is 3 days late, the maximum grade will be 85 out of 100—15 will be subtracted
from whatever grade is assigned.



