Is there a way to paint a filled triangle?

I would like to know

1 Like

hi

read this
https://processing.org/reference/fill_.html

https://forum.processing.org/two/discussion/2866/simple-paint-program

Thanks jafal,
I’m familiar with the function fill().

My question was specific about triangle.
I know I can draw an ellipse or rectange, but I want to draw filled triangle

You can create your own shapes:

https://processing.org/reference/beginShape_.html

:)

see this move your mouse

void setup () {
size (600,600);
colorMode(HSB);
}
void draw(){
for(int i= 500; i >0; i=i -2) {
  fill((i/5) + (mouseX/3), 225,255);
//rect(i,1,i,height);
triangle(30, 75, 58, 20, 86, 75);
}
}

edit

https://processing.org/reference/triangle_.html

2 Likes

Hello @yalaniv,

A good place to start looking is here:

Click here for resources

I encourage you to look at the resources available here:

Beginner

Advanced

The references have all the shapes with examples.

:)

triangle() is the things I’ve been looking for but didn’t know it exist :slight_smile:

Thanks