Screen Shot 2019-03-20 at 3.42.09 PM.png

Processing

Array.gif
PImage[] myArray = new PImage[9]; //create empty array, 9 slots
int i;
void setup(){
imageMode(CENTER);
myArray[0] = loadImage("1e.png"); //Arrays always start with slot 0
myArray[1] = loadImage("2e.png");
myArray[2] = loadImage("3e.png");
myArray[3] = loadImage("4e.png");
myArray[4] = loadImage("5e.png");
myArray[5] = loadImage("6e.png");
myArray[6] = loadImage("7e.png");
myArray[7] = loadImage("8e.png")
myArray[8] = loadImage("9e.png");
size(400,400);
fill(0);
textSize(24);
frameRate(10);
}
void draw(){
background (220);
//i++; 
//println(myArray[9]); //print content of slot 9
//printArray(myArray); //print the entire array
//println(myArray.length); //print the length of the arrays
//text(myArray[1], 20,30);
//text(myArray[2], 40,30);
//text(myArray[3], 60,30);
//text(myArray[4], 80,30);
//text(myArray[5], 100,30);
i = int(map(mouseX,0,400,0,9)); //getting the result of map, and 'forcing'
println(i);
//text(myArray[i], 200,200);
image(myArray[i], 200,200, 400, 400);
}
 
2019-03-20 14.45.43.gif
int x;
Boxes mybox;
ArrayList<Boxes> myArrayofBoxes;
void setup(){
   size(1000,1000, P3D);
   myArrayofBoxes = new ArrayList <Boxes>(); myArrayofBoxes.add(newBoxes(250,250,100);
}
void draw(){
background(255,255,153);
   for(int i=0; i<myArrayofBoxes.size(); i++){
      Boxes myfirstBox = myArrayofBoxes.get(i); //get data from the index and create an object
  myfirstBox.display(mouseX, mouseY); //do something with the object
  myfirstBox.pulse();
  println(myArrayofBoxes.size());
}}
void keyPressed(){  myArrayofBoxes.add(new Boxes(mouseX, mouseY, 100));
}
class Boxes{
   //class variables
   float x, y, size;
   int R, G, B;
   float speedX, speedY;
   float distance;
  //constructor
  Boxes (float initX, float initY, float initsize){
    x = initX;
    y = initY;
    size = initsize;
  }
    //functions
  void pulse(){
   size++;
    if(size>200)
    {size=5;
}}
  void display(float mX, float mY){ 
    distance = dist(mX,mY, x, y); //check the distance beteen mouse and x,y aka center of box
   if(distance<size/2){ //when mouse hover over the box
       fill(random(255), random(255), random(255));
   } else{fill(0,45,255);}
    pushMatrix();
    translate(x,y);
    rotateY(radians(mX));
    box(size);
    popMatrix();
  }
}
 
2019-03-20 14.48.43.gif
void setup () {
  size(800, 500);
  noFill();
  stroke(255);
  ellipseMode(CENTER);
}
float inc;
void draw () {
  background(0);
  translate(width/2, height/2);
  myBranch(100);
}
void myBranch(float h) {
  h = h * 2/3;
  if (h>2) {
    pushMatrix();
    rotate (45);
    line(0, 0, 0, -h);
    translate (0, -h);
    ellipse(0,0,20,20);
    myBranch(h);
    popMatrix();  
  pushMatrix();
    rotate (inc);
    inc = inc + 0.0001;
    line(0, 0, 0, -h);
    translate (0, -h);
        ellipse(0,0,20,20);
    myBranch(h);
    popMatrix();
}}
 
2019-03-20 15.33.52.gif
import peasy.*;
PeasyCam cam; //outside setup to see 3D better
float x;
float y;
float z;
//int increment;
import nervoussystem.obj.*;
boolean record;
void setup (){
 size(700,700, P3D);
//in setup to see 3D better
  cam = new PeasyCam(this, 100);
  cam.setMinimumDistance(50);
  cam.setMaximumDistance(1000);
}
void draw (){
   background(0);   
   lights();
   directionalLight(255,0,0,0,0,-1);
   stroke(255);
   //camera(mouseX, mouseY, 120.0, 50.0, 50.0, 0.0, 0.0, 1.0, 0.0);
// sphereDetail(increment); //the amount of vertices
// increment++;
// if(increment>30) {increment = 0;} 
 if (record) {
    beginRecord("nervoussystem.obj.OBJExport", "filename.obj");
  }
   for(float x=1; x<400; x=x+80){
   for(float y=1; y<400; y=y+80){
   for(float z=1; z<400; z=z+80){        
  pushMatrix();
    translate(x,0,0);//brings the sphere to the center
    translate (0,y,0);
    translate (0,0,z);
      //ellipse (50,50,40,40);
      sphere(30); //30 is the radius
  popMatrix();
}
 if (record) {
    endRecord();
    record = false;
  }}}}  
void keyPressed()
{
  if (key == 'r') {
    record = true;
}}
2019-03-20 15.44.21.gif
2019-03-20 15.56.06.gif
2019-03-20 15.48.03.gif
2019-03-20 15.54.33.gif
2019-03-20 15.51.24.gif