Created
January 9, 2014 13:54
-
-
Save pixelpusher/8334424 to your computer and use it in GitHub Desktop.
Draw a triangle in Processing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size( 640, 480 ); | |
background( 19, 18, 64 ); // R,G,B | |
stroke( 255, 0, 255 ); // purple stroke | |
int startX = 10; | |
int startY = 20; | |
int triWidth = 120; | |
int triHeight = 26; | |
triangle( startX, startY, | |
startX + triWidth/2, startY + triHeight, | |
startX + triWidth, startY); | |
startX = startX + triWidth; | |
triangle( startX, startY, | |
startX + triWidth/2, startY + triHeight, | |
startX + triWidth, startY); | |
startX = startX + triWidth; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment