Question
WebGL Paint Program Allow the user to select if they want filled or outline. Allow the user to change the color (Hint: look up HTML
WebGL Paint Program Allow the user to select if they want filled or outline.
Allow the user to change the color (Hint: look up HTML form color input)
You will have buttons (Preferably toggle inputs) to allow the user to draw a rectangle, an n-point polygon, a line, circle and a triangle.
You will allow the user to draw a rectangle with the same method that he employs, however, you will draw a temporary rectangle showing the user where the first point was clicked and where the mouse cursor is.
For the N-point polygon you will draw the current polygon until the user has finished.
For the line you will simply select a point and then another point. (Again draw a temporary line to show the user where the line would currently be)
For the circle, select the center of thecircle selecta second point to specify the radius (Again creating a temporary circle to show the user where it would be).
If the circle is filled, you can use triangle fan to fill it.
However, you will only want to use triangle fan on circle.
For the triangle, the user will select three points to draw the triangle. (A temporary triangle will be drawn while the user is selecting the 3rd point).
At anytime the user can cancel drawing an object by clicking the right button.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started