Skip to content

Instantly share code, notes, and snippets.

View companje's full-sized avatar

Rick Companje companje

View GitHub Profile
@companje
companje / clock.pde
Created May 21, 2012 18:41
Arc Clock in Processing
float heleCirkel = TWO_PI; //tau
void setup() {
size(500,500);
background(0);
smooth();
}
void draw() {
background(0);
@companje
companje / Mandelbrot.pde
Created May 21, 2012 18:55
Mandelbrot visualization in Processing
// Interactive Mandelbrot Set
// Inspired by Daniel Shiffman's Processing example.
// by Rick Companje - www.companje.nl - 6 december 2009
double xmin = -2.5;
double ymin = -2;
double wh = 4;
double downX, downY, startX, startY, startWH;
int maxiterations = 200;
boolean shift=false;
@companje
companje / cube.cpp
Created May 21, 2012 19:01
RGB Cube with ofMesh and ofVbo
//////////////////////////////////////////////////////////////
// testApp.h
//////////////////////////////////////////////////////////////
#pragma once
#include "ofMain.h"
class testApp : public ofBaseApp {
public:
@companje
companje / testApp.cpp
Created May 21, 2012 19:07
Export to PDF with ofxCairo
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
w = ofGetWidth();
h = ofGetHeight();
cam.initGrabber(w,h,true);
pdf = new ofxCairo();
saving = false;
@companje
companje / testApp.cpp
Created May 21, 2012 19:12
test from sublimetext2
testApp.cpp
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
w = ofGetWidth();
h = ofGetHeight();
cam.initGrabber(w,h,true);
@companje
companje / testApp.cpp
Created May 21, 2012 19:19
HSB Cylindrical Color Wheel
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup() {
ofBackground(0);
ofSetFrameRate(30);
glEnable(GL_DEPTH_TEST);
steps = 120;
step = TWO_PI/steps;
@companje
companje / FibonacciSpiral.pde
Created May 21, 2012 22:32
Fibonacci Spiral in Processing
float phi = (sqrt(5)+1)/2;
size(323,200);
translate(height/phi,0);
scale(height);
noStroke();
smooth();
for (float i=0; i<10; i++) {
fill(i/10*255);
@companje
companje / globe.pde
Created May 27, 2012 18:20
Spherical lens effect for spinning globe
import processing.video.*;
PImage bg;
Movie mov;
final int w=255;
void setup() {
size(w,w);
frameRate(30);
bg = loadImage("earth1024.jpg");
@companje
companje / snippet.h
Created May 31, 2012 20:12
BoundingBox and Pivot/Anchor point of points
vector<ofPoint*> getAllPointsFromPath() {
vector<ofPoint*> points;
vector<ofSubPath> &subpaths = path.getSubPaths();
for (int i=0; i<subpaths.size(); i++) {
vector<ofSubPath::Command> &commands = subpaths[i].getCommands();
for (int j=0; j<commands.size(); j++) {
points.push_back(&commands[j].to);
}
}
@companje
companje / LAOS-SimpleCode.pde
Created June 7, 2012 22:16
LAOS SimpleCode Preview tool in Processing
//by Rick Companje, 8 june 2012
String lines[];
float scale=.003;
void setup() {
size(900,600);
mouseX = 0;
smooth();
lines = loadStrings("freest.lgc");