I wrote something with the processing that I now want to do Mac OS X Screen Saver. However, diving into OpenGL was not as easy as I thought it would be.
Basically, I want to scroll through all the pixels on the screen and set a different pixel color based on this pixel color.
The processing code is as follows:
void setup(){
size(500,500, P2D);
frameRate(30);
background(255);
}
void draw(){
for(int x = 0; x<width; x++){
for(int y = 0; y<height; y++){
float xRand2 = x+random(2);
float yRand2 = y+random(2);
int xRand = int(xRand2);
int yRand = int(yRand2);
if(get(x,y) == -16777216){
set(x+xRand, y+yRand, #FFFFFF);
}
else if(get(x,y) == -1){
set(x+xRand, y+yRand, #000000);
}
}
}
}
It is not very beautiful and not very effective. However, I would like to learn how to do something similar to OpenGL. I donβt even know where to start.
source
share