Jump to content
  • Advertisement
Sign in to follow this  
LilBudyWizer

Why doesn't glEvalMesh2 draw anything (Resolved)

This topic is 4612 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I using the following code:
void DrawLid(void)
{
    GLfloat CurrCtrl[4][4][3];

    glPushAttrib(GL_EVAL_BIT);

        glEnable(GL_MAP2_VERTEX_3);

        for (int i = 0; i < LIDPATCHS; i++)
        {
            LoadCtrl(&Lid[0][0], &CurrCtrl[0][0][0]);

// Draw control box

            glBegin(GL_LINES);
                for (int s = 0; s < 3; s++)
                {
                    for (int t = 0; t < 4; t++)
                    {
                        glVertex3fv((GLfloat *) &CurrCtrl[s][t][0]);
                        glVertex3fv((GLfloat *) &CurrCtrl[s+1][t][0]);
                    }
                }
            glEnd();

            glBegin(GL_LINES);
                for (int s = 0; s < 3; s++)
                {
                    for (int t = 0; t < 4; t++)
                    {
                        glVertex3fv((GLfloat *) &CurrCtrl[t][s][0]);
                        glVertex3fv((GLfloat *) &CurrCtrl[t][s+1][0]);
                    }
                }
            glEnd();

            glMap2f(GL_MAP2_VERTEX_3,
                    0.0, 1.0,  3, 4,
                    0.0, 1.0, 12, 4,
                    (GLfloat *) &CurrCtrl[0][0][0]);

            glMapGrid2f(20, 0.0, 1.0, 20, 0.0, 1.0);

// Draw manually

            glBegin(GL_TRIANGLE_STRIP);
                for (int s = 0; s < 20; s++)
                    for (int t = 0; t <= 20; t++)
                    {
                        glEvalCoord2f((GLfloat) s / 20.0, (GLfloat) t / 20.0);
                        glEvalCoord2f((GLfloat) (s+1) / 20.0, (GLfloat) t / 20.0);
                    }
            glEnd();

// Draw using mesh

            glEvalMesh2(GL_LINES, 0, 20, 0, 20);
        }

    glPopAttrib();
}


Everything draws fine except that final glEvalMesh2 command. I get the control box and even the mesh from manually using glEvalCoord2f, but not by using glEvalMesh2. If I take out the glEvalCoord2f calls I get only the control box. I'm totally baffled. Resolved: It's GL_LINE, not GL_LINES [Edited by - LilBudyWizer on November 4, 2005 12:29:20 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!