问题如下:已知六个点的坐标,怎样使用 Bezier 曲线将它们光滑的连接起来,要求输出的曲线的光滑度可以指定
解决方案 »
- 问一下:ReadProcessMemory的问题.....
- 用CreateProcess启动控制台程序,为什么总说找不到要启动的exe?
- 请教一个Windows编程的问题
- vc里用outlookbar控件时,怎样给项目对应自定义的文本,单击项目后,得到事先赋给的自定义文本内容,不是项目名称
- 如何制作屏蔽全部键盘的动作(包括WIN、Sleep)的底层钩子,并将拦截的消息发到指定的对话框
- 那里有vc下载啊????
- 大家来谈谈#line的作用?
- 大家看看代码啊 编译不过去啊
- 求助!双缓冲画图问题!
- 急死人了!!!救命哪!!!!!!
- 如何反注册一个COM组件?
- 很奇怪,我写的ATL服务程序竟然只有.ex
const POINT * P2,
const POINT * P3,
const POINT * P4,
const POINT * P5,
const POINT * P6,
int nCount,
POINT * pPoints)
{
if(P1 == NULL || P2 == NULL ||
P3 == NULL || P4 == NULL ||
P5 == NULL || P6 == NULL ||
nCount < 3 || pPoints == NULL)
return FALSE; pPoints[0].x = P1->x;
pPoints[0].y = P1->y;
pPoints[nCount-1].x = P6->x;
pPoints[nCount-1].y = P6->y; double t_step = (double)1 / (nCount - 1);
double t = t_step; for(int i=1; i<nCount-1; i++, t+=t_step)
{
double s = 1-t;
double d0 = s * s * s * s * s;
double d1 = 5 * t * ( s * s * s * s );
double d2 = 10 * t * t * ( s * s * s );
double d3 = 10 * t * t * t * ( s * s );
double d4 = 5 * t * t * t * t * s;
double d5 = t * t * t * t * t; double X = d0 * P1->x +
d1 * P2->x +
d2 * P3->x +
d3 * P4->x +
d4 * P5->x +
d5 * P6->x;
double Y = d0 * P1->y +
d1 * P2->y +
d2 * P3->y +
d3 * P4->y +
d4 * P5->y +
d5 * P6->y; pPoints[i].x = (int)X;
pPoints[i].y = (int)Y;
} return TRUE;
}