Thanks for the tip on using geomerative, it's very handy. I've alreayd managed to create this, which uses the polygoniser feature:
http://is.gd/dpfDk. I've modified some of the example code and foudn a way to load the points and then randomise their placement, but I'm still having a fwe problems. See the code below
- import processing.opengl.*;
import processing.xml.*;
import geomerative.*;
RShape shp;
RShape polyshp;
void setup(){
size(600, 600, P3D);
colorMode(RGB, 255);
frameRate(24);
// VERY IMPORTANT: Allways initialize the library before using it
RG.init(this);
shp = RG.loadShape("penguin.svg");
}
void draw(){
background(146,255,75);
polyshp = RG.polygonize(shp);
// We draw the polygonized group with the SVG styles
RG.shape(polyshp);
RPoint[] pnts = shp.getPoints();
for ( int i = 1; i < pnts.length; i++ )
{
line( pnts[i-1].x*random(2), pnts[i-1].y*random(2), pnts[i].x*random(2), pnts[i].y*random(2) );
}
}
The problem I'm having is that this method just redraws the shape. Is there anyway to actually modify the node handles in the shape itself?