During the course, the graphical functions of the language are displayed only for the graphical functions of the language
point () function and color adjustment functions can be used.
• Our applications should have the following structure:
setup {}
draw {}
own-section drawing {}
other, their functions {}
mousepressed {}
keyPressed {}
• Store and load the model points using the Table object and loadTable () function.
About the tasks to be done
-
The Section Drawing Function (Incremental Algorithm or Midpoint Algorithm)
• waiting for 2 point coordinates as input parameter
• Draws the same section on the dotted point coordinates
• Draws a point with a single point on the same point -
Rectangle Cutting Function (Cohen-Sutherland Algorithm)
• expects 4 point coordinates as input parameters, the first two of which are a section
the second two give the opposite vertices of a rectangle, the rectangle of the cutter. THE
function to produce the endpoints of the section resulting from the cut
• Cut to point-to-point coordinates - for both section and cutting rectangle
the same result -
Konvex polygon filling function (Scan-line algorithm)
• Scanning a graphic window fills a drawn closed convex broken line with the line color -
Create an application in Processing, which can be any number by calling function 1
draws a section in such a way that the endpoints that define the section can be given by mouse click!
• The graphics window should be 640x480 -
Based on the application of Task 4, create a program in Processing language of any size
- but not larger than the quarter screen - cut rectangle using the cursor keys
makes it mobile! The endpoints that define the sections can be added by mouse click
it! The sections you specify during the run are displayed according to the current position of the cut!
• The graphics window should be 640x480
• Do not show the cutting rectangle