Skip to content

Instantly share code, notes, and snippets.

View Craigson's full-sized avatar

Craig Pickard Craigson

View GitHub Profile
@Craigson
Craigson / Hypotrochoid
Created February 23, 2015 00:57
Generative designs created using the equation for a Hypotrochoid curve.
//Hypotrochoid(a,b,h,da,db)
//a is the radius of the fixed circle
//b is the radius of the circle rotating inside the fixed circle
//h is the distance between the drawing and the centre
//on the rotating circle
Hypotrochoid h;
void setup() {
size(800, 800);
@Craigson
Craigson / processing client (WIP)
Created February 25, 2015 04:47
Processing acting as a client, receiving data from python server
//Python acts as server
//code for processing to run as client
import processing.net.*;
Client myClient;
String dataIn;
boolean firstContact;
//code for Seiffert's spherical spiral
float r; //radius of sphere
@Craigson
Craigson / python server (WIP)
Created February 25, 2015 04:51
Python server than computes the x,y, and z-values for the Jacobi Elliptic Equations and sends them in an array to Processing
# http://www.binarytides.com/python-socket-server-code-example/
# https://github.com/Uberi/speech_recognition#readme
#imports for server
import socket
#imports for jacobian functions
import scipy
import math
from scipy.special import ellipj
@Craigson
Craigson / Client-side JS
Created February 28, 2015 22:05
A piece of self-conscious artwork that adjusts itself based on the viewer's opinion
//create keywords for identifying variables inside the p5 sketch
var keywords = ['color','composition','layout','bright','brightness','dark','saturated'];
var paletteMult;
var r = [];
var g = [];
var b = [];
var rad = [];
var numCircles;
var x = [];
@Craigson
Craigson / Generative Portraits
Last active August 29, 2015 14:16
Generative portraits inspired by Golan Levin's Floccular portraits
Cluster cluster1, cluster2, cluster3,cluster4;
PImage img; //create the image object for trapping snow
boolean showImage = false;
ArrayList<Cluster>clusters;
void setup() {
size(700,950, P2D);
img = loadImage("data/bruce.png"); //load the image into the system
image(img, 0, 0);
@Craigson
Craigson / of->Cinder
Last active August 29, 2015 14:18
oF code to cinder code
oFsetup(){
for(int i = 0; i < n; i++) {
ofTexture cur;
cur.allocate(512, 512, GL_RGB);
textures.push_back(cur);
}
}
@Craigson
Craigson / Arduino INA3221 - CSV format
Created May 11, 2015 17:14
Arduino Test Code for INA3221 on SunAirPlus board (in CSV format)
//
// SDL_Arduino_INA3221 Library Test Code
// SDL_Arduino_INA3221.cpp Arduino code - runs in continuous mode
// Version 1.1
// SwitchDoc Labs January 31, 2015
//
//
// This was designed for SunAirPlus - Solar Power Controller - www.switchdoc.com
//
@Craigson
Craigson / RipCord CSS
Created May 11, 2015 19:41
front- and back-end code for the RipCord App prototype
/*This CSS is optimized for an iPhone4 display */
html{
background-color: #00CC99;
color: white;
}
body{
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 14px;
@Craigson
Craigson / corpus JSON file
Created May 12, 2015 01:10
this.mirror - and augmented video mirror created to initiate conversation between strangers
{
"single": [
{
"text": "Damn I look good tonight",
"smiling": true,
"glasses": false
},
{
"text": "Should have gotten glasses when mom said so",
"smiling": false,
@Craigson
Craigson / prepSet
Created May 15, 2015 20:07
perparesettings not working
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/GeomIO.h"
#include "cinder/ImageIo.h"
#include "cinder/MayaCamUI.h"
#include "cinder/Utilities.h"
#include "cinder/Rand.h"
#include <sstream>