Skip to content

Instantly share code, notes, and snippets.

View naikrovek's full-sized avatar

Jeremiah Johnson naikrovek

View GitHub Profile
void sixteenRandomBytes(unsigned char buf[16]) {
for (int i = 0; i < 16; i++) {
buf[i] = rand() & 0xff;
}
}
// PKCS #7 padding
// Do this before encrypting to get the message
// up to a multiple of 16 bytes.
size_t pad(unsigned char *buf, size_t messageLength) {
// by dave @ beesandbombs.tumblr.com
////////////////////////////////////
int[][] result;
float time;
void setup() {
setup_();
result = new int[width*height][3];
}
// by dave @ beesandbombs.tumblr.com >:)
void setup() {
setup_();
result = new int[width*height][3];
result_ = new int[width*height][3];
}
int[][] result, result_;
float time;
int samplesPerFrame = 32;
int numFrames = 42;
float shutterAngle = .8;
int[][] result;
float time;
float d1, d2, th, pp = .7, t, tt;
int N = 10, M = 9;
// http://beesandbombs.tumblr.com/post/65550137124/shapes
// by dave
void setup() {
size(500, 500);
noStroke();
rectMode(CENTER);
}
float time, x, y, d;
/* passable motion blur effect using frame blending
* basically move your 'draw()' into 'sample()', time runs from 0 to 1
* by dave
* http://beesandbombs.tumblr.com
*/
int samplesPerFrame = 32; // more is better but slower. 32 is enough probably
int numFrames = 48;
float shutterAngle = 2.0; // this should be between 0 and 1 realistically. exaggerated for effect here
int[][] result;
int[][] result;
float time;
void setup() {
setup_();
result = new int[width*height][3];
}
void draw() {
for (int i=0; i<width*height; i++)
// by dave @ bees & bombs >:)
int[][] result;
float t;
void setup() {
setup_();
result = new int[width*height][3];
}
// by Dave @ beesandbombs
int[][] result;
float t;
void setup() {
setup_();
result = new int[width*height][3];
}
int[][] result;
float t;
void setup() {
setup_();
result = new int[width*height][3];
}
void draw() {