Skip to content

Instantly share code, notes, and snippets.

View ThomasLengeling's full-sized avatar

Thomas Sanchez Lengeling ThomasLengeling

View GitHub Profile
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/params/Params.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class FractalArbolApp : public AppNative {
public:
/*
Basic Spout receiver for Cinder
Uses the Spout SDK
Based on the RotatingBox CINDER example without much modification
Nothing fancy about this, just the basics.
Search for "SPOUT" to see what is required
import java.nio.FloatBuffer;
import KinectPV2.*;
import javax.media.opengl.GL2;
private KinectPV2 kinect;
float a = 0;
int zval = 50;
float scaleVal = 260;
/*
Simple explotion particles in Processing
by
Thomas Sanchez Lengeling
*/
import java.util.Vector;
Vector mParticles;
toms-MBP:libfreenect2 tom$ sh ./depends/install_mac.sh
Cloning into '/Users/tom/Documents/GitHub/libfreenect2/depends/libusb_src'...
remote: Counting objects: 10658, done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 10658 (delta 9), reused 0 (delta 0), pack-reused 10632
Receiving objects: 100% (10658/10658), 2.47 MiB | 825.00 KiB/s, done.
Resolving deltas: 100% (7860/7860), done.
Checking connectivity... done.
Note: checking out '51b10191033ca3a3819dcf46e1da2465b99497c2'.
@ThomasLengeling
ThomasLengeling / TextureSequence.h
Created April 29, 2015 19:35
Cinder Texture Sequence
#pragma once
#include "cinder/app/App.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Texture.h"
#include "cinder/Log.h"
class TextureSequence;
typedef std::shared_ptr<TextureSequence> TextureSequenceRef;
// Draws a triangle using low-level OpenGL calls.
import java.nio.*;
PGL pgl;
PShader sh;
int vertLoc;
int colorLoc;
float[] vertices;
float promedio;
float value;
int counter = 0;
int numDatos = 50;
void loop(){
float inValue = analogRead(PIN);
promedio += inValue;
int index2 = i * (JointType_Count+1) * 9;
int indexJoint = index2 + (JointType_Count+1) * 9 - 1;
if(rawData[indexJoint] == 1.0){
tracked = true;
colorIndex = i;
int j = 0;
int index1 = j * 9;
int type = (int)rawData[index2 + 0 + 8];
struct Track {
ci::audio::BufferPlayerNodeRef bufferPlayer;
ci::audio::GainNodeRef gain;
ci::audio::MonitorNodeRef monitor;
ci::audio::Pan2dNodeRef pan;
ci::audio::ChannelRouterNodeRef mChannelRouterNode;
ci::audio::OutputDeviceNodeRef multichannelOutputDeviceNode;
Track(ci::audio::BufferPlayerNodeRef bufferPlayer)
: bufferPlayer(bufferPlayer)