连续曲线绘制,并且可通过鼠标移动点,来改变曲线的形状
#include<gl/glut.h>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
using namespace std;
struct Point{
int x, y;
};
struct Point1{
int index;
int dis;
};
bool cmp(Point1 a, Point1 b){
return a.dis < b.dis;
}
Point pt[11000];
Point1 vt[11000];
int PointNum=0;
bool Moving = false;
double Get(double t, double a, double b, double c, double d){
return a*t*t*t + b*t*t + c*t + d;
}
double distance(double x1, double y1, double x2, double y2){
return (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2);
}
void GetPoint(int x,int y){
for