Skip to content

Instantly share code, notes, and snippets.

@prisonerjohn
prisonerjohn / ofApp-recv.cpp
Last active October 20, 2019 21:02
Sensing Machines Spout
#include "ofApp.h"
void ofApp::setup()
{
ofSetWindowShape(640, 480);
// Set up Spout receivers.
receiverGrabber.init("Video Input");
receiverThreshold.init("Threshold Image");
@prisonerjohn
prisonerjohn / ofApp-client.cpp
Last active October 20, 2019 20:04
Sensing Machines Syphon
#include "ofApp.h"
void ofApp::setup()
{
ofSetWindowShape(640, 480);
// Set up Syphon clients.
clientGrabber.setup();
clientGrabber.set("Video Input", "syphon-sendDebug");
clientThreshold.setup();
@prisonerjohn
prisonerjohn / ofApp-recv.cpp
Last active October 15, 2019 16:03
Sensing Machines OSC
#include "ofApp.h"
void ofApp::setup()
{
ofSetWindowShape(640, 480);
// Make the circle smoother by increasing the resolution.
ofSetCircleResolution(128);
// Set up the OSC receiver.
@prisonerjohn
prisonerjohn / ofApp-aligned.cpp
Last active October 21, 2019 01:24
Depth World
#include "ofApp.h"
void ofApp::setup()
{
ofSetWindowShape(640, 360);
// Start the depth sensor.
rsContext.setup(true);
// Setup the parameters.
#include "ofApp.h"
void ofApp::setup()
{
kinect.init();
kinect.open();
}
void ofApp::update()
{
@prisonerjohn
prisonerjohn / ofApp-basic.cpp
Last active October 9, 2019 04:34
RealSense
#include "ofApp.h"
void ofApp::setup()
{
// Default RS resolution.
ofSetWindowShape(640, 360);
// true parameter starts the camera automatically.
rsContext.setup(true);
}
@prisonerjohn
prisonerjohn / ofApp-arrays.h
Last active October 6, 2019 02:28
Pointers
#pragma once
#include "ofMain.h"
class ofApp : public ofBaseApp
{
public:
void setup();
void update();
void draw();
@prisonerjohn
prisonerjohn / ofApp-logFile.cpp
Last active September 30, 2019 21:46
Logging
#include "ofApp.h"
void ofApp::setup()
{
//ofSetLogLevel(OF_LOG_VERBOSE);
//ofSetLogLevel(OF_LOG_NOTICE); // default
ofSetLogLevel(OF_LOG_WARNING);
//ofSetLogLevel(OF_LOG_ERROR);
//ofSetLogLevel(OF_LOG_FATAL_ERROR);
//ofSetLogLevel(OF_LOG_SILENT);
@prisonerjohn
prisonerjohn / main.cpp
Last active September 22, 2019 23:41
Object Tracking
#include "ofMain.h"
#include "ofApp.h"
int main()
{
ofSetupOpenGL(640, 480, OF_WINDOW);
ofRunApp(new ofApp());
}
@prisonerjohn
prisonerjohn / main.cpp
Last active September 16, 2019 02:38
Sensing Machines OpenCV
#include "ofMain.h"
#include "ofApp.h"
int main()
{
ofSetupOpenGL(1280, 720, OF_WINDOW);
ofRunApp(new ofApp());
}