{"id":2,"date":"2011-02-01T21:45:58","date_gmt":"2011-02-01T21:45:58","guid":{"rendered":"http:\/\/classes.visitsteve.com\/hacking\/?page_id=2"},"modified":"2011-09-20T19:25:10","modified_gmt":"2011-09-20T19:25:10","slug":"about","status":"publish","type":"page","link":"https:\/\/classes.visitsteve.com\/hacking\/about\/","title":{"rendered":"About"},"content":{"rendered":"<p>You know what this is.<\/p>\n<p><script type=\"text\/javascript\">\/\/ <![CDATA[\n\/\/Info: http:\/\/processingjs.org\/reference\nPFont font;\nPGraphics g;\n\nint N = 100;\n\nArrayList particles = new ArrayList();\/\/directs particles\n\nvoid setup(){\n  size(900,400, P2D);\n  colorMode(255);\n  background(0);\n\n  g = createGraphics(900,400,P2D);\n  g.colorMode(255);\n\n  font = createFont(\"Osaka\", 102, true);\n  textFont(font,102);\n\n  createTextPalette();\n  createParticle();\n}\n\nvoid draw(){\n  background(0);\n\n  for(int i=0; i\n<particles.size(); i++){\n    Particle p = (Particle)particles.get(i);\n    p.draw();\n    p.update();\n  }\/\/particle sie and distribution?\n}\n\nvoid createTextPalette(){\n  g.beginDraw();\n  g.textFont(font,92);\n  g.textAlign(CENTER,CENTER);\n  g.translate(width\/2, height\/2);\n  g.fill(255);\n  g.text(\"INTRO TO HACKING\", 0, 0);\n  g.endDraw();\n}\n\/\/ all things related to the text\n\nvoid createParticle(){\n  loadPixels();\n  g.loadPixels();\n\n  for(int i=0; i<width*height; i++){\n    if(brightness(g.pixels[i]) > 150)\n    {\n      if(random(100) < N)\n      particles.add(new Particle(i%width, int(i\/width), random(3)));\nfloat mincol = 0; \nfloat maxcol = 255; \n    }\/\/randomness of the particle distribution and attachment to text\n  }\n\n  updatePixels();\n}\n\nclass Particle{\n  float x;\n  float y;\n  float s;\n\n  float nx = random(width*2) - width*1;\n  float ny = random(height*2) - height*1;\n\n  color c = color(255,255,255,255);\n\n  Particle(float _x, float _y, float _s){\n    x = _x;\n    y = _y;\n    s = _s;\n\n    nx += sgn(nx-width\/2)*width\/2;\n    ny +=  sgn(ny-height\/2)*height\/2;\n  }\n\n  void update(){\n    float dx = random(sgn(x-nx)) + random(2) - 1;\n    float dy  = random(sgn(y-ny)) + random(2) - 1;\n\n    nx += dx;\n    ny += dy;\n  }\n\n  void  draw(){\n    noStroke();\n    fill(255);\n    ellipse(nx,ny,s,s);\n  }\n}\n\nint sgn(float n){\n  if(n==0) return 0;\n  else return int(abs(n)\/n);\n}\n\n\/\/ ]]><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You know what this is.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-2","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/pages\/2","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/comments?post=2"}],"version-history":[{"count":0,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/pages\/2\/revisions"}],"wp:attachment":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/media?parent=2"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}