1. 算法
2. 源代码
#include "stdafx.h"
#include "GL/glut.h"
#include "stdlib.h"
#include "math.h"
void init()
{
glClearColor(1.0,1.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0,600.0,0.0,400.0);
}
typedef struct point
{
float x,y;
}point;
void setPixel(point bezierPt)
{
glBegin(GL_POINTS);
glVertex2f(bezierPt.x,bezierPt.y);
glEnd();
}
int binomialCoeffs(int k,int n)
{
int i,c=1;
if(k==0)
return c;
else
{
for(i=n-k+1;i&
本文深入探讨了计算机图形学中的Bezier曲线生成算法,包括算法原理、源代码实现及最终的图形结果展示。
订阅专栏 解锁全文
1538

被折叠的 条评论
为什么被折叠?



