- 博客(6)
- 资源 (2)
- 收藏
- 关注
转载 双列表左右切换js插件dual-listbox
dual-listbox.js是一款纯JavaScript插件,将正常的选择框转换成一个可搜索的双重列表框,用户可以选择两个选择之间移动面板。
2023-05-27 14:56:18
283
原创 多边形绘制
#include #include #include #includeusing namespace std;typedef struct point{ int x;int y;struct point *next;}cpoint;typedef struct{int n;//顶点数cpoint *cp;}polygon;p
2023-05-25 13:46:52
58
2
人议会制贝塞尔曲线
void DrawBezier(point *p)
{
point *q=(point*)malloc(sizeof(point));
q->x=p->x;
q->y=p->y;
point *b=q;
point *g=q;
point *c=(point*)malloc(sizeof(point));
point *s=p->next;
int n=f.n-1;
for(int j=0;j<f.n-1;j++)
{
b=(point *)malloc(sizeof(point));
b->x=s->x;
b->y=s->y;
s=s->next;
g->next=b;
g=b;
}
g->next=NULL;
g=q;
float t;
for(float i=0.0;i<1000.0;i++)
{
t=i/1000.0;
while(true)
{ g=q;
b=g->next;
while(b!=NULL)
{
calculate(c,g,b,t);
g->x=c->x;
g->y=c->y;
if(b->next==NULL)
{
free(b);
g->next=NULL;
n--;
break;
}
g=b;
b=b->next;
}
if(n==0)
break;
}
glVertex2f(g->x,g->y);
g->x=p->x;
g->y=p->y;
q=g;
s=p->next;
for(int j=0;j<f.n-1;j++)
{
b=(point *)malloc(sizeof(point));
b->x=s->x;
b->y=s->y;
s=s->next;
g->next=b;
g=b;
}
n=f.n-1;
g->next=NULL;
}
}
2011-12-04
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人