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 "testApp.h" | |
// this can go in your h file; | |
ofPoint pts[5]; | |
uint ctr; | |
ofPath path; | |
ofPolyline lineOrig; | |
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
// usage for DSP | |
// https://github.com/vinniefalco/DSPFilters | |
#include "Dsp.h" | |
// variables... these filters want a float ** array, so I allocate it like this: | |
Dsp::Filter* f; | |
float* audioData[1]; |
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
# rename files: | |
find . -type f -iname "testApp.h" -exec rename 's/testApp/ofApp/' {} \; | |
find . -type f -iname "testApp.cpp" -exec rename 's/testApp/ofApp/' {} \; | |
#find and replace | |
find . -type f -iname "ofApp.h" -exec sed -i "" 's/testApp/ofApp/g' {} \; | |
find . -type f -iname "ofApp.cpp" -exec sed -i "" 's/testApp/ofApp/g' {} \; |
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
for hiro | |
//-------------------------------------------------------------- | |
void testApp::draw(){ | |
ofSetColor(255,0,127); | |
ofBeginShape(); |
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
// some small examples from in-class | |
f = { 1 + 1 + 1}; | |
f.value; | |
a = {SinOsc.ar(440)}.play | |
a.free |
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 <stddef.h> // defines NULL | |
template <class T> | |
class Singleton{ | |
public: | |
static T* Instance() { | |
if(!m_pInstance) m_pInstance = new T; | |
assert(m_pInstance != NULL); | |
return m_pInstance; | |
} | |
protected: |
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
// make a sphere | |
ofSpherePrimitive sph; | |
sph.set(100, 10); | |
ofMesh s = sph.getMesh(); | |
// grab the current camera | |
// this is to figure out where a camera "should" be, ie, for this overall picture where is the camera. | |
ofCamera mainCam; | |
mainCam.setupPerspective(); | |
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
//---------------------------------------------------------------------- paper script -> javascript | |
// Define a point to start with | |
var point1 = new Point(10, 20); | |
debugger; | |
// Create a second point that is 4 times the first one. | |
// This is the same as creating a new point with x and y | |
// of point1 multiplied by 4: | |
var point2 = point1 * 4; |
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
ofPoint pt; | |
ofPoint smoothPt; | |
//-------------------------------------------------------------- | |
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 <videocapture/Capture.h> | |
using namespace ca; | |
class videoCaptureThreaded : public ofThread{ | |
public: | |
static void fcallback(PixelBuffer& buffer){ |