Skip to content

Instantly share code, notes, and snippets.

//CLOSEST
{
int closest = 0;
float closestX=0;
float closestY=0;
ofPixels & pix = grayImage.getPixels();
for (int y=0;y<depthHeight;y++){
for (int x=0; x<depthWidth; x++) {
int index = x+y*depthWidth;
@aaronsherwood
aaronsherwood / noiseMeshSetup.pde
Last active September 8, 2018 11:51
Noise Terrain Setup
// https://bit.ly/2wWIseN
int scl = 20;
int cols = 1280/scl;
int rows = 720/scl;
float[][] terrain = new float[cols+1][rows+1];
float flying=0;
void setup() {
size(1280, 720, P3D);
int sensorPin = A0;
int buttonPin = 2;
int ledPin = 12;
int sensorValue = 0;
int buttonValue = 0;
int count = 0;
int target_wraps = 10;
bool check = true;
void setup() {
@aaronsherwood
aaronsherwood / main.cpp
Created September 15, 2013 23:36
pluto_data_structure
//
// main.cpp
// pluto_data
//
// Created by Aaron Sherwood on 9/14/13.
// Copyright (c) 2013 Aaron Sherwood. All rights reserved.
//
#include <iostream>
#include <math.h>
@aaronsherwood
aaronsherwood / arcs.cpp
Created August 10, 2013 03:30
openFrameworks custom arc drawing. used to draw arcs similar to flight patterns, using my own data.
//
// mapArc.cpp
//
// Created by Aaron Sherwood on 3/29/13.
// Copyright 2013. All rights reserved.
//
#include <iostream>
#include "mapArc.h"
@aaronsherwood
aaronsherwood / coords.rb
Created August 10, 2013 03:19
ruby script to get coordinates from openpaths and update a csv file with the info
#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'
require 'crazylegs'
require 'json'
require 'FasterCSV'
include Crazylegs
@aaronsherwood
aaronsherwood / opticalFlowTest .cpp file
Last active December 14, 2015 19:39
optical flow test with a fragment shader in openframeworks
#include "testApp.h"
using namespace ofxCv;
using namespace cv;
//--------------------------------------------------------------
void testApp::setup(){
ofSetVerticalSync(true);
ofBackground(0);
loadShader();
@aaronsherwood
aaronsherwood / arduino moshi moshi
Last active December 14, 2015 18:39
code for moshi moshi
#include <Ethernet.h>
#include <SPI.h>
#include <Audio.h>
#include <SD.h>
const int inputPin = 24;
char server[] = "asterisk.itp-redial.com";
String location = "/~ags419/sinatra/wifeSignal/getout HTTP/1.0";
bool vol;
@aaronsherwood
aaronsherwood / Ruby script for post request
Created March 6, 2013 04:22
openFrameworks dialin test
#!/usr/bin/ruby
require 'net/http'
require 'uri'
num = ARGV[0]
postData = Net::HTTP.post_form(URI.parse('http://itp.nyu.edu/~ags419/sinatra/redial/putin'), {'number'=>num})
puts postData.body
@aaronsherwood
aaronsherwood / extensions.conf
Created February 12, 2013 01:54
deerhoof infinite song
[ags419]
exten => s,1,Answer()
exten => s,n,Goto(ags419_deerhoof,ans,1)
[ags419_deerhoof]
exten => ans,1,Background(/home/ags419/asterisk_sounds/answerDeerhoof)
exten => ans,n,WaitExten(2)
exten => ans,n,Goto(ags419_deerhoof,ans,1)