Help creating frames
in
Programming Questions
•
6 months ago
Hey guys, first time posting.
I'm pretty new to processing and trying to get into generative art. Hit a bit of a bump today when I can't seem to get it to save any of my results.
Ideally I want it to just generate frames, and I've done this before with others, just for some reason this one doesn't want to do as it's told. The visual output is as I want it (I realise it looks weird, it is meant to be like that) but I can't get it to even save for some reason. Ended up resorting to doing it one frame at a time and trying to get it to save on hitting enter but even that isn't working. And I want the results to be bigger than my screen resolution so print screening isn't even an option.
Here's the code (it might look a bit... odd, I can't quite remember what I ended up doing to it when I had my little angry moment but I've checked and it's still coming up with what I want on the visual end) :
float xstart, xnoise, ynoise;
void setup(){
size(2000,1000);
frameRate(24);
smooth();
background(255);
xstart=random(10);
xnoise=xstart;
ynoise=random(10);
for(int y=0;y<=height;y+=5){
ynoise+=0.1;
xnoise=xstart;
float lastx=-999;
float lasty=-999;
for(int x=0; x<=width;x+=5){
xnoise+=0.01;
drawPoint(x,y,noise(xnoise,ynoise));
stroke(220);
lastx=x;
lasty=y;
}
}
}
void drawPoint(float x,float y, float noiseFactor){
if(width>=2000){
float len=10*noiseFactor;
rect(x,y,len,len);
}
}
void keyPressed(){
if(keyCode == ENTER){
saveFrame("screen-####.jpg");
}
}
If anyone has any idea I will be forever grateful.
Thanks,
Gemma
1