xxxxxxxxxx
38
const cwidth = 2000;
const cheight = 1500;
const model = {
scale: 0.0035, //curl noisefield settings
force: 1.5, //curl noisefield settings
size: 1, //curl noisefield settings
linelength: 7, //in pixels
maxiterations: 100,
colorrandom: 40, //randomness in rgb value, 2^8bit
backgroundbrightness:150,//2^8 bit
linealpha: 220, //2^8 bit
linewidth: 6, //in pixels
pointcount: 150000, //max poisson point count, points that are out of the image will be skipped
pointr: 6.1 //poisson disc sample distance
};
let lines;
let poisson;
let img;
function preload() {
img = loadImage('assets/cherry_tree.jpg');
}
function setup() {
createCanvas(cwidth, cheight);
//image(img, 0, 0);
background(model.backgroundbrightness);
strokeWeight(model.linewidth);
noFill();
img.loadPixels();
poisson = new PoissonDiscSampler();
lines = new LineMom(poisson.ordered);
lines.render();
}