Assignment 2: Painting Geometric Shapes
- Due Oct 14, 2018 by 11:59pm
- Points 10
- Submitting a file upload
Objectives
To create a scene structure that will support simple geometric shapes made out of triangles.
Description
You will use the base code provided below to modify your Paint web application to draw simple geometric shapes made out of triangles (instead of points).Your application is required to have the following features:
-
A canvas where the user can click to draw simple geometric shapes.
- When the user clicks on the canvas, a shape (square, triangle or sphere) is drawn on the clicked position.
- When the user clicks and drags the mouse on the canvas, shapes are drawn along the dragged direction.
- Three buttons to choose between circle, square and triangle.
- A slider to determine the number of segments used to create a circle.
- A button to clear the canvas.
- A slider to set the shape size.
- Three sliders to control the shades of red, green and blue of the shape color.
Resources
Reading: Matsuda/Lea Ch03 (67-91).
Base Code: ASG2.zip
Rubric
Please include a title
Keep in mind that 15 students have already been assessed using this rubric. Changing it will affect their evaluations.
Criteria | Ratings | Pts |
---|---|---|
Have buttons/sliders for clear, size and color as per Assignment 1.
threshold:
pts
|
pts
--
|
|
Have three HTML buttons to choose between circle, square and triangle.
threshold:
pts
|
pts
--
|
|
Have a slider to determine the number of segments used to create a circle.
threshold:
pts
|
pts
--
|
|
Implement SendAttributeBuffertoGLSL() function.
Sends data to an attribute variable using a buffer.
threshold:
pts
|
pts
--
|
|
Implement TellGLSLToDrawCurrentBuffer() function.
Draws the current buffer loaded. Buffer was loaded by sendAttributeBufferToGLSL.
threshold:
pts
|
pts
--
|
|
Implement Scene, Vertex and Geometry classes.
The Scene object's role is to manage the presence of geometry onscreen. The Geometry object's role is to represent a geometric object onscreen.
threshold:
pts
|
pts
--
|
|
Implement Circle class extending Geometry.
threshold:
pts
|
pts
--
|
|
Implement Triangle class extending Geometry.
threshold:
pts
|
pts
--
|
|
Implement Square class extending Geometry.
threshold:
pts
|
pts
--
|
|
Draw a shape on canvas each time the mouse is clicked or is held down.
threshold:
pts
|
pts
--
|