🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.graphics.api.opengl
1 messages
1 total messages Started by Justin Thu, 18 Feb 1999 00:00
Bezier curve
#97
Author: Justin
Date: Thu, 18 Feb 1999 00:00
42 lines
1826 bytes
Hi.. It's the second time I post for my problem, I'll try to be more
specific.

I have to draw a bezier curve with control points entered with the
mouse. I have an array of those points. They are xyz coords. This is
working fine. It's when I want to compute the the bezier that it does
not work. Here is how I'm doing it:

    glClear(GL_COLOR_BUFFER_BIT);
    glPointSize(3.0f);

    glMap1f(GL_MAP1_VERTEX_3, 0.0f, 100.0f, 3, ptsCnt,
&ctrlPoints[0][0]);
    glEnable(GL_MAP1_VERTEX_3);
    glMapGrid1d(100, 0.0, 100.0);
    glEvalMesh1(GL_LINE, 0, 100);

    glBegin(GL_POINTS);
        for (int i=0; i<ptsCnt; i++)
        {
            glVertex2fv(ctrlPoints[i]);
        }
    glEnd();

    glBegin(GL_LINE_STRIP);
        for (int i=0; i<ptsCnt; i++)
        {
            glVertex2fv(ctrlPoints[i]);
        }
    glEnd();

    glFlush();

ctrlPoints is my array of coords and ptsCnt the number of points. Is
there something missing ?

Isn't EvalMesh supposed to return Vertex3 coords that would paint when
glFlush is called ?

Thanks in advance.
--
Justin
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads