Exemplo n.º 1
0
void display(void)
{
	int i;

	glClear(GL_COLOR_BUFFER_BIT);
	glColor3f(1.0, 1.0, 1.0);

	glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]);// first curve
	glEnable(GL_MAP1_VERTEX_3);
	glBegin(GL_LINE_STRIP);
	for (i = 0; i <= 30; i++)
		glEvalCoord1f((GLfloat)i / 30.0);
	glEnd();

	glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[3][0]);// secconed curve
	glEnable(GL_MAP1_VERTEX_3);
	glBegin(GL_LINE_STRIP);
	for (i = 0; i <= 30; i++)
		glEvalCoord1f((GLfloat)i / 30.0);
	glEnd();

	/* The following code displays the control points as dots. */
	glPointSize(5.0);
	glColor3f(1.0, 1.0, 0.0);
	glBegin(GL_POINTS);
	for (i = 0; i < 7; i++){
		glVertex3fv(&ctrlpoints[i][0]);
	}
	glEnd();
	glFlush();
}
Exemplo n.º 2
0
void ReDraw(void)
{
	int i;
	glClear(GL_COLOR_BUFFER_BIT);

	glMap1f(GL_MAP1_VERTEX_3,	// 产生的数据类型
	0.0f,						// 参数最小值
	100.0f,						// 参数最大值
	3,							// 控制点数据顶点之间的数目
	nNumPoints,					// 控制点数目
	&ctrlPoints[0][0]);			// 保存控制点的数组

	//启动求职器
	glEnable(GL_MAP1_VERTEX_3);

	// 将曲线上的点连接起来
	glBegin(GL_LINE_STRIP);
		for(i = 0; i <= 100; i++)
		{
			// 计算当前曲线点的坐标
			glEvalCoord1f((GLfloat) i); 
		}
	glEnd();

//	glMapGrid1d(100,0.0,100.0);
//	glEvalMesh1(GL_LINE,0,100);

	DrawPoints();
	glutSwapBuffers();
}
Exemplo n.º 3
0
void BezierCurve::draw()
{
    int i;
    glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]);

    //glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0, 1.0, 1.0);
    glBegin(GL_LINE_STRIP);
    for (i = 0; i <= 30; i++)
        glEvalCoord1f((GLfloat) i/30.0);
    glEnd();
    
    /* The following code displays the control points as dots. */
    glPointSize(5.0);
    glColor3f(1.0, 0.0, 0.0);
    glBegin(GL_POINTS);
    for (i = 0; i < 4; i++)
        glVertex3fv(&ctrlpoints[i][0]);
    glEnd();
    
    glColor3f(0.0, 0.5, 1.0);
    glBegin(GL_LINE_STRIP);
    for (i = 0; i<4; i++) {
        glVertex3fv(&ctrlpoints[i][0]);
    }
    glEnd();
}
Exemplo n.º 4
0
void  GrEdge::draw()
{
	GLfloat heightCoef	= Manager::getInstance()->getHeightCoef();
	GLfloat curvewidth	= Manager::getInstance()->getCurveWidthCoef();


	GLfloat ctrlpoints[4][3] = {
		{ _sx, _sy, _srh*heightCoef+heightCoef/2}, { _sx, _sy, _srh*heightCoef*2},
		{ _tx, _ty, _trh*heightCoef*2}, {_tx, _ty, _trh*heightCoef+heightCoef/2}};


	int ncl = 4;
	glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, ncl, &ctrlpoints[0][0]);
	glEnable(GL_MAP1_VERTEX_3);


	// curva

	glColor4f(_r, _g, _b, _a);
	glLineWidth(curvewidth);
	glBegin(GL_LINE_STRIP);
	for (int i = 0; i <= 30; i++)
		glEvalCoord1f((GLfloat) i/30.0);
	glEnd();


}
Exemplo n.º 5
0
void fdrawbezier(float vec[4][3])
{
	float dist;
	float curve_res = 24, spline_step = 0.0f;
	
	dist = 0.5f * ABS(vec[0][0] - vec[3][0]);
	
	/* check direction later, for top sockets */
	vec[1][0] = vec[0][0] + dist;
	vec[1][1] = vec[0][1];
	
	vec[2][0] = vec[3][0] - dist;
	vec[2][1] = vec[3][1];
	/* we can reuse the dist variable here to increment the GL curve eval amount*/
	dist = 1.0f / curve_res;
	
	cpack(0x0);
	glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, vec[0]);
	glBegin(GL_LINE_STRIP);
	while (spline_step < 1.000001f) {
#if 0
		if (do_shaded)
			UI_ThemeColorBlend(th_col1, th_col2, spline_step);
#endif
		glEvalCoord1f(spline_step);
		spline_step += dist;
	}
	glEnd();
}
Exemplo n.º 6
0
/////////////////////////////////////////////////////////
// render
//
/////////////////////////////////////////////////////////
void curve :: render(GemState *state)
{
  if(m_numVertices<1) {
    return;
  }

  TexCoord*texCoords=NULL;
  int texType=0;
  int texNum=0;
  bool lighting=false;
  state->get(GemState::_GL_TEX_COORDS, texCoords);
  state->get(GemState::_GL_TEX_TYPE, texType);
  state->get(GemState::_GL_TEX_NUMCOORDS, texNum);

  if(m_drawType==GL_DEFAULT_GEM) {
    m_drawType=GL_LINE_STRIP;
  }
  glNormal3f(0.0f, 0.0f, 1.0f);
  glLineWidth(m_linewidth);
  if(texType) {
    switch(texNum) {
    default:
      m_texCoords[0][0]=texCoords[0].s;
      m_texCoords[0][1]=texCoords[0].t;
      m_texCoords[1][0]=texCoords[1].s;
      m_texCoords[1][1]=texCoords[1].t;
      m_texCoords[2][0]=texCoords[2].s;
      m_texCoords[2][1]=texCoords[2].t;
      m_texCoords[3][0]=texCoords[3].s;
      m_texCoords[3][1]=texCoords[3].t;
      break;
    case 0:
    case 1:
    case 2:
    case 3:
      m_texCoords[0][0]=0.f;
      m_texCoords[0][1]=0.f;
      m_texCoords[1][0]=1.f;
      m_texCoords[1][1]=0.f;
      m_texCoords[2][0]=1.f;
      m_texCoords[2][1]=1.f;
      m_texCoords[3][0]=0.f;
      m_texCoords[3][1]=1.f;
      break;
    }

    glEnable(GL_MAP1_TEXTURE_COORD_2);
    glMap1f(GL_MAP1_TEXTURE_COORD_2, 0,   1,   2, m_numVertices,
            &m_texCoords[0][0]);
  }
  glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, m_numVertices, &(m_vert[0][0]));
  glEnable(GL_MAP1_VERTEX_3);
  glBegin(m_drawType);
  for (int n = 0; n <= m_resolution; n++) {
    glEvalCoord1f(static_cast<GLfloat>(n)/static_cast<GLfloat>(m_resolution));
  }
  glEnd();
  glLineWidth(1.0);
}
Exemplo n.º 7
0
static void hugsprim_glEvalCoord1f_7(HugsStackPtr hugs_root)
{
    HsFloat arg1;
    arg1 = hugs->getFloat();
    glEvalCoord1f(arg1);
    
    hugs->returnIO(hugs_root,0);
}
Exemplo n.º 8
0
void MyOpenGLWeight::draw()
{
    static const GLfloat P1[3] = {0.0, -1.0, 2.0};
    static const GLfloat P2[3] = {1.0, -1.0, -2.0};
    static const GLfloat P3[3] = {0.5, 1.0, 1.5};
    static const GLfloat P4[3] = {-1.0, 0.0, -1.5};

    static const GLfloat * const coords[4][3] = {
        {P1, P2, P3},
        {P1, P3, P4},
        {P1, P4, P2},
        {P2, P4, P3},
    };

    glLoadIdentity();
    glTranslatef(0.0, 0.0, -10);
    glRotatef(rotationX, 1.0, 0.0, 0.0);
    glRotatef(rotationY, 0.0, 1.0, 0.0);
    glRotatef(rotationZ, 0.0, 0.0, 1.0);

    glBegin(GL_LINES);
    float s = 3;
    glColor3f(255.0, 0, 0);
    glVertex3f( 0, 0, 0 );
    glVertex3f( s, 0, 0 );
    glColor3f(0, 255.0, 0);
    glVertex3f( 0, 0, 0 );
    glVertex3f( 0, s, 0 );
    glColor3f(0, 0, 255.0);
    glVertex3f( 0, 0, 0 );
    glVertex3f( 0, 0, s );
    glEnd();

    glBegin(GL_LINE_STRIP);
        for (int i = 0; i <= 30; i++)
           glEvalCoord1f((GLfloat) i/30.0);
     glEnd();
     /* The following code displays the control points as dots. */
     glPointSize(5.0);
     glColor3f(1.0, 1.0, 0.0);
     glBegin(GL_POINTS);
        for (int i = 0; i < 4; i++)
           glVertex3fv(&ctrlpoints[i][0]);
     glEnd();



//    for(int i = 0; i < 4; ++i)
//    {
//        glBegin(GL_TRIANGLES);
//        glColor3f(faceColor[i].redF(), faceColor[i].greenF(), faceColor[i].blueF());
//        for(int j = 0; j < 4; ++j)
//            glVertex3f(coords[i][j][0], coords[i][j][1], coords[i][j][2]);
//        glEnd();
//    }

}
Exemplo n.º 9
0
Arquivo: api_eval.c Projeto: aosm/X11
void _mesa_EvalPoint1( GLint i )
{
   GET_CURRENT_CONTEXT( ctx );
   GLfloat du = ((ctx->Eval.MapGrid1u2 - ctx->Eval.MapGrid1u1) /
		 (GLfloat) ctx->Eval.MapGrid1un);
   GLfloat u = i * du + ctx->Eval.MapGrid1u1;

   glEvalCoord1f( u );
}
Exemplo n.º 10
0
GLvoid display()
{
    glClear(GL_COLOR_BUFFER_BIT);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glRotated(orientation_angle, orientation_axis[0], orientation_axis[1], orientation_axis[2]);
    glTranslated(0.0, 0.0, -5.0);
    glRotated(location_angle, location_axis[0], location_axis[1], location_axis[2]);
    glTranslated(0.0, 0.0, 0.0);

    glColor3f(1.0, 1.0, 1.0);
    glMap1d(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]);
    glBegin(GL_LINE_STRIP);
    for (GLint i = 0; i <= 30; i++)
        glEvalCoord1f((GLdouble) i/30.0);
    glEnd();
    glMap1d(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[3][0]);
    glBegin(GL_LINE_STRIP);
    for (GLint j = 0; j <= 30; j++)
        glEvalCoord1f((GLdouble) j/30.0);
    glEnd();

    /* The following code displays the control points as dots. */
    glPointSize(5.0);
    glBegin(GL_POINTS);
    if (-1 != selectedPointIndex)
    {
        glColor3f(0.0, 1.0, 1.0);
        glVertex3dv(&ctrlpoints[selectedPointIndex][0]);
    }
    glColor3f(1.0, 1.0, 0.0);
    for (GLint i = 0; i < 7; i++)
    {
        if (i != selectedPointIndex)
        {
            glVertex3dv(&ctrlpoints[i][0]);
        }
    }
    glEnd();
    glFlush();
}
Exemplo n.º 11
0
void GLEngine::drawCurve(GLfloat *ctrlpoints, int stride, int order, float r,
		float g, float b) {

	glColor3f(r, g, b);
	glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, stride, order, ctrlpoints);

	glBegin(GL_LINE_STRIP);
	for (int i = 0; i <= 30; i++)
		glEvalCoord1f((GLfloat) i / 30.0);
	glEnd();
}
Exemplo n.º 12
0
void Bezier::drawVertexMode()
{
	float ctrlPoints[m_vertexManager->size()][3];
	for(int i = 0; i < m_vertexManager->size() ; i++)
	{
		ctrlPoints[i][0] = m_vertexManager->at(i)->x;
		ctrlPoints[i][1] = m_vertexManager->at(i)->y;
		ctrlPoints[i][2] = m_vertexManager->at(i)->z;
	}
	glMap1f(GL_MAP1_VERTEX_3, 0.0f, 100.0f, 3, m_vertexManager->size(), &ctrlPoints[0][0]);
	glEnable(GL_MAP1_VERTEX_3);
	glBegin(GL_LINE_STRIP);
	{
		for(int i = 0 ; i <= 100 ; i++)
		{
			glEvalCoord1f(i);
		}
	}
	glEnd();

	glColor3f(1.0, 1.0, 1.0);
	int i = 0;
	glPointSize(8);
	glBegin(GL_POINTS);
	while(i != m_vertexManager->size())
	{
		if(m_vertexManager->at(i)->getSelection())
		{
			glColor3f(0.0, 1.0, 0.0);
		}
		else
		{
			glColor3f(1.0, 1.0, 1.0);
		}
		glVertex3f(m_vertexManager->at(i)->x, m_vertexManager->at(i)->y, m_vertexManager->at (i)->z);
		i++;
	}
	glEnd();

	glColor3f(1.0, 1.0, 1.0);
	glBegin(GL_LINE_STRIP);
	i = 0;
	while(i != m_vertexManager->size())
	{
		glVertex3f(m_vertexManager->at(i)->x, m_vertexManager->at(i)->y, m_vertexManager->at (i)->z);
		i++;
	}
	glEnd();
}
Exemplo n.º 13
0
// Called to draw scene
void RenderScene(void)
{
    int i;

    // Clear the window with current clearing color
    glClear(GL_COLOR_BUFFER_BIT);

    // Sets up the bezier
    // This actually only needs to be called once and could go in
    // the setup function
    glMap1f(GL_MAP1_VERTEX_3,	// Type of data generated
            0.0f,						// Lower u range
            100.0f,						// Upper u range
            3,							// Distance between points in the data
            nNumPoints,					// number of control points
            &ctrlPoints[0][0]);			// array of control points

    // Enable the evaluator
    glEnable(GL_MAP1_VERTEX_3);

    // Use a line strip to "connect-the-dots"
    glBegin(GL_LINE_STRIP);
    for(i = 0; i <= 100; i++)
    {
        // Evaluate the curve at this point
        glEvalCoord1f((GLfloat) i);
    }
    glEnd();

    // Use higher level functions to map to a grid, then evaluate the
    // entire thing.
    // Put these two functions in to replace above loop

    // Map a grid of 100 points from 0 to 100
    //glMapGrid1d(100,0.0,100.0);

    // Evaluate the grid, using lines
    //glEvalMesh1(GL_LINE,0,100);

    // Draw the Control Points
    DrawPoints();

    // Flush drawing commands
    glutSwapBuffers();
}
Exemplo n.º 14
0
//-*****************************************************************************
void ICurvesDrw::draw( const DrawContext &iCtx )
{
    if ( ! ( m_positions && m_nVertices ) ) { return; }

    const V3f *points = m_positions->get();
    const Alembic::Util::int32_t *nVertices = m_nVertices->get();

    glDisable( GL_LIGHTING );

    glColor3f( 1.0, 1.0, 1.0 );
    glEnable( GL_POINT_SMOOTH );
    glPointSize( 1.0 );
    glLineWidth( 1.0 );

    for ( size_t currentCurve = 0, currentVertex = 0 ; currentCurve < m_nCurves ;
          ++currentCurve )
    {

        m_curvePoints.clear();
        for ( size_t currentCurveVertex = 0 ;
              currentCurveVertex < ( size_t ) ( nVertices[currentCurve] );
              ++currentCurveVertex, ++currentVertex )
        {
            m_curvePoints.push_back(&points[currentVertex]);
        }

        glMap1f( GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4,
                 (const GLfloat *)m_curvePoints[0] );
        glEnable( GL_MAP1_VERTEX_3 );

        glBegin( GL_LINE_STRIP );
        for ( size_t currentSegment = 0 ; currentSegment < 30 ;
              ++currentSegment )
        {
            glEvalCoord1f(
                static_cast<GLfloat>( currentSegment ) / static_cast<GLfloat>( 30.0f ) );
        }
        glEnd();
    }

    glEnable( GL_LIGHTING );

    IObjectDrw::draw( iCtx );
}
Exemplo n.º 15
0
void display(void)
{
   int i;

   glClear(GL_COLOR_BUFFER_BIT);
   glColor3f(1.0, 1.0, 1.0);
   glBegin(GL_LINE_STRIP);
      for (i = 0; i <= 30; i++) 
         glEvalCoord1f((GLfloat) i/30.0);
   glEnd();
   /* The following code displays the control points as dots. */
   glPointSize(5.0);
   glColor3f(1.0, 1.0, 0.0);
   glBegin(GL_POINTS);
      for (i = 0; i < 4; i++) 
         glVertex3fv(&ctrlpoints[i][0]);
   glEnd();
   glFlush();
}
Exemplo n.º 16
0
void Sample_12_1::draw()
{
	int i;
	const int p = 30;

	glClear(GL_COLOR_BUFFER_BIT);
	glColor3f(1.0, 1.0, 1.0);
	glBegin(GL_LINE_STRIP);
	for (i = 0; i <= p; i++)
		glEvalCoord1f((GLfloat) i/float(p) );
	glEnd();
	/* The following code displays the control points as dots. */
	glPointSize(5.0);
	glColor3f(1.0, 1.0, 0.0);
	glBegin(GL_POINTS);
	for (i = 0; i < 4; i++)
		glVertex3fv(&ctrlpoints_12_1[i][0]);
	glEnd();
}
Exemplo n.º 17
0
void myDisplay()
{
	glClear(GL_COLOR_BUFFER_BIT);
	glColor3f(1, 1, 1);
	glBegin(GL_LINE_STRIP);
	for (int i = 0; i <= 30; i++)
	{
		glEvalCoord1f((GLfloat)i / 30.0);
	}
	glEnd();
	glPointSize(5);
	glColor3f(1, 1, 0);
	glBegin(GL_POINTS);
	for (int i = 0; i < 4; i++)
	{
		glVertex3fv(&ctrlpoint[i][0]);
	}
	glEnd();
	glFlush();
}
Exemplo n.º 18
0
void Bezier::drawObjectModeSelect()
{
	glClear(GL_DEPTH_BUFFER_BIT);//This must be exist.For drawing in same z depth.
	float ctrlPoints[m_vertexManager->size()][3];
	for(int i = 0; i < m_vertexManager->size() ; i++)
	{
		ctrlPoints[i][0] = m_vertexManager->at(i)->x;
		ctrlPoints[i][1] = m_vertexManager->at(i)->y;
		ctrlPoints[i][2] = 0.0;
	}
	glMap1f(GL_MAP1_VERTEX_3, 0.0f, 100.0f, 3, m_vertexManager->size(), &ctrlPoints[0][0]);
	glEnable(GL_MAP1_VERTEX_3);
	glBegin(GL_LINE_STRIP);
	{
		for(int i = 0 ; i <= 100 ; i++)
		{
			glEvalCoord1f(i);
		}
	}
	glEnd();
}
Exemplo n.º 19
0
void BasicObject::bezierLine()
{
	GLfloat ctrlPts [4][3] = { {-50.0, 40.0, 0.0}, {-10.0, 70.0, 0.0},{10.0, -70.0, 0.0}, {80.0, 40.0, 0.0} };
	glMap1f (GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, *ctrlPts);
    glEnable (GL_MAP1_VERTEX_3);
    GLint k;
    glColor3f (0.0, 0.0, 1.0);           
    glBegin (GL_LINE_STRIP); //绘制Bezier  曲线          
        for (k = 0; k <= 50; k++)     glEvalCoord1f (GLfloat (k) / 50.0);
    glEnd ();

    glColor3f (1.0, 0.0, 0.0); glPointSize (5.0); //绘制控制点
    glBegin (GL_POINTS);                 
       for (k = 0; k < 4; k++)    glVertex3fv (ctrlPts [k]);
    glEnd ();
    //绘制控制多边形
    glColor3f (0.0, 1.0, 0.0);  glLineWidth (2.0);                   
    glBegin (GL_LINE_STRIP);                 
         for (k = 0; k < 4; k++)  glVertex3fv (&ctrlPts [k][0]);
    glEnd ();
	glLineWidth (1.0);
}
void display(void){
    int i;
    glClear(GL_COLOR_BUFFER_BIT);
    switch(spline){
        case BEZIER:
            glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, nVertices, &vertices[0][0]);
            glBegin(GL_LINE_STRIP);
            for (i = 0; i <= 30; i++){
              glEvalCoord1f((GLfloat) i/30.0);
            }
            glEnd();
        break;
        case NURBS:
            gluBeginCurve(nc);

                gluNurbsCurve(nc, nNos, nos, 3, &vertices[0][0], 4, GL_MAP1_VERTEX_3);

            gluEndCurve(nc);
        break;
    }

    glPointSize(5.0);
    glColor3f(1.0, 1.0, 0.0);
    glBegin(GL_LINE_STRIP);
    for (i = 0; i < nVertices; i++) 
        glVertex3fv(&vertices[i][0]);
    glEnd();
    
    glColor3f(1.0, 0.0, 0.0);
    glBegin(GL_POINTS);
    for (i = 0; i < nVertices; i++) 
        glVertex3fv(&vertices[i][0]);
    glEnd();
    glColor3f(1.0, 1.0, 1.0);

    glFlush();
    glutSwapBuffers();
}
Exemplo n.º 21
0
void NurbsCurve::draw() {
	
	// This fucntion could have problems if the number of points is different in the interpolator e nurbs curve
	#ifdef DEBUG
		cout << "NUMBER OF POINTS : " << numberOfPoints << endl;
	#endif
	
	if ( numberOfPoints == 0 ) cerr << "Not points defined in Nurbs Curve" << endl;
	
	glMap1f(GL_MAP1_VERTEX_3,0,100,3,numberOfPoints,controlPoint);
		
	glEnable(GL_MAP1_VERTEX_3);
	
	glBegin(GL_LINE_STRIP);
		
	float c;
	for(c=0;c<=100;c++) {
		glEvalCoord1f(c);
	}
	
	glEnd();
	
}
Exemplo n.º 22
0
/**************************Desenho do mundo************************************/
void display(void){
 
  int i;
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f (1.0, 1.0, 1.0);
 
//girar o objeto
 glRotatef((GLfloat) eixoxObjeto, 1.0, 0.0, 0.0);
 glRotatef((GLfloat) eixoyObjeto, 0.0, 1.0, 0.0);
 glRotatef((GLfloat) eixozObjeto, 0.0, 0.0, 1.0);
 
 

//  glPushMatrix();
 
  /*parte da frentde do barquinho*/
  glBegin(GL_POLYGON);
  glColor3f (0.0, 1.0, 0.0);// VERDE
  glVertex3f(15.0, 0.0,0.0);
  glVertex3f(5.0, 5.0,0.0);
  glVertex3f(40.0, 5.0,0.0);
  glVertex3f(30.0, 0.0,0.0);
  glEnd();
 
  /*parte de trás do barquinho*/
  glBegin(GL_POLYGON);
  glColor3f (0.0, 1.0, 0.0);// AMARELO
  glVertex3f(15.0, 0.0,-10.0);
  glVertex3f(5.0, 5.0,-10.0);
  glVertex3f(40.0, 5.0,-10.0);
  glVertex3f(30.0, 0.0,-10.0);
  glEnd();
 
   /*parte de baixo do barquinho*/
  glBegin(GL_POLYGON);
  glColor3f (0.0, 1.0, 0.0);// VERDE
  glVertex3f(15.0, 0.0,-10.0);
  glVertex3f(15.0, 0.0,0.0);
  glVertex3f(30.0, 0.0,0.0);
  glVertex3f(30.0, 0.0,-10.0);
  glEnd();
 
 
 /*parte esquerda do barquinho*/
  glBegin(GL_POLYGON);
  glColor3f (0.0, 1.0, 1.0);// AZUL
  glVertex3f(15.0, 0.0,0.0);
  glVertex3f(15.0, 0.0,-10.0);
  glVertex3f(5.0, 5.0,-10.0);
  glVertex3f(5.0, 5.0,0.0);
  glEnd();

 
 /*parte direita do barquinho*/
  glBegin(GL_POLYGON);
  glColor3f (0.0, 1.0, 0.0);//
  glVertex3f(30.0, 0.0,0.0);
  glVertex3f(30.0, 0.0,-10.0);
  glVertex3f(40.0, 5.0,-10.0);
  glVertex3f(40.0, 5.0,0.0);
  glEnd();
 
/**************************PARTE DO SALVA VIDAS**************************************/

   /* PRIMEIRO salva Vidas do barquinho*/
   glPushMatrix();
        glColor3f (1.5, 0.5, 0.5);// NAO SEI Q COR EH ESSA
        glTranslated(15.0,3.5,-6);
        glutSolidTorus(0.5,1,20,20);
    glPopMatrix();
    
    /* SEGUNDO salva Vidas do barquinho*/
   glPushMatrix();
        glColor3f (1.5, 0.5, 0.5);// NAO SEI Q COR EH ESSA
        glTranslated(20.0,3.5,-6);
        glutSolidTorus(0.5,1,20,20);
    glPopMatrix();
    
    /* TERCEIRO salva Vidas do barquinho*/
   glPushMatrix();
        glColor3f (1.5, 0.5, 0.5);// NAO SEI Q COR EH ESSA
        glTranslated(25.0,3.5,-6);
        glutSolidTorus(0.5,1,20,20);
    glPopMatrix();
   
   /* QUARTO salva Vidas do barquinho*/
   glPushMatrix();
        glColor3f (1.5, 0.5, 0.5);// NAO SEI Q COR EH ESSA
        glTranslated(30.0,3.5,-6);
        glutSolidTorus(0.5,1,20,20);
    glPopMatrix();

  /*************************Mastro do barquinho***************************/
  glBegin(GL_LINES);
  glColor3f (0.0, 0.0, 0.0);// PRETO
  glVertex3f(23.0, 5.0,0.0);
  glVertex3f(23.0, 15.0,0.0);
  glEnd();
   

  /*************************Bandeirinha do barquinho********************************/
     glPushMatrix();
          glColor3f (0.5, 0.7, 1.0);
          glTranslatef(23.0,12.0,0.0);
          glRotatef(-270,0,1,0);
          glScalef(1.0,3.0,1.0);
          glutSolidCone(1.0,5.0, 15.0, 15.0);        
          glPopMatrix();
 
  /***************************desenho de mar*******************************************/
  glBegin(GL_LINE_STRIP);
  glColor3f (0.0, 0.0, 1.0);
      for (i = 0; i <= 30; i++)
         glEvalCoord1f((GLfloat) i/30.0);
   glEnd();
  /* `mostragem dos pontos de controle  */
  glPointSize(5.0);
   glColor3f(0.0, 0.0, 1.0);
   
   glBegin(GL_POINTS);
      for (i = 0; i < 4; i++)
         glVertex3fv(&ctrlpoints[i][0]);
   glEnd();
   
   
  desenhaSol();
 
  glFlush();
  glutSwapBuffers();
}
Exemplo n.º 23
0
/////////////////////////////////////////////////////////
// Render
//
void GEMglEvalCoord1f :: render(GemState *state)
{
  glEvalCoord1f (u);
}
Exemplo n.º 24
0
M(void, glEvalCoord1f, jfloat u) {
	glEvalCoord1f(u);
}
Exemplo n.º 25
0
Arquivo: api_eval.c Projeto: aosm/X11
void _mesa_EvalCoord1fv( const GLfloat *u )
{
   glEvalCoord1f( u[0] );
}
Exemplo n.º 26
0
// eval
void glEvalCoord1d(GLdouble u) {
    glEvalCoord1f(u);
}
Exemplo n.º 27
0
void glEvalCoord1fv(const GLfloat *v) {
    glEvalCoord1f(v[0]);
}