float addSteps( int stepSize, float stepHeight, int _i){
int x = _i;// put in variable not to affect i
int y = ( x/stepSize) % 4; // int flattens it out because the intermediar points get rounded (i/steps gives num of points between mod = 1 or =0)
float add = y*stepHeight; // increase amplitude from one
return add;
}
void drawStepLine(int _i){
_i = _i-1;//toget rid of point at front
float strokewidthc = 500; // how much to times vector
float strokewidthd = 10; // how much to times vector
Vec2d a = drawLinePoints[_i];// point 1
Vec2d b = drawLinePoints[_i+1]; // point 2
Vec2d v = b-a; // get vector minus two point vects
Vec2d vp;
vp.x = v.y *-1.0;// times by inverse cosine is inversly proportional to sine
vp.y = v.x;
vp.normalize();
//here mess with c or d stroke point for one side
strokewidthc = addSteps(4,20,_i); // varies the vector size
Vec2d c = (a+vp * strokewidthc);
Vec2d d = (a-vp * strokewidthd);
glVertex2f(c.x, c.y); // puts points
glVertex2f(d.x, d.y); // puts points
}