Nice, good idea about the color change. The tones kinda reminded me of the old Alice in w. cartoon
Hopefully the glowies go for that mood..was gonna give them some motion but I'm out of time..
Sorry but I have no clue about the export. I tried it here and it worked...It throws out more files because it needs a copy of the libraries used in the sketch, that's all I know
import processing.opengl.*;
import javax.media.opengl.*;
PGraphicsOpenGL pgl;
GL gl;
Leaf[] leaves = {
new Leaf(350, 400, 0, 0.5, -20, 200, 200),
new Leaf(350, 400, 0, 0.5, 110, 200, 200),
new Leaf(350, 400, 0, 0.5, 50, 180, 170),
new Leaf(350, 400, 0, 0.5, -30, 180, 170),
new Leaf(350, 400, 0, 0.5, -150, 190, 170),
new Leaf(350, 400, 0, 0.5, 200, 190, 170),
new Leaf(350, 400, 0, 0.5, 120, 200, 200),
new Leaf(350, 400, 0, 0.5, -80, 200, 200),
};
color c = color(250, 250, 250);
int i;
void setup() {
size(700, 700, OPENGL);
colorMode(RGB, 255, 255, 255, 100);
rectMode(CENTER);
imageMode(CENTER);
noCursor();
pgl = (PGraphicsOpenGL)g;
gl = pgl.beginGL();
glowies = new Glowy[0];
int numberOfGlowies = 42;
for (int i = 0; i < numberOfGlowies; i++)
glowies = (Glowy[])append(glowies, new Glowy());
}
Glowy[] glowies;
void draw() {
fill(0, 50);
noStroke();
rect(width/2, height/2, width, height);
stroke(c);
pgl.beginGL();
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);
pgl.endGL();
for (i = 0; i < glowies.length; i++)
glowies[i].display();
pgl.beginGL();
gl.glEnable(GL.GL_DEPTH_TEST);
gl.glDisable(GL.GL_BLEND);
pgl.endGL();
for (i = 0; i < leaves.length; i++)
leaves[i].display();
}
class Glowy {
PGraphics orb;
int orbR; // orb radius
int posX, posY;
Glowy() {
orbR = 80;
orb = createGraphics(orbR, orbR, JAVA2D);
orb.beginDraw();
orb.smooth();
orb.background(255, 0);
orb.colorMode(RGB, 255, 255, 255, 100);
orb.noStroke();
orb.fill(169, 169, 169, 4);
orb.ellipse(orbR/2, orbR/2, orbR, orbR);
orb.fill(15, 100, 200, 70);
orb.ellipse(orbR/2, orbR/2, orbR/6, orbR/6);
orb.endDraw();
posX = (int)random(0, width);
posY = (int)random(0, height-300);
}
void display() {
image(orb, posX, posY, 20, 20);
}
}
class Leaf {
float t;
float x, y, cx, cy, cz, prevX, prevY, z, prevZ;
float cosFactor;
int sz = 200;
float dir;
int w, h;
color colo;
Leaf(float x, float y , float z, float fact, float direction, int w, int h) {
cx = x;
cy = y;
cz = z;
cosFactor = fact;
dir = direction;
this.w = w;
this.h = h;
int imgW = w;
int imgH = h*2;
}
void display() {
pushMatrix();
translate(mouseX - (width/2), mouseY - (height/2));
beginShape();
fill(map(mouseX, 0, width, 0, 255), map(mouseY, 0, height, 0, 255), abs(dir));
for (t = -1; t <= 1; ) {
x = w*sin(t)*cos(t)*log(abs(t))*0.75+abs(t)*dir;
y = -h*pow(abs(t),0.3)*pow(cos(t),cosFactor)*exp(abs(t))+210;
// z = cz - abs(t)*dir; // tried to have petals twist in the z direction
vertex(x + cx,y + cy);
float incFactor = max(abs(t), 0.01);
t+=0.1*incFactor;
}
endShape(CLOSE);
popMatrix();
}
}