Advertisement
Guest User

Untitled

a guest
Oct 18th, 2013
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. void testApp::draw(){
  2.  
  3. tex1.begin();
  4.  
  5. if(bNoise==false)
  6. {
  7. ofSetHexColor(0xFFFFFF);
  8. ofFill();
  9. ofCircle(ofGetWidth()/2, ofGetHeight()/2, ofGetHeight()/2);
  10.  
  11. ofSetHexColor(0x0000FF);
  12. ofFill();
  13. ofCircle(xWords, yWords, ofGetHeight()/6);
  14.  
  15. ofSetHexColor(0x000000);
  16. ofFill();
  17. ofCircle(xWords, yWords, ofGetHeight()/10);
  18. }
  19. else
  20. {
  21. ofSetHexColor(0x000000);
  22. ofFill();
  23. ofCircle(ofGetWidth()/2, ofGetHeight()/2, ofGetHeight()/2);
  24.  
  25. ofSetHexColor(0xFF0000);
  26. ofFill();
  27. ofCircle(xWords, yWords, ofGetHeight()/6);
  28.  
  29. ofSetHexColor(0x110000);
  30. ofFill();
  31. ofCircle(xWords, yWords, ofGetHeight()/8);
  32. }
  33.  
  34. tex1.end();
  35.  
  36. ofEnableNormalizedTexCoords();
  37.  
  38. tex1.bind();
  39. fishShader.begin();
  40. fishShader.setUniformTexture("tex0", tex1, 0);
  41. fishShader.setUniform1f("signcurvature", curvature);
  42. fishShader.setUniform1f("lensradius", radius);
  43.  
  44. ofPushMatrix();
  45. ofTranslate(320, 240);
  46. glBegin(GL_QUADS);
  47. glTexCoord2f(0,0); glVertex3f(0,0,0);
  48. glTexCoord2f(1,0); glVertex3f(320,0,0);
  49. glTexCoord2f(1,1); glVertex3f(320,240,0);
  50. glTexCoord2f(0,1); glVertex3f(0,240,0);
  51. glEnd();
  52. ofPopMatrix();
  53. fishShader.end();
  54. tex1.unbind();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement