Skip to content

Instantly share code, notes, and snippets.

View companje's full-sized avatar

Rick Companje companje

View GitHub Profile
#include "Arduino.h"
class Encoder {
public:
int pinA, pinB, prevA, prevB, index, value;
//delta, prev, v;
Encoder() {
}
@companje
companje / coin_acceptor_adafruit.ino
Created July 13, 2012 23:27
Coin Acceptor Adafruit
#include <LCD4Bit_mod.h>
LCD4Bit_mod lcd = LCD4Bit_mod(2);
int geld=0;
void setup() {
lcd.init();
lcd.clear();
lcd.printIn("Gooi geld in aub");
@companje
companje / gist:3122170
Created July 16, 2012 11:10
wheel.scad
$fs=0.1;
h=30;
topH=5;
topR=25;
poleR=5;
screwR=1.5;
screwX=11.57;
translate([0,0,h/2-topH/2]) {
linear_extrude(height=topH, center=true) {
@companje
companje / cloud-alpha-shader.cpp
Created July 19, 2012 18:26
Earth with Clouds AlphaBlending Shader
//testApp.cpp
#include "ofMain.h"
class testApp : public ofBaseApp {
public:
ofShader shader;
ofImage earth,clouds;
ofEasyCam cam;
GLUquadricObj *quadric; //for gluSphere
@companje
companje / subdivide-tetrahedron.cpp
Created August 4, 2012 16:21
Subdivide a tetrahedron to a sphere with ofMesh in openFrameworks
#include "ofMain.h"
#include "ofAppGlutWindow.h"
class ofApp : public ofBaseApp {
public:
ofMesh mesh;
ofEasyCam cam;
void setup() {
@companje
companje / geosphere.cpp
Created August 4, 2012 20:12
Geographic-grid Tessellated Sphere
class testApp : public ofBaseApp {
public:
ofMesh mesh;
ofEasyCam cam;
void setup() {
ofSetFrameRate(20);
ofBackground(0);
glEnable(GL_CULL_FACE);
Beestje a;
Beestje b;
void setup() {
size(500,500);
smooth();
a.oogKleur = 255;
a.x = 100;
a.y = 100;
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
imageWidth = 1024;
imageHeight = 512;
nightWidth = dayWidth = 400;
gradientWidth = 75;
@companje
companje / QuadWarp.cpp
Created November 18, 2012 13:57
QuadWarping with openFrameworks
#include "ofMain.h"
#include "ofAppGlutWindow.h"
class testApp : public ofBaseApp {
public:
ofImage img;
ofPoint corners[4];
int selectedCorner;
#include "ofMain.h"
#include "ofAppGlutWindow.h"
#include "ofxOpenCv.h"
#include "ofxSimpleGuiToo.h"
#define NUM 2
class testApp : public ofBaseApp {
public:
ofVideoGrabber cam[NUM];