Skip to content

Instantly share code, notes, and snippets.

@ofTheo
ofTheo / gist:1558683
Created January 4, 2012 05:47
example of auto sorting devices by serial no:
//---------------------------------------------------------------------------
bool ofxKinectContext::init() {
if(freenect_init(&kinectContext, NULL) < 0) {
ofLog(OF_LOG_ERROR, "ofxKinect: freenect_init failed");
return false;
}
//NEW:
freenect_device_attributes * devAttrib;
int numDevices = freenect_list_device_attributes(kinectContext, &devAttrib);
uniform sampler2D texture;
uniform float scale, aspect, time;
uniform mat3 transform;
varying vec2 v_texcoord;
#define PI 3.141592653589793
#define PI_2 1.570796326794897
vec2 tc_offset[9];
@ofTheo
ofTheo / gist:2661196
Created May 11, 2012 17:31
fbo test example.
#include "testApp.h"
ofFbo fbo;
//--------------------------------------------------------------
void testApp::setup(){
//ofxiPhoneSetOrientation(OFXIPHONE_ORIENTATION_LANDSCAPE_RIGHT);
bikers.loadImage("images/bikers.jpg");
gears.loadImage("images/gears.gif");
tdf.loadImage("images/tdf_1972_poster.jpg");
/*
---------------------------------------------------------------------------
Open Asset Import Library (ASSIMP)
---------------------------------------------------------------------------
Copyright (c) 2006-2010, ASSIMP Development Team
All rights reserved.
Redistribution and use of this software in source and binary forms,
#include "ofConstants.h"
#include "ofFbo.h"
#include "ofAppRunner.h"
#include "ofUtils.h"
#include "ofGraphics.h"
#include "ofGLRenderer.h"
#include <map>
//#ifndef TARGET_OPENGLES
#include "ofConstants.h"
#include "ofFbo.h"
#include "ofAppRunner.h"
#include "ofUtils.h"
#include "ofGraphics.h"
#include "ofGLRenderer.h"
#include <map>
//#ifndef TARGET_OPENGLES
if( settings.useDepth ){
if(settings.depthAsTexture){ //depth as a texture - possibly stencil also.
//TODO: add depthAsTexture support for iOS / Android
#ifndef TARGET_OPENGLES
GLuint attachment;
depthBufferTex.texData.textureTarget = settings.textureTarget;
if( settings.useStencil ){
@ofTheo
ofTheo / gist:2836647
Created May 30, 2012 14:26
0071 git commit log
8fdd2f1 Re-enabled MoviesTask in ofQuickTimePlayer to fix multithreaded movie playback
a6d738a fixes for iphone sound stream
d549e09 updated arch install scripts, added arch to readme.linux
c6053ab ofRectangle: Added ofPoint-based constructor to be consistent with the corresponding set(ofPoint ...) function.
895b000 Replaced relative paths with OF_ROOT
c474e7c removed if statement in ofRectangle::inside()function to be consistent with the ofRectangle::== and ofRectangle::!= operators.
f1e9cc4 Added linux 32 bit fullCBP.
9115253 Fixed makefile exclude dirs.
3c0cd68 fixed vc project for advanced3d example
bcc4b07 removed unnecessary project vs2010
3d/advanced3dExample/
3d/cameraParentingExample/
3d/cameraRibbonExample/
3d/easyCamExample/
3d/meshFromCamera/
3d/modelNoiseExample/
3d/normalsExample/
3d/ofBoxExample/
3d/orientationExample/
3d/pointCloudExample/
@ofTheo
ofTheo / gist:4245137
Created December 9, 2012 14:19
OF iOS image picker from library example
#include "testApp.h"
ofxiPhoneImagePicker camera;
ofImage photo;
//--------------------------------------------------------------
void testApp::setup(){
ofBackground(0);
}