//C is the spline points container, x,y void draw_spline(std::vector> C, double red, double green, double blue, double alpha){ std::vector::iterator it; //the forward and backward function has only to be recalculated when spline controlpoints are edited by user. std::vector forward=draw_forward_spline(C,red,green,blue,alpha); std::reverse(C.begin(),C.end()); std::vector backward=draw_backward_spline(C,red,green,blue,alpha); std::reverse(backward.begin(),backward.end()); std::vector differce; POINT p; for(int i=0; ix,it->y); } glEnd(); } std::vector draw_forward_spline(std::vector> C, double red, double green, double blue, double alpha){ std::vector points; double S[C.size()-1][2][4]; double w, b[C.size()], d[C.size()], x[C.size()]; int i, dim; int n = C.size()-1; // number of splines for(dim=0; dim<2; dim++) { // define d[]: d[0]=3.0*(C[1][dim]-C[0][dim]); for(i=1; i=0; i--) x[i]=(d[i]-x[i+1])/b[i]; // calculate spline S[i][dim] a, b, c and d: for(i=0; i draw_backward_spline(std::vector> C, double red, double green, double blue, double alpha){ std::vector points; double S[C.size()-1][2][4]; double w, b[C.size()], d[C.size()], x[C.size()]; int i, dim; int n = C.size()-1; // number of splines for(dim=0; dim<2; dim++) { // define d[]: d[0]=3.0*(C[1][dim]-C[0][dim]); for(i=1; i=0; i--) x[i]=(d[i]-x[i+1])/b[i]; // calculate spline S[i][dim] a, b, c and d: for(i=0; i