{"id":42,"date":"2011-02-15T21:18:59","date_gmt":"2011-02-15T21:18:59","guid":{"rendered":"http:\/\/classes.visitsteve.com\/hacking\/?p=42"},"modified":"2011-02-15T21:27:02","modified_gmt":"2011-02-15T21:27:02","slug":"loops","status":"publish","type":"post","link":"https:\/\/classes.visitsteve.com\/hacking\/loops\/","title":{"rendered":"loops"},"content":{"rendered":"<p>I have been thinking about doing Bridget Riley-ish optical art with processing started with a line loop<\/p>\n<p><script type=\"application\/processing\">\r\n\/\/Info: http:\/\/processingjs.org\/reference\r\nint y = 0;\r\nint x = 0;\r\n\r\nvoid setup() {\r\n  size(200,200);\r\n  background(255);\r\n  frameRate(100); \r\n}\r\n\r\nvoid draw() {\r\n  \/\/ Draw a line\r\n  strokeWeight(5);\r\n  stroke(0);\r\n  \/\/ draw line\r\n  line(0,y,width,y); \r\n  \/\/ Increment y\r\n  y += 10;\r\n  strokeWeight(5);\r\n  stroke(255);\r\n  \/\/ Only one line is drawn each time through draw().\r\n  line(x,0,x,height); \r\n  \/\/ Increment x\r\n  x += 10;\r\n  \/\/ Reset x back to 0 when it gets to the side of window\r\n  if (y > height) {\r\n    y = 0;\r\n  }\r\n  if (x > width) {\r\n    x = 0;\r\n  }\r\n}\r\n\r\n<\/script><\/p>\n<p><code>int y = 0;<br \/>\nint x = 0;<\/p>\n<p>void setup() {<br \/>\n  size(1000,1000);<br \/>\n  background(255);<br \/>\n  frameRate(100);<br \/>\n}<\/p>\n<p>void draw() {<br \/>\n  \/\/ Draw a line<br \/>\n  strokeWeight(5);<br \/>\n  stroke(0);<br \/>\n  \/\/ draw line<br \/>\n  line(0,y,width,y);<br \/>\n  \/\/ Increment y<br \/>\n  y += 10;<br \/>\n  strokeWeight(5);<br \/>\n  stroke(255);<br \/>\n  \/\/ Only one line is drawn each time through draw().<br \/>\n  line(x,0,x,height);<br \/>\n  \/\/ Increment x<br \/>\n  x += 10;<br \/>\n  \/\/ Reset x back to 0 when it gets to the side of window<br \/>\n  if (y > height) {<br \/>\n    y = 0;<br \/>\n  }<br \/>\n  if (x > width) {<br \/>\n    x = 0;<br \/>\n  }<br \/>\n}<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been thinking about doing Bridget Riley-ish optical art with processing started with a line loop int y = 0; int x = 0; void setup() { size(1000,1000); background(255); frameRate(100); } void draw() { \/\/ Draw a line strokeWeight(5); &hellip; <a href=\"https:\/\/classes.visitsteve.com\/hacking\/loops\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-classnews"],"_links":{"self":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":0,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"wp:attachment":[{"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/classes.visitsteve.com\/hacking\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}