Advertisement

12.10.2005 at 03:48AM PST, ID: 21660069
[x]
Attachment Details

GL_TRIANGLE_STRIP

Asked by xargon_123 in OpenGL Graphics & Game Programming

Tags: gl_triangle_strip

Hi everyone,

I am drawing some vertices around a primitive using glDrawArrays like:

glDrawArrays(GL_TRIANGLE_STRIP, 0, verticesArray);

However, the primitive drawn is very jagged and looks terrible. I tried
enabling anti-aliasing, but that does not help. I tried increasing the
number of points in the vertices array, but it still does not make a
difference. I was wondering if someone can help me with it. Here is
some sample code:

#define M_PI 3.1415926535897932f
int GUI_div = 20;

divinc = M_PI/GUI_div;

        // calculate coords
        for(i = 0, angle = 0.0; angle < M_PI+.01; i++, angle += divinc)
        {
                // inside
                pos[i][0] = (float)sin(angle) + button->width*0.5f;
                pos[GUI_div+GUI_div+1-i][0] = -pos[i][0];
                pos[GUI_div+GUI_div+1-i][1] = pos[i][1] = (float)cos(angle);
                pos[GUI_div+GUI_div+1-i][2] = pos[i][2] = 0.0f;
        }

    glEnable(GL_LINE_SMOOTH);
        glBegin(GL_TRIANGLE_FAN);
        for(i=0; i<GUI_div+GUI_div+2; i++)
        {
                glTexCoord2fv(tpos[i]);
                glVertex3fv(pos[i]);
        }
        glEnd();
    glDisable(GL_LINE_SMOOTH);

increasing the GUI_DIV parameter does not seem to have any effect,
neither does the anti-aliasing command...

Would appreciate any help :)

Thanks

-L Start Free Trial
[+][-]12.10.2005 at 04:38AM PST, ID: 15458373

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.12.2005 at 08:11AM PST, ID: 15467227

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: OpenGL Graphics & Game Programming
Tags: gl_triangle_strip
Sign Up Now!
Solution Provided By: davebytes
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32