Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. void plotScores() {
  2.  
  3. if (samples > 1) { //if this is at least the second score, connect the scores with a line
  4. glLineWidth(12.0);
  5. GLdouble lineXPos = 0, lineYPos = 0;
  6. glColor3d(0.3, 0.3, 0.3);
  7. glBegin(GL_LINE_STRIP);
  8. for (int i = 0; i < scores.size(); i++) {
  9. lineXPos = (i * 0.05) - 0.88;
  10. lineYPos = ((scores[i] - 0.5) * 1.6); //need to adjust this for line y-position...
  11. glVertex2d(lineXPos, lineYPos);
  12. }
  13. glEnd();
  14. }
  15. for (int i = 0; i < scores.size(); i++) {
  16. GLdouble pointXPos = (i * 0.05) - 0.88;
  17. GLdouble pointYPos = ((scores[i] - 0.5) * 1.6); //...and this for point y-position
  18. if (scores[i] >= threshold) {
  19. glColor3d(0.0, 1.0, 0.2);
  20. }
  21. else {
  22. glColor3d(1.0, 0.2, 0.0);
  23. }
  24. glBegin(GL_POINTS);
  25. glVertex2d(pointXPos, pointYPos);
  26. glEnd();
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement