Skip to content

Instantly share code, notes, and snippets.

void setup() {
size(500, 500);
background(-1);
wave_line(300, 400, 100, 100, 10, 10);
}
void wave_line(float x1, float y1, float x2, float y2, float sin_width, float sin_height) {
pushMatrix();
translate(x1, y1);
rotate(atan2(y2-y1, x2-x1));
void setup() {
size(500, 500);
background(-1);
fill(#00aaff, 100);
stroke(#00aaff, 200);
wave_circle(250, 250, 100, 10, 10);
}
//reference
//http://p5aholic.hatenablog.com/entry/2015/12/10/000000
float r = 100;
float []r_value = {0.8, 0.6, 0.8, 0.6, 0.6};
float []g_value = {0.6, 0.6, 0.8, 0.8, 0.8};
float []b_value = {0.8, 0.8, 0.6, 0.6, 0.8};
void setup() {
size(600, 600);
PImage image;
ArrayList <Integer>cs = new ArrayList();
ArrayList <Float>posYs = new ArrayList();
int r = 3;
void settings() {
image = loadImage("https://d1f5hsy4d47upe.cloudfront.net/f3/f36c375c339f1212cceb122fdb9d0808_t.jpeg");
size(image.width, image.height);
PImage image;
ArrayList <Integer>cs = new ArrayList();
ArrayList <Float>posYs = new ArrayList();
int r = 3;
void settings() {
image = loadImage("https://d1f5hsy4d47upe.cloudfront.net/f3/f36c375c339f1212cceb122fdb9d0808_t.jpeg");
size(image.width, image.height);
println(image.width+":"+image.height);
PImage image;
ArrayList <Integer>cs = new ArrayList();
PVector [] pos;
ArrayList <ArrayList<PVector>>points = new ArrayList();
int r = 3;
int value=0;
void settings() {
image = loadImage("https://d1f5hsy4d47upe.cloudfront.net/f3/f36c375c339f1212cceb122fdb9d0808_t.jpeg");
size(image.width, image.height);
ArrayList<PVector> pos = new ArrayList();
float []angles = {PI/3, -PI/3};
int frame_count = 0;
int line_max = 50;
void setup() {
size(600, 600);
stroke(#00aaff);
init();
PImage img;
int[] rect_x;
int []rect_y;
void setup() {
size(1200, 500);
img = createImage(width, height, ARGB);
rect_x = new int[width];
rect_y = new int[height];
int boxSize = 5;
int boxNum = 120;
float r = (float)boxNum/2;
void setup() {
size(640, 360, P3D);
colorMode(HSB);
frameRate(20);
}
int value = 0;
void setup() {
size(640, 480);
}
void draw() {
background(-1);
if (mousePressed)fill(255, 0, 0);