diff options
Diffstat (limited to '06_performance/src/oni.h')
| -rw-r--r-- | 06_performance/src/oni.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/06_performance/src/oni.h b/06_performance/src/oni.h index 158d513..2492d79 100644 --- a/06_performance/src/oni.h +++ b/06_performance/src/oni.h @@ -2,9 +2,25 @@ #include "ofxXmlSettings.h" #include "ofxOpenNI.h" - - -//in order to play different clips it seems necessary to have a player per clip +//a colour video particle +class fpoint{ + public: + fpoint(float _x,float _y, float _z, unsigned char _r,unsigned char _g,unsigned char _b){ + x=_x;y=_y;z=_z;r=_r;g=_g;b=_b;st=ofGetElapsedTimef(); + } + float x,y,z; + float st; + unsigned char r,g,b; + bool draw(float life,float dx,float dy,float dz){ + float l=ofGetElapsedTimef()-st; + if (life>l) { + glColor4ub(r,g,b,(unsigned char)255); // ((l/life)*255.0f)); + glVertex3f(x-(pow(l,2)*dx),y-(pow(l,2)*dy),z-(pow(l,2)*dz)); + return false; + } + else return true; + } +}; class syncOniPlayer{ public: syncOniPlayer() { @@ -18,8 +34,10 @@ class syncOniPlayer{ void update(); void pause(); int getCurrentFrame(); + int getNumParticles(); void drawWindows(); void drawCloud(int step); + void drawPoints(float birth,float life,float dx,float dy, float dz); void stop(); string audio; @@ -28,16 +46,19 @@ class syncOniPlayer{ vector<string> filenames; ofSoundPlayer soundplayer; bool drawable; - + list<fpoint> points; }; //======================================== class oniManager{ public: void init(const char* filename); void startPlayer(int num); + int getNumClips(); + int getNumParticles(); void update(); void drawWindows(); void drawCloud(int step); + void drawPoints(float size,float birth,float life,float dx,float dy, float dz); void previous(); void next(); int playing; |
