Blog: Comp Media

ITPG-GT 2233-002

Tutor: Luisa

WEEK 4

Make something with a lot of repetition, more than you want to hand-code. Try creating an algorithmic design with simple parameters. 

Part I: 

An unstable state pattern forming something which looks satisfying.

Work title: Earth & Sun

 

Preview picture:

week4.jpg

Work link - 

https://www.openprocessing.org/sketch/972424

So, basically I intended to make a small solar system where the earth travels around the sun. I didn't use the 3D effect or ellipse to give a 'planet' effect; in the contrary I made the planets with a lot of ever-changing, unstable lines. (Which, I think is what has formed most planets: unstable particles) A mouse also controls the explosion radius of the planets.

I really like to depict what is happening in the universe; a "for" loop would be essential because there are so many things happening in space. In an aesthetic perspective, loops and repeating has a power, in terms of creating an artistic looking. No matter if it's an installation or visual piece, there's a lot to be discovered and experimented with creative coding.

P5 code:

var colors=["#EB5160","#B7999C","#AAAAAA","#DFE0E2"]
var earth=["#69FFF1","#D0F4EA","#63A46C","#1D3557","#233329"]
var len
var gogo
var gogoX
var spd
function setup() {
    createCanvas(1600, windowHeight)
    background("#071013")
}

function draw() {    
    gogo = 0
    gogoX = 1600
    background(7,16,19,20)
    let ora = color(217,122,37)
  let pla = random(width)
  let ola = random(height)
  noStroke()
  fill(255,200,200)
  ellipse(pla,ola,1)
    push()
        spd=frameCount*10
      gogo+=spd
        translate(gogo,height/2)
      if (gogo>2000){
            frameCount=-200        
        }
        var len2 = map(mouseX,0,width,20,random(15,50))
        for(var x=0;x<120;x++){
            strokeWeight(0.2)
            stroke(random(earth))
            line(0,0,0,len2)
            rotate(PI/60)    
        }
    pop()
    push()
      translate(width/2,height/2)
      var len = map(mouseX,0,width,50,random(250,600))
      for(var a=-10;a<10;a++){
            for(var i=0;i<120;i++){
                strokeWeight(0.2)
                stroke(random(colors))
                line(a*10,0,0,len)
                rotate(PI/60)
          }
        }
  pop()
    push()
        spd=frameCount*10
      gogoX-=spd+2000
        translate(gogoX,height/2)
        var len3 = map(mouseX,0,width,20,random(15,50))
        for(var y=0;y<120;y++){
            strokeWeight(0.2)
            stroke(random(earth))
            line(0,0,0,len3)
            rotate(PI/60)    
        }
    pop()
}