diff options
| author | Comment <tim@gray.(none)> | 2013-06-24 23:18:03 +0100 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-06-24 23:18:03 +0100 |
| commit | 11229ede83c48fab01e6e566155536b5e7e9d762 (patch) | |
| tree | dcd2671c419bdbddde9191712dc3cf5ab2a98f04 /06_performance/src/oni.h | |
| parent | ff979a86dc8f031c823cd8806324b0e8c4ca069b (diff) | |
yay
Diffstat (limited to '06_performance/src/oni.h')
| -rw-r--r-- | 06_performance/src/oni.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/06_performance/src/oni.h b/06_performance/src/oni.h index 36d216a..c858995 100644 --- a/06_performance/src/oni.h +++ b/06_performance/src/oni.h @@ -22,9 +22,11 @@ class fpoint{ float l=ofGetElapsedTimef()-st; if (life>l) { glPointSize((1.0f-(l/life))*size); + glBegin(GL_POINTS); glColor3ub(r,g,b); //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)); + glEnd(); return true; } else { @@ -37,9 +39,21 @@ class syncOniPlayer{ public: syncOniPlayer() { drawable=false; + gamma=3.0f; + LUT=NULL; + makeLUT(); } ~syncOniPlayer(){ stop(); + //if (LUT) delete[] LUT; + } + void makeLUT(){ + if (NULL==LUT){ + LUT=new uint8_t[0xff]; + } + for (int i=0;i<0xFF;i++) { + LUT[i]=(uint8_t)(pow(((float)i)/255.0f,gamma)*255.0f); + } } void addPlayer(string name); void play(); @@ -60,6 +74,8 @@ class syncOniPlayer{ bool drawable; vector<fpoint> points; set<int> pointPool; + float gamma; + uint8_t *LUT; }; //======================================== class oniManager{ |
