🔍

BASIX_Session_one

simple graffiti drawer


// This function runs once when the program starts
void setup() {
  // Set the size of the window to 600x600 pixels
  size(600, 600);
  
  // Set the background color to white
  background(255);
  
  // Disable drawing outlines around shapes
  noStroke();
}

// This function continuously executes the lines of code contained inside its block
void draw() {
  // Check if the mouse button is pressed
  if (mousePressed == true) {
    
    // Set the fill color to a random shade of gray (0-80)
    fill(random(80));
    
    // Use a for loop to draw 30 circles each frame
    for (int i = 0; i < 30; i++) {
      
      // Draw a circle at a random position around the mouse pointer
      // mouseX and mouseY give the current position of the mouse
      // random(-30, 30) adds some randomness to the position
      // The circle's diameter is between 2 and 10 pixels
      circle(
        mouseX + random(-30, 30), 
        mouseY + random(-30, 30), 
        2 + random(8)
      );
    }
  }
}


PUSTEBLUME



int point_count = 20;

// define an EMPTY array of 130 PVector points
PVector[] points = new PVector[point_count];

void setup() {

  size( 600, 600 );
  background(255);
  createPoints();
  drawLines();

}

void drawLines(){

  stroke(0,22);
  for (int i=0; i<point_count; i++ ) {
     for (int j=0; j<point_count; j++ ) {
        line(points[j].x , points[j].y, points[i].x , points[i].y  );
     }    
  }
}



void createPoints() {
  
  fill(0);
  noStroke();

 
  for (int i=0; i<point_count; i++ ) {
   
    float rx = random(400)+100;
    float ry = random(400)+100;
    
    circle( rx, ry, 12 );
    
    points[i] = new PVector(rx,ry);
   
    println("das ist i:" + i + " + der PVector ist: " + points[i]);
    

  }
}


the moving wobbly dotNet



int point_count = 10;

// define an EMPTY array of 130 PVector points
PVector[] points = new PVector[point_count];

void setup() {
 
  size( 600, 600 );
  background(255);
  createPoints();
  drawLines();

}




void draw(){

  fill(255,10);
  rect(0,0,width,height);
  
 // background(255);
  updatePoints();
  drawLines();
  

}


void updatePoints(){

  for (int i=0; i<point_count; i++ ) {
   
    points[i].x += sin(millis()*.004+points[i].y)*4;
 
  }

}



void drawLines(){

   // colortone, alpha transparency
  stroke(0, 60);
  strokeWeight(1);
  for (int i=0; i<point_count; i++ ) {
     for (int j=0; j<point_count; j++ ) {
        line(points[j].x , points[j].y, points[i].x , points[i].y  );
     }    
  }
}



void createPoints() {
  
  fill(0);
  noStroke();

 
  for (int i=0; i<point_count; i++ ) {
   
    float rx = random(400)+100;
    float ry = random(400)+100;
    
    circle( rx, ry, 8 );
    
    points[i] = new PVector(rx,ry);
   
    println("das ist i:" + i + " + der PVector ist: " + points[i]);
    

  }
}