Diagonal line loop

Hello @Humano,

This is with Processing 4.4.4 on W10.

Sample code to try:

import processing.javafx.*;

void setup() 
  {
  // Use only one of these:
  size(300, 300, P2D);  
  //size(300, 300, JAVA2D);
  //size(300, 300);          //This is same as JAVA2D and is the default!
  //size(300, 300, FX2D);
  
  // Use only one of these:
  //noSmooth();              // Try with and without this!
  //smooth(2);              // This is the default. See reference!
  smooth(3);                 //  This gives a nice smooth line on my end!
  }

void draw() 
  {
  background(255);  // Always have background in draw!
  strokeWeight(5);
  for (int i=0; i<1000; i=i+20) 
    {
    
    line(i,0,
       i+100,1000);
    }
  }

Make sure and comment out what is not used!
Use smooth() or noSmooth() but not both!

Try the different renderers! P2D, JAVA2D and FX2D

References:

With noSmooth() :

With smooth(3) :

1 Like