tag:blogger.com,1999:blog-4253652680999819692024-03-08T19:10:00.232+00:00Rob's Massive WritingMy contribution to the OU Mass Writing project.robspainhttp://www.blogger.com/profile/12737980466654797690noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-425365268099981969.post-1319496655953095782009-01-11T21:45:00.003+00:002009-01-11T22:16:55.766+00:00Lotsa processing, not a lotta bloggingShowing my age by failing to share my life with the world. <br /><br />Just gots to do more blogging about my Processing progress!<br /><br />I finally shipped the ECA for TT282 on cut off date of December 23 and so started spending much more time with Greenberg & the Processing IDE. I start M362 in February, so I had better get on with it! Don't want conflicting loyalties in my life.<br /><br />I asked for my chunk choice tonight and will see if I can get it. <br /><br />Below is some code that plays with color value as described on Greenberg page 402:<br />The apparent brightness of the colored rectangles varies with the background, apparently in an inverse relation to the luminance being allowed through the mid range alpha values.<br /><br />Lower luminance pastels on a visible dark background look "brighter" than higher luminance pastels on a light background. <br /><br />Some voodoo going on here with matrix transforms and rotation too. More than I fully comprehend yet. <br /><br />Processing makes it so easy to experiment with stuff and then reverse engineer why it displays "that way" later. Very enjoyable stuff.<br /><br /><pre><br /><br />/* Spiral pastel rects 03 Jan 2008 */<br /><br />float theta = TWO_PI/30;<br />int x, y, bkg = 255, bkgstep = 64;<br /><br />void setup(){<br /> size(1024,768);<br /> background(255);<br /> frameRate(12);<br /> translate(width/2,height/2);<br /> pushMatrix();<br />}<br /><br />void draw(){<br /> // fade background from light to dark<br /> // clear screen and step each time spiral hits right window edge<br /> if(x > width){<br /> <br /> bkg = abs((bkg - bkgstep)%255);<br /> background(bkg);<br /> // reverse bkg fader at limits<br /> if ((bkg < 32)||(bkg > 224)) bkgstep = -bkgstep;<br /> x = 0;<br /> y = 0;<br /> // change spiral direction<br /> theta = -theta;<br /> }<br /><br /> noStroke();<br /> popMatrix();<br /><br /> // random pastel shade r,g & b = (64-255) with varying alpha (64 - 96)<br /> fill(<br /> 64+random(191), 64+random(191), <br /> 64+random(191), 64+random(32)<br /> ); <br /> // rect specfied with x, y centres and height & width <br /> rectMode(CENTER);<br /> rect(<br /> // x & y creep out and then mod into 0 again<br /> (x+=3)%(width/2),(y+=3)%(height/2),<br /> // rect side sizes are random between 50 - 100 (in steps of 10) <br /> 50+random(5)*10, 50+random(5)*10<br /> );<br /> // rotate with a creeping x & y rect offset = spiral<br /> rotate(theta);<br /> pushMatrix();<br />}<br /> <br /></pre>robspainhttp://www.blogger.com/profile/12737980466654797690noreply@blogger.com0tag:blogger.com,1999:blog-425365268099981969.post-44073623923819144962008-11-02T23:28:00.000+00:002008-11-02T23:45:00.812+00:00Blogged onI have ordered the Processing book and await the delivery. I have downloaded the Processing IDE tonight and will post again once I have messed with it some more. I have not decided which chunk to bid for: I want one that is a stretch for me, but that I can hopefully bring some value to.robspainhttp://www.blogger.com/profile/12737980466654797690noreply@blogger.com0