“chromatica” by Chris Randall
https://openprocessing.org/sketch/1462149
License CreativeCommons Attribution ShareAlike
https://creativecommons.org/licenses/by-sa/3.0
{{filePath}}
{{width}} x {{height}}
Report Sketch
Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Forks of this sketch will become the forks of "Chromatic Blur Template (alpha blur)".
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
A fork of Chromatic Blur Template (alpha blur) by ippsketch
CC Attribution ShareAlike
chromatica
Randall
xxxxxxxxxx
let cnt, sqr, pX, x, y, h, step;
var speed, stepSize, distance, length, trails, pointSize;
var colorsCS = ['#FF0000', '#00FF00', '#0000FF'];
function getNum(value){
num = Math.floor(value * 9) + 1;
return num;
}
function getSpeed(value){
if (value < 0.1) speed = 20;
else if (value < 0.5) speed = 40;
else if (value < 0.7) speed = 60;
else if (value < 0.9) speed = 80;
else speed = 100;
return speed;
}
function getDistance(value){
if (value < 0.1) distance = 10;
else if (value < 0.5) distance = 40;
else if (value < 0.7) distance = 80;
else if (value < 0.9) distance = 100;
else distance = 120;
}
function getStepSize(value){
stepSize = Math.floor(value * 7) + 2;
return stepSize;
}
function getLength(value){
length = Math.floor(value * 15) + 5;
return length;
}
function getTrails(value){
if (value < 0.1) trails = 3;
else if (value < 0.5) trails = 8;
else if (value < 0.7) trails = 25;
else if (value < 0.9) trails = 50;
else trails = 255;
return trails;
}
function getPointSize(value){
if (value < 0.1) pointSize = 0.25;
else if (value < 0.5) pointSize = 0.5;
else if (value < 0.9) pointSize = 0.75;
else pointSize = 1;
return pointSize;
}
function setup() {
windowResized();
}
function windowResized() {
sqr = Math.min(windowWidth, windowHeight);
createCanvas(sqr, sqr);
ellipseMode(CENTER);
rectMode(CENTER);
getSpeed(random());
getDistance(random());
getStepSize(random());
getLength(random());
getTrails(random());
getPointSize(random());
pX = sqr * 0.01;
cnt = 0;
h = sqr / 2;
step = stepSize * pX;
noFill();
background(0);
}
function draw() {
blendMode(BLEND);
background(0,trails);
blendMode(ADD);
let sz = sqr * 0.9;
for (let c=0; c<3; c++)
{
var tc = cnt - (c * 2); // for chromatic aberration, offset time for each color
colorc = color(colorsCS[c]);
stroke(colorc);
for (let y = pX * 25; y < pX * 75; y += step){
beginShape(POINTS);
for (let x = pX * 10; x < sz; x += step){
var dist = sqrt(x * x + y * y);
var z = cos(dist / distance - (tc/speed)) * (pX * length);
//push();
strokeWeight(pX * pointSize);
vertex(x,y + z);
//point(0,0);
//pop();
}
endShape();
}
}
cnt++;
}
See More Shortcuts
Please verify your email to comment
Verify Email