#include "Lines.h" #include #include "vgl.h" #include #include using namespace std; Lines::Lines() { int i; display = true; timeStep = 0; return; } Lines::~Lines() { glDeleteBuffers(2, bufferIDs); glDeleteVertexArrays(1, &VAONumber); return; } void Lines::CreatePoints(int num) { int i; Vertex v; float theta; float dTheta; if (num < 3 or num > 300000) { num = 300; } dTheta = 2*M_PI / (num); // initial point is the origin. v.position[0] = 0; v.position[1] = 0; v.color[0] = 0; v.color[0] = 0; v.color[0] = 0; points.push_back(v); theta = 0; for(i=0;i TIME_MAX) { dir = -1; timeStep = TIME_MAX; } else if (timeStep < TIME_MIN) { timeStep = TIME_MIN; dir - 1; } return; } void Lines::Display() { if (display) { glEnable(GL_LINE_SMOOTH); glUniform1f(tsLoc, timeStep); glBindVertexArray(VAONumber); glDrawElements(GL_LINES, index.size(), GL_UNSIGNED_SHORT, NULL); glBindVertexArray(0); glDisable(GL_LINE_SMOOTH); } return; }