Skip to content

Instantly share code, notes, and snippets.

float pointNo = 30;
float stage = 0.0;
PVector point1;
PVector point2;
PVector point3;
PVector point4;
PVector point5, point6, point7, point8;
PVector l1mp, l2mp, l3mp, l4mp;
PVector l5mp, l6mp, l7mp, l8mp;
/*
Date: Nov. 26th, 2017
Sketch Name: Rotating Cubes
Auther: Kokorin
*/
int len = 50; // possible to change less than 150
int cubes = 3; // numbers of cubes on a side
int step = len / (cubes - 1); // interval cubes
float angle = 0;
int px = 300;
int py = 300;
int lar = 100;
int alt = 100;
int ang = 1;
int ang2 = 1;
int ang3 = 1;
void setup(){
size(600,600);
PImage img;
float transparencyValue;
void setup() {
size(200, 200);
img = loadImage( "https://i.imgur.com/vpFQBfR.png" );
img.resize(width, height);
}
void draw() {
FlowField flowfield;
ArrayList<Particle> particles;
int lineSize = 2;
int noOfParticles = 1000;
float rateOfGridChangeOverTime = 0.0004;
int minSpeed = 1;
int maxSpeed = 3;
int lineAlpha = 10;
//global variables
PVector e1 = new PVector();
PVector e2 = new PVector();
PVector e3 = new PVector();
float multiplyer = 1.5;
float x1, x2, y1, y2;
float angle1 = 0, angle2 = 15;
float scalar = 40;
int xspacing = 32; // How far apart should each horizontal location be spaced
int w; // Width of entire wave
float theta = 0.0; // Start angle at 0
float amplitude = 150.0; // Height of wave
float period = 500.0; // How many pixels before the wave repeats
float dx; // Value for incrementing X, a function of period and xspacing
float[] yvalues; // Using an array to store height values for the wave
void setup() {
PImage img1, img2, img3, img4, img5, img6, img7, img8, img;
float i = 0;
static final color BG = -4;
void setup()
{
size(1000,1000,P3D);
img1 = loadImage("https://i.imgur.com/H9FOC2R.png?1");
img2 = loadImage("https://i.imgur.com/2FGaeRo.png?2");
//global variables
PImage img1, img2;
float x1, x2, y1, y2;
float angle1 = 0, angle2 = 25;
float scalar = 10;
float locationSave = height/2 + (scalar * sin(radians(angle1)));
static final color BG = -4;
void setup() {
PImage img;
int xspacing = 1; // How far apart should each horizontal location be spaced
int w = 100, w2 = 150; // Width of entire wave
float theta = 0.0; // Start angle at 0
float theta2 = 0.0;
float amplitude = 3.0, amplitude2 = 12.0; // Height of wave
float period = 35, period2 = 150.0;// How many pixels before the wave repeats
float dx, dx2; // Value for incrementing X, a function of period and xspacing
float[] yvalues, yvalues2; // Using an array to store height values for the wave