[SOLVED] CS2261 Lab1-Drawing Triangles

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab01-vbh2kr.zip (8 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (1 vote)

In this lab, you will be completing TODOs to finish writing two functions:

  • void setPixel(int row,int col,unsigned short color)
    • Fills the pixel at the specified row and column with the specified color
  • void drawTriangle(int row,int col)
    • Draws a triangle at the specified row and column

○   May be any color, either filled in or not (your choice)

○    May NOT be hardcoded. You may not just call setPixel for every colored-in dot on your triangle. You must use iteration to do so.

After writing the two functions, call the ​drawTriangle​ function at least three times in your main function, with different parameters. The output of your program should look something like this(next page):

Your triangles may be any size, shape, color, rotation, or position you want, as long as we can see that you drew three of them. If you want, you can add parameters to the function to control color, size, or shape. After you have completed all the TODOs and your output looks correct, you are finished with the lab after you submit it.

 

Tips

  • If your code is not compiling, make sure that your Makefile has ​c​ as

SOURCES

  • For-loops are really great for drawing lines.
  • The GBA screen size is 240 pixels wide and 160 pixels tall
  • If you add parameters to your ​drawTriangle​ function, you must change its prototype

 

  • Lab01-vbh2kr.zip