Hello i need help with my homework (cross with line hatching)

please format code with </> button * homework policy * asking questions

i need to draw this figure, the instructors are: do a line hatching with a 5 pixel interval in between each line
thank you very much

1 Like

Hello,
What have you tried so far?

3 Likes

please look carefully at the image and describe us what you see:

where do the lines start, where do they go, how do the change? How many groups of lines are there?

What commands would you use?

1 Like

i got no idea, i dont know if the lines start at the centre or at each point of the cross, ive been told to use loops i think but i know nothing about processing i dont know how im meant to do this.

nothing, ive done other exercises like this but because i found help on google and youtube but i barely know anything

i think lines go from every apex to every other apex and there are 4 groups?

1 Like

The last answer is the best (not fully correct maybe but best)

Now let’s look at the leftmost point.

What are the lines doing from there (you said 4 groups so let’s talk only about one group for now)?

Next

Ok, please write a program with setup and draw

Now write a line Command

Now put it into a for loop

How can you use the values of the for loop for the line command?

the upper apex has lines that go to the lower one but each line gets closer to the right and left apexs right?

1 Like

i dont know what a for loop is, i will search it later,since im at class now thanyou

Check this out : reference for the for loop

See Reference / Processing.org

Almost

I think it’s almost like this, especially the 2nd half is good

I think this picture should help you work out how to draw it…

To make this, I started with a red line, then the orange lines, then yellow, and so on…

1 Like