Q: Draw 2D thick arc using polygon in OpenGL I want to draw a thick Arc(something like colored segment of analog dial) using polygon. For that i have added vertices in polygon and its working fine for the outer circumference BUT its joining the ends for inner circumference(the concave side). 
The same logic works fine if I add those vertices in Line, but that creates an empty/non-filled arc.
My logic of adding vertices is :
    for( float i = m_segmentVertex.size() - 1; i < vCount; i++ )
        {
            float x1 = (m_segmentVertex[ i ].x ) * cosA - m_segmentVertex[ i ].y * sinA;
            float y1 = (m_segmentVertex[ i ].x ) * sinA + m_segmentVertex[ i ].y * cosA;
            addVertex( vec3( x1, y1, 0.0f ) );
        }


A: Be aware that GL_POLYGON only works with convex polygons.
You'll have to triangulate concave polygons.

A: Try using a triangle fan and making the center of your dial the first point.
Possibly addVertex( vec3( 0.0f, 0.0f, 0.0f ) ); before your loop.
I'd also recommend making i an int or unsigned int, a float here doesn't make sense.

A: This is how I created the polygon dynamically by triangulating it :
//create thick colored segments
void CreateArcMesh( float sAngle, float eAngle, vec4 color, int thickness, int radius )
{
    ObjectMeshDynamic meshObj = new ObjectMeshDynamic();
    vec3 vertex[0];
    float dAngle = ( ( eAngle - sAngle ) / ( VERTEX_COUNT / 2.0f ) );
    float cosA = cos( DEG2RAD * dAngle );
    float sinA = sin( DEG2RAD * dAngle );

    meshObj.setMaterial( "material_base", "*" );
    meshObj.setProperty( "surface_base", "*" );
    meshObj.setMaterialParameter( "diffuse_color", color, 0 );
    //Add the material on both side as the indices for Triangle strip start from last vertex added
    Material material = meshObj.getMaterialInherit(0);
    material.setTwoSided( 1 );
    meshObj.addTriangleStrip( VERTEX_COUNT + 2 );

    vec3 startPos = vec3( radius * cos( DEG2RAD * sAngle ), radius * sin( DEG2RAD * sAngle ), 0.0f );
    vertex.append( startPos );

    vec3 secondPos = vec3( ( radius - thickness ) * cos( DEG2RAD * sAngle ), ( radius - thickness ) * sin( DEG2RAD * sAngle ), 0.0f );
    vertex.append( secondPos );

    float x1 = startPos.x * cosA - startPos.y * sinA;
    float y1 = startPos.x * sinA + startPos.y * cosA;
    vertex.append( vec3( x1, y1, 0.0f ) );

    x1 = secondPos.x * cosA - secondPos.y * sinA;
    y1 = secondPos.x * sinA + secondPos.y * cosA;
    vertex.append( vec3( x1, y1, 0.0f ) );

    forloop( int k = 0 ; VERTEX_COUNT + 2 )
    {
        x1 = ( vertex[ vertex.size() - 2 ].x ) * cosA - vertex[ vertex.size() - 2 ].y * sinA;
        y1 = ( vertex[ vertex.size() - 2 ].x ) * sinA + vertex[ vertex.size() - 2 ].y * cosA;

        vertex.append( vec3( x1, y1, 0.0f ) );
        meshObj.addVertex( vertex[k] );
    }

    vertex.clear();
    meshObj.updateBounds();
    meshObj.flush();
}

