How to create a diagonal line

One way of tackling this problem is to use rotate, as in the transformations tutorial and example solution above.

Another way is to use line() (possibly with strokeWeight()) rather than rect().

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

1 Like