Write a Java program using only NetBeans 8.2 IDE which uses the LWJGL library to draw a window of 640×480 in the center of the screen.
Your program should then read in coordinates from a file titled coordinates.txt and draw the primitives in the same window using the algorithms for each primitive.
The program should draw the primitives in different colors (red for lines, blue for circles and green for ellipses) on a black background.
Use the glVertex2f() command to plot the primitives pixel by pixel. Finally, your program should also use the input.Keyboard class to have the escape key quit your application.
If you are motivated enough, you may also add extra functional keys that would allow the user to change the colors of the primitives. These added functions should be clearly stated in your comments.
The given coordinates.txt file will be in the following format:
l -15,-15 150,180
c 100,150 80
e 225,370 35,75
l -100,100 50,75
e 200,-100 50,50
“l” stands for a line and is followed by a space, this is then followed by the two endpoints of the line separated by a space.
“c” stands for a circle followed by a space, the center of the circle, space and then the radius of the circle.
“e” stands for ellipse followed by a space, center of the ellipse, space again followed by value of rx and ry(separated by a comma).
When your program is evaluated, a different coordinates.txt file will be used by me so be sure your algorithm tests all cases for each of the three primitives.
Note: Please do not turn in anything that does not use Java with our LWJGL library. Your programs should be hand-coded. Hence, dont use pre-existing code from other texts or from the internet.
What to turn in:
– Soft copy of the program
The output should look like the picture posted when the program is finished.
The program should change the sizes/positions of the shapes if the text file is changed.