bSplines.c
// Draw a B-spline function

Draw a B-spline function
Draw a B - spline function
void drawSpline(int i, int m)
{
	float x;   
	if (m == 1)
	{
	   glBegin(GL_LINE_STRIP);
	      for ( x = knots[i]; x < knots[i+1]; x+=0.005 )
		     glVertex3f( -4.0 + x, 1.0, 0.0 );	
	   glEnd();
	   }
	else
    {
	glBegin(GL_LINE_STRIP);
	   for ( x = knots[i]; x <= knots[i+m]; x+=0.005 )
		 glVertex3f( -4.0 + x, 3*Bspline(i, m, x) - 2.0, 0.0 );	
	glEnd();
	}
}
void drawSpline ( int i , int m ) { float x ; if ( m == 1 ) { glBegin ( GL_LINE_STRIP ) ; for ( x = knots [ i ] ; x < knots [ i + 1 ] ; x += 0.005 ) glVertex3f ( -4.0 + x , 1.0 , 0.0 ) ; glEnd ( ) ; } else { glBegin ( GL_LINE_STRIP ) ; for ( x = knots [ i ] ; x <= knots [ i + m ] ; x += 0.005 ) glVertex3f ( -4.0 + x , 3 * Bspline ( i , m , x ) - 2.0 , 0.0 ) ; glEnd ( ) ; } }
Draw a B-spline function
Draw a B - spline function
// Drawing are scaled by factor of 3 in the y-direction.
 // Special case to handle order 1 to avoid vertical edges.
