void addVertices(vector<float>& vertices, vector<float>& colors, Vec2D<float> point, Vec2D<float> v1, QColor color, float z = 0.0) { Vec2D<float> normal = v1; swap(normal.x, normal.y); normal.x *= -1; normal.normalize(); Vec2D<float> p1 = point + normal * LINE_WIDTH; Vec2D<float> p2 = point - normal * LINE_WIDTH; for (int i = 0; i < 2; i++) { colors.push_back(color.redF()); colors.push_back(color.greenF()); colors.push_back(color.blueF()); colors.push_back( (color.greenF() + color.redF()) *0.3f ); } vertices.push_back(p1.x); vertices.push_back(p1.y); vertices.push_back(z); vertices.push_back(p2.x); vertices.push_back(p2.y); vertices.push_back(z); }