Processing.js – Processing to the Canvas

As I may have mentioned, I have been playing around with my Arduino microcontroller, these days, which has exposed me to this fun Java framework called Processing. It’s got a simple syntax that is great for teaching people the basics of programming, yet it’s powerful enough to build some really cool stuff.

Anyway, John Resig has made a project out of porting the core processing language to Javascript, and leveraging the canvas tag for graphic rendering.

If that’s not nice enough, the prolific Robert O’Rourke has made a slick in browser IDE for processing.js. It’s a great way to learn and share code.

Go forth, load up the processing.js reference guide, fire up HasCanvas and play. While you’re at it, check out my channel :)

One Response to 'Processing.js – Processing to the Canvas'

  1. lckdscl says:

    Hey man, this is going to sound weird but I stumbled on your color composite problem on yayhooray and I thought I’d let you know that I think you should probably separate the RGB values before you do any calculations. As it is now one color can contaminate the others when you do the multiplication which doesn’t necessarily give an integer. (that’s why you get something blueish at the moment)

    for example for a red color you wouldn’t get:
    0xff0000 / 2 = 0×800000 (or 0×7f0000)

    but instead:

    0xff0000 / 2 = 0×7fxxxx (where x is nonzero)

    Hope it helps, cheers.

Leave a Reply

Your email address will not be published. Required fields are marked *

*