通过菜单完成曲线即曲面的绘制:
|
|
- Hermite曲线(三次)
- Bezier曲线(三次或四次)
- B样条曲线(二次或三次)
- Bezier曲面(双三次)
- 退出
|
|
#define _CRT_SECURE_NO_WARNINGS
#include<stdlib.h>
#include<math.h>
#include<Windows.h>
#include <iostream>
#include <cmath>
#include<stdio.h> //X86
#include<GL/glut.h>
#define PI 3.1415926
int yourselect;
///#include<time.h>
using namespace std;
float ctrlpoints[4][4][3] = {
{
{-280, 0,400},{-200, 20,200} ,{100,180,350},{355,340,-20}},
{
{-280,-35,350},{-200, 40,150},{160,150,290},{375,310,-70}},
{
{-270,-45,120},{-190, 90,160}, {200,100,210},{395,250,-100}},
{
{-300,-200,50} ,{-180,150,170},{275,94,190},{380,220,-200}},
};
void Init() {
//glClearColor(0.3f, 0.3f, 0.3f, 0.0f); //灰色
glC