@@ -0,0 +1,1607 @@
+package com.haxademic.sketch.visualgorithms;%0A%0Aimport com.haxademic.core.app.PAppletHax;%0Aimport com.haxademic.core.constants.AppSettings;%0Aimport com.haxademic.core.draw.context.DrawUtil;%0Aimport com.haxademic.core.draw.filters.shaders.BlurHFilter;%0Aimport com.haxademic.core.draw.filters.shaders.BlurVFilter;%0Aimport com.haxademic.core.draw.filters.shaders.SharpenFilter;%0A%0Apublic class ReactionDiffusion%0Aextends PAppletHax %7B%0A%09public static void main(String args%5B%5D) %7B PAppletHax.main(Thread.currentThread().getStackTrace()%5B1%5D.getClassName()); %7D%0A%0A%09protected int RD_ITERATIONS = 4;%0A%0A%09protected void overridePropsFile() %7B%0A%09%09p.appConfig.setProperty( AppSettings.WIDTH, 640 );%0A%09%09p.appConfig.setProperty( AppSettings.HEIGHT, 640 );%0A%09%7D%0A%0A%09public void drawSeed(int color) %7B%0A%09%09// seed%0A%09%09DrawUtil.setDrawCenter(p);%0A%09%09p.fill(color);%0A%09%09p.noStroke();%0A%09%09p.ellipse(p.width/2, p.height/2, 150, 150);%0A%09%09%0A%09%09// outer ring%0A%09%09p.noFill();%0A%09%09p.stroke(color);%0A%09%09p.strokeWeight(100);%0A%09%09p.ellipse(p.width/2, p.height/2, 450, 450);%0A%09%7D%0A%09%0A%09public void keyPressed() %7B%0A%09%09super.keyPressed();%0A%09%09if(p.key == ' ') drawSeed(255);%0A%09%09if(p.key == 'a') drawSeed(0);%0A%09%09if(p.key == 's') %7B p.background(0); drawSeed(255); %7D%0A%09%7D%0A%0A%09public void drawApp() %7B%0A%09%09if(p.frameCount == 1) p.background(0);%0A%09%09if(p.frameCount %3C= 20) %7B%0A%09%09%09drawSeed(255);%0A%09%09%7D%0A%09%09%0A%09%09// effect%0A%09%09for (int i = 0; i %3C RD_ITERATIONS; i++) %7B%09%09%09%0A%09%09%09BlurHFilter.instance(p).setBlurByPercent(0.5f, p.width);%0A%09%09%09BlurHFilter.instance(p).applyTo(p);%0A%09%09%09BlurVFilter.instance(p).setBlurByPercent(0.5f, p.height);%0A%09%09%09BlurVFilter.instance(p).applyTo(p);%0A%09%09%09SharpenFilter.instance(p).applyTo(p);%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A%0A

Add Reaction-Diffusion demo