绘制Bezier曲线
#include
GLfloat ctrlpoints[4][3] =
{{ -4.0, -4.0, 0.0}, { -2.0, 3.0, 0.0},...4.5, 0.0}, {3.0, -3.0, 0.0}};
void init(void)
{
glClearColor(1.0, 1.0, 1.0, 0.0);
glShadeModel(GL_FLAT...);
//下行用于定义曲线函数
glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]);
glEnable(GL_MAP1_VERTEX...曲线上的点
glColor3f(0.0, 0.0, 0.0);
glLineWidth(2);
glBegin(GL_LINE_STRIP);
for (i = 0; i <= 20; i++)...绘制Bezier曲面
#include
GLfloat ctrlpoints[4][4][3] = {
{{-3, 0, 4.0}, {-2, 0, 2.0}, {-1,