- void mouse (int button, int state, int mx, int my)
- {
- #define size 1000
- spline_coor *p_list = 0;
- p_list = new spline_coor[size];
- spline_coor *p_outcome2 = 0;
- p_outcome2 = new spline_coor[101];
- if (button==GLUT_LEFT_BUTTON && state == GLUT_DOWN) {
- counter++;
- p_list[counter].x = mx-(width/2);
- p_list[counter].y = my-(height/2);
- glPointSize(5);
- glBegin(GL_POINTS);
- glColor3d(1, 0, 0);
- glVertex2i(p_list[counter].x, p_list[counter].y);
- cout << "[" << p_list[counter].x << "," << p_list[counter].y << "]" << endl;
- glEnd();
- bspline(counter, 3, p_list, p_outcome2, 101);
- }
- }
- glFlush();
- }