This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this code takes a src string, | |
// tries to fine multiline strings that are | |
// of the form | |
// var fs = ` .... ` or let vs = `....` | |
// and tries to compress them via | |
// glslx | |
// I found renaming hard to manage so this is set to not rename. (my approach is to rename myself to something small) | |
function compressShaders(src) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// written by Golan Levin | |
// for example, huntForBlendFunc(1, -1, -1); | |
void huntForBlendFunc(float period, int defaultSid, int defaultDid){ | |
// sets all possible (24) combinations of blend functions, | |
// changing modes every period seconds. | |
int sfact[] = { | |
GL_ZERO, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, you should install flickrapi | |
# pip install flickrapi | |
import flickrapi | |
import urllib | |
from PIL import Image | |
from urlparse import urlparse | |
# Flickr api access key | |
flickr=flickrapi.FlickrAPI('c6a2c45591d4973ff525042472446ca2', '202ffe6f387ce29b', cache=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ofPolyline temp; | |
float ff = ofGetElapsedTimef(); | |
for (int i = 0; i < 100; i++){ | |
float angle = ofMap(i, 0, 100, 0, TWO_PI); | |
ofPoint pt= ofPoint(400,400); | |
float radius = 200 + ofSignedNoise(ff*0.1, cos(angle)*0.3, sin(angle)*0.3) * 100; | |
pt += radius * ofPoint(cos(angle), sin(angle)); | |
temp.addVertex(pt); | |
} | |
temp.setClosed(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
w/ speed up or slow down: | |
ffmpeg -i INPUT -crf 14 -vf "scale=640:640, setpts=1.0*PTS" -c:a copy -tune grain OUTPUT | |
(adjust crf for compression amount and 1.0*PTS for speed up / down) | |
w/out speed up: | |
ffmpeg -i INPUT -crf 14 -filter:v scale=640:640 -c:a copy -tune grain OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
#include <thread> | |
#include <algorithm> | |
#include <vector> | |
#include <iostream> | |
#include <functional> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
//-------------------------------------------------------------- | |
void ofApp::setup(){ | |
} | |
//-------------------------------------------------------------- | |
void ofApp::update(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
ofEasyCam cam; | |
//-------------------------------------------------------------- | |
void ofApp::setup(){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data2 = [343.578,240.626,342.566,220.307,345.036,161.03,338.079,105.569,393.994,107.748,416.197,168.413,419.841,235.297,422.212,256.19,338.079,105.569,330.11,79.5909,327.501,57.3636,338.079,105.569,287.615,119.797,281.813,183.263,259.249,253.235,260.306,272.378,376.786,240.247,372.111,371.145,426.257,374.581,421.481,399.685,310.122,241.008,301.739,374.391,312.717,492.93,296.487,521.009,343.578,240.626,342.411,220.293,344.539,161.074,337.828,105.704,394.524,107.575,417.215,167.367,422.298,233.197,425.304,253.642,337.828,105.704,330.146,79.864,327.896,57.5828,337.828,105.704,285.889,119.952,275.74,186.252,250.698,259.567,250.541,280.528,376.903,239.885,365.776,377.178,420.797,379.866,415.67,405.612,309.985,241.373,305.77,371.795,319.224,487.056,303.411,514.733,343.578,240.626,342.24,220.299,344.025,161.137,337.563,105.835,394.637,107.671,417.483,166.985,423.492,232.079,426.906,252.231,337.563,105.835,329.905,80.0992,327.909,57.7585,337.563,105.835,284.891,119.763,271.838,187.734,244.93,262.94,243.623,285. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
vector < vector < float > > energies; | |
//-------------------------------------------------------------- | |
void ofApp::setup(){ |
NewerOlder