I am having trouble making a simple drawing.
I'm not sure what the issues is here but I have a set of points:
GLfloat ctrlpoints[13][3] = {
{0.1, 0.1, 0.0},
{0.7, 0.1, 0.0},
{0.9, 0.1, 0.0},
{0.9, 0.3, 0.0},
{0.7, 0.3, 0.0},
{0.6, 0.3, 0.0},
{0.55, 0.25, 0.0},
{0.5, 0.2, 0.0},
{0.2, 0.2, 0.0},
{0.12, 0.2, 0.0},
{0.1, 0.3, 0.0},
{0.07, 0.2, 0.0},
{0.1, 0.1, 0.0} };
And I want all the points in the code to connect but instead it stops after the 6th set of points.
Rest of my code:
void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 5, &ctrlpoints[0][0]);
glEnable(GL_MAP1_VERTEX_3);
}
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();
glPointSize(0.5);
glColor3f(1.0, 1.0, 0.0);
glBegin(GL_POINTS);
for (i = 0; i < 12; i++)
glVertex3fv(&ctrlpoints[i][0]);
glEnd();
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(500, 500);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}