Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and processing.py

Thursday, 19 March 2009

Casey Reas presents Processing.js experiments

In an article misleadingly entitled...
"Browser Coders Make Chrome Shine" at Technology Review dot com
Casey Reas presents some mini-browser applications. Problem I see is the requirement of canvas a html5 feature that Microsoft probably wont support?
Big plus is the code is there for the user to read cf java applets or flash (and then get inspired to improve etc).
You could skip the article and just got to the demo(NB: best using chrome browser).

Sunday, 8 March 2009

Simple Image Warping

Here is something I tried in processing earlier a bit of image warping, reminds me a bit of Uri Gellers spoon bending!!!
(guts of code stolen from processing discourse board attributed to dpgc)
Code Revised 11 March now that I'm using image as background image size must match frame size:-
   1:PImage source, destination;
2:
3:void setup()
4:{
5: size(220,300);
6: source = loadImage("warping.jpg"); // fill in your own image here
7: frameRate(3);
8:}
9:
10:void draw()
11:{
12: if (frameCount < 10)
13: {
14: background(source) ;
15: }
16: if (frameCount > 200)
17: {
18: exit();
19: }
20: else{
21: destination = warp(source, frameCount);
22: background(destination);
23: }
24:}
25:
26:// implement a simple vertical wave warp.
27:PImage warp(PImage source, int count)
28:{
29: float waveAmplitude = count/5, // pixels
30: numWaves = count % 5; // how many full wave cycles to run down the image
31: int w = source.width, h = source.height;
32: PImage destination = new PImage(w,h);
33: source.loadPixels();
34: destination.loadPixels();
35:
36: float yToPhase = 2*PI*numWaves / h; // conversion factor from y values to radians.
37:
38: for(int x = 0; x < w; x++)
39: for(int y = 0; y < h; y++)
40: {
41: int newX, newY;
42: newX = int(x + waveAmplitude*sin(y * yToPhase));
43: newY = y;
44: color c;
45: if(newX >= w || newX < 0 ||
46: newY >= h || newY < 0)
47: c = color(0,0,0);
48: else
49: c = source.pixels[newY*w + newX];
50: destination.pixels[y*w+x] = c;
51: }
52: return destination;
53:}

Monday, 2 March 2009

Book chunk URL as openid

Its a bit late now but, there is a more efficient way to link your interest in someones book chunk blog. If you use the url of your book chunk blog (as your openid) to 'follow' a fellow contributors, you will immediately identify (if your chunk is related that is) why you are following their chunk....

Sunday, 1 March 2009

Path Following

Just checked out this neat tutorial, just what you need if you want create some path following behavior. I will have to try and do something like this with one of my saucer animations.

Followers

Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2