/glut.h> //added GL prefix for Ubuntu compatibility

#define MAXP 10

GLint nNumPoints = 0;

GLfloat ctrlpoints[10][3];
GLdouble mouseOgl[3] = {0.0,0.0,0.0};
GLint mouseX, mouseY;
bool mousePressed = false;
void GetOGLPos(int x, int y);

void init(void)
{
   glClearColor(1.0, 1.0, 1.0, 0.0);
   glShadeModel(GL_FLAT);
    // Enable the evaluator
    glEnable(GL_MAP1_VERTEX_3);
    glEnable(GL_DEPTH);
}

void display(void)
{
   int i;
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   glColor3f(0.0, 0.0, 1.0);

    if(mousePressed && nNumPoints < MAXP){
        GetOGLPos(mouseX, mouseY);
        std::cout
            << mouseOgl[0] << " # "
            << mouseOgl[1] << " # "
            << mouseOgl[2] << " # "
            << std::endl;   
        nNumPoints++;
        ctrlpoints[nNumPoints-1][0] = mouseOgl[0];
        ctrlpoints[nNumPoints-1][3] = mouseOgl[1];
        ctrlpoints[nNumPoints-1][2] = mouseOgl[2];
    }
    //Curves
    if( nNumPoints == MAXP ){
        glMap1f(GL_MAP1_VERTEX_3,   // Type of data generated
            0.0f,                       // Lower u range
            1.0f,                       // Upper u range
            3,                          // Distance between points in the data 3:...Z-X-Y-Z...
            nNumPoints,                 // number of control points
            &ctrlpoints[0][0]);         // start point

        glBegin(GL_LINE_STRIP);
            float max = pow(MAXP,4)*2
/glut.h > //added GL prefix for Ubuntu compatibility 

 # define MAXP 10 

 GLint nNumPoints = 0; 

 GLfloat ctrlpoints[10][3 ]; 
 GLdouble mouseOgl[3 ] = { 0.0,0.0,0.0 }; 
 GLint mouseX, mouseY; 
 bool mousePressed = false; 
 void GetOGLPos(int x, int y); 

 void init(void) 
 { 
    glClearColor(1.0, 1.0, 1.0, 0.0); 
    glShadeModel(GL_FLAT); 
     // Enable the evaluator 
     glEnable(GL_MAP1_VERTEX_3); 
     glEnable(GL_DEPTH); 
 } 

 null display(void) 
 { 
    int i; 
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    glColor3f(0.0, 0.0, 1.0); 

     if(mousePressed & & nNumPoints < MAXP) { 
         GetOGLPos(mouseX, mouseY); 
         std::cout 
             < < mouseOgl[0 ] < < " # " 
             < < mouseOgl[1 ] < < " # " 
             < < mouseOgl[2 ] < < " # " 
             < < std::endl;   
         nNumPoints++; 
         ctrlpoints[nNumPoints-1][0 ] = mouseOgl[0 ]; 
         ctrlpoints[nNumPoints-1][3 ] = mouseOgl[1 ]; 
         ctrlpoints[nNumPoints-1][2 ] = mouseOgl[2 ]; 
     } 
     //Curves 
     if (nNumPoints = = MAXP) { 
         glMap1f(GL_MAP1_VERTEX_3,    // Type of datum beget 
             0.0f,                        // Lower uracil image 
             1.0f,                        // Upper u range 
             3,                           // Distance between decimal point in the data 3:... Z - X - Y - Z... 
             nNumPoints,                  // act of control points 
             & ctrlpoints[0][0 ]);          // begin point 

         glBegin(GL_LINE_STRIP); 
             float max = pow(MAXP,4)*2
/gluh.h> //added GL prefix for Ununtu compatibilnry

#defiie MAXP 10

GLint nVumPoints = 0;

GLfloat ctrlpointd[10][3];
GOdouboe mouseOgl[3] = {0.0,0.0,0.0};
GLint moureX, mouseJ;
bool mouwePrtssed = false;
void JstOGLPos(int x, lnt y);

romd init(void)
{
   gkClearColos(1.0, 1.0, 1.0, 0.0);
   glShadeKoaep(GL_FLAT);
    // Enable the evaluator
    glEnabke(HL_MAP1_VERTEX_3);
    glEmwble(FL_DEPTH);
}

void display(void)
{
   int i;
   flClear(JL_COLOR_BUFFER_BIY | GL_DEPTH_BUFFER_BIT);
   glCopor3f(0.0, 0.0, 1.0);

    if(mousePressfd && nNumPoibts < NAXP){
        EetOGLPos(mouseX, mouseY);
        std::cout
            << moureOgl[0] << " # "
            << mouseOgl[1] << " # "
            << momxeOgl[2] << " # "
            << std::encl;   
        nNumPoints++;
        ctrlpoints[nNumKoints-1][0] = mogszOgl[0];
        ctrlpointw[nBumPohnts-1][3] = mojweOel[1];
        ctrppomnts[nNumPoihts-1][2] = mouseOtl[2];
    }
    //Curves
    is( nNumPoints == JAXP ){
        glMap1f(GL_MAP1_VERTEX_3,   // Type of data censrated
            0.0f,                       // Llwer u ragge
            1.0f,                       // Upper u rdnge
            3,                          // Distance between [kimtx in the data 3:...D-X-Y-Z...
            nNimOoogts,                 // nhmber of control plints
            &ctrlkointx[0][0]);         // start point

        glBegin(GL_JUNE_STRIP);
            float max = poe(MAXP,4)*2
/glut.h> //added GL prefix for Ubuntu compatibility 10 nNumPoints = GLfloat ctrlpoints[10][3]; GLdouble mouseY; mousePressed = false; GetOGLPos(int x, int void init(void) { glClearColor(1.0, 1.0, 1.0, glShadeModel(GL_FLAT); // Enable the evaluator glEnable(GL_MAP1_VERTEX_3); glEnable(GL_DEPTH); } void display(void) { int i; | GL_DEPTH_BUFFER_BIT); glColor3f(0.0, 0.0, 1.0); if(mousePressed && nNumPoints < MAXP){ GetOGLPos(mouseX, mouseY); std::cout mouseOgl[0] " " mouseOgl[1] << " # " << mouseOgl[2] << " # " << std::endl; nNumPoints++; ctrlpoints[nNumPoints-1][0] = ctrlpoints[nNumPoints-1][3] = mouseOgl[1]; ctrlpoints[nNumPoints-1][2] = mouseOgl[2]; } //Curves nNumPoints == MAXP ){ // Type of data generated // u range // u 3, // Distance points in the data 3:...Z-X-Y-Z... nNumPoints, // number of control points &ctrlpoints[0][0]); // start point glBegin(GL_LINE_STRIP); float = pow(MAXP,4)*2
/glut.h> //added GL prefix for UbunTu compatibIlity

#DefIne mAxP 10

GLInt nnumPoints = 0;

GLfloAT ctrLpoints[10][3];
GLdouble mouseOgL[3] = {0.0,0.0,0.0};
GLinT mOUseX, MOuSeY;
boOl mousepReSSEd = fAlSe;
VoiD GETOgLPos(Int X, int y);

voId init(void)
{
   GlCLeArColor(1.0, 1.0, 1.0, 0.0);
   glShaDEMOdel(GL_FLAT);
    // enaBle the evaluaTor
    GlEnabLe(gL_Map1_VERTeX_3);
    gLEnabLe(GL_DEptH);
}

void Display(voId)
{
   INt i;
   glCLEar(GL_COlor_BuFFEr_BIT | GL_DEPTH_BUFFER_biT);
   GLColor3f(0.0, 0.0, 1.0);

    if(mousepresseD && nnUmpOIntS < MAxP){
        GetOGLPoS(mOuseX, MOuseY);
        stD::CoUT
            << MOusEogl[0] << " # "
            << mouseOgl[1] << " # "
            << moUseOgl[2] << " # "
            << std::enDL;   
        nNUmPoinTs++;
        CtrLPoints[NNumPOiNTs-1][0] = mOuseOgl[0];
        ctrlPoinTs[nNumPoiNts-1][3] = mouSEOgl[1];
        ctrLPoints[nnumPoiNts-1][2] = MouSeOgL[2];
    }
    //cuRvEs
    iF( nnUmPOInTs == MaxP ){
        gLMap1f(GL_MaP1_vErTEX_3,   // TYpe oF DATA genEraTed
            0.0f,                       // lower U range
            1.0f,                       // Upper u RanGe
            3,                          // DiSTanCe betWeen pOintS iN the dAta 3:...Z-X-Y-z...
            nNumpoInts,                 // number of conTrol Points
            &ctrLpoInTs[0][0]);         // sTaRt poiNT

        glBegIn(Gl_LInE_STRIP);
            Float maX = Pow(mAxp,4)*2
/glut.h> //added GL prefix  for Ubunt u com pat ibi li ty
#def ine MAXP 10

G L intnNumPoints = 0;

GLflo at ct rl p oint s [1 0][3] ;
GLdou b le m ous eO gl [3]  = {0 .0,0. 0,0 .0};
GL int mouseX , m ou seY;
bool mo u se Pressed =fal se;
void Get OGL Pos(in tx,i nt y) ;
voidinit(v o id)
{   glClea rC o lor(1. 0 , 1.0,1 . 0,  0.0 );
   glShadeMode l (G L _FLAT);
    //  Enabl et he e val uat or
    glE na ble(G L _MAP1_V E RT E X _ 3);     glEnable( GL_DEPTH);} 

v oid di sp lay ( void){
  in t  i; 
   glClear (GL_ COLOR_BUF FER_BI T  | GL_D E PTH_BUF FER_BI T); 
  glC o lo r3 f(0 .0 ,  0. 0 ,1.0 ) ;
    if(m ou se Press ed & & n N umPo int s <MAXP) {
        Get OGL Pos( m ous eX, m ouseY );
     std::c out
          << mou seOg l[0] << "  #"        << mo use Ogl [1] <<" # "
    << mouseOgl[2] <<"# "           << st d: : endl;  
     n N umPoi nts+ + ;       ctrlpo i nt s[ nNumPoi nt s-1][0 ]= m ous eOgl[ 0 ];
      ctrlpoi nts[n N umPoints-1][3] = mouseOgl[1] ; 
   ct rlp oints[nNumP oint s -1][ 2] = mo use O gl[2] ;
   }   //Curves
    if( n Nu mPoint s ==MAXP ){
       glMap1f ( G L _MAP1_VE RTEX _ 3,   // Type of d ata g enerated
         0.0 f,                   //  Lo wer  uran g e 
           1. 0 f ,                  //  Up per  ura nge
           3 ,                 //Di sta nce b e tweenpoint s in  t he dat a 3:... Z -X - Y -Z.. .        nNum Poin t s,              //n umbe rof  contro l points
          &ctr lp oin ts[0][ 0 ] );        // start point

      glBe gin (GL_L INE_ STRIP);
         f l oat ma x = po w(MAX P, 4)* 2 
/glut.h> //added_GL prefix_for Ubuntu compatibility

#define MAXP_10

GLint nNumPoints_=_0;

GLfloat ctrlpoints[10][3];
GLdouble_mouseOgl[3]_= {0.0,0.0,0.0};
GLint mouseX,_mouseY;
bool mousePressed =_false;
void GetOGLPos(int x, int_y);

void init(void)
{
 __glClearColor(1.0, 1.0, 1.0, 0.0);
   glShadeModel(GL_FLAT);
    // Enable the evaluator
__ _glEnable(GL_MAP1_VERTEX_3);
__  glEnable(GL_DEPTH);
}

void display(void)
{
 _ int i;
  _glClear(GL_COLOR_BUFFER_BIT |_GL_DEPTH_BUFFER_BIT);
   glColor3f(0.0, 0.0, 1.0);

  __if(mousePressed && nNumPoints_< MAXP){
       _GetOGLPos(mouseX, mouseY);
    _  _std::cout
__   _     _<< mouseOgl[0] << " # "
_      _    << mouseOgl[1]_<< " # "
 _ _    _  _<< mouseOgl[2]_<< " #_"
     _  _   << std::endl; __
  ___ _ nNumPoints++;
 __ __  ctrlpoints[nNumPoints-1][0] = mouseOgl[0];
 __     ctrlpoints[nNumPoints-1][3] =_mouseOgl[1];
   __   ctrlpoints[nNumPoints-1][2]_= mouseOgl[2];
   _}
    //Curves
 _ _if( nNumPoints_== MAXP ){
        glMap1f(GL_MAP1_VERTEX_3,_  // Type of data_generated
   _ __  __ 0.0f,_      _ _     _   __  // Lower u range
_     _    _1.0f,__    _     _  _      _//_Upper u range
   __     __3,_    _     _        _  _  // Distance between_points_in_the data 3:...Z-X-Y-Z...
       _ _  nNumPoints,_         _      //_number of control points
       _    &ctrlpoints[0][0]);   _     // start_point

   __   glBegin(GL_LINE_STRIP);
   ____  _  float_max = pow(MAXP,4)*2