資源簡介
工程環境:VS2010 C++源碼
使用OpenGL實現B樣條曲線的繪制,拖動節點實現樣條的調節以及曲線平滑的實現;
右擊添加節點,左鍵拖動調節
代碼片段和文件信息
#include???
#include???
#include???
#include???
#include???
#include?
#include?
using?namespace?std;
vectorx_coord;
vectory_coord;
bool?flag?=0;?????????//?wbp?控制是否閉合
int?nPoints?=?0;?????//?wbp控制點數
int?j=0;??
int?pointChoose?=0;
void?init(){??
glClearColor(1110);??
glOrtho(0700.0?700?0?-5.05.0);??
}??
void?myReshape(int?wint?h)??
{??
glViewport(00(GLsizei)w(GLsizei)h);??
glMatrixMode(GL_PROJECTION);??
glLoadIdentity();??
//gluPerspective(45.0(GLfloat)w/(GLfloat)h1.050.0);??
//if(w<=h)??
// //glOrtho(-5.05.0-5.0*(GLfloat)h/(GLfloat)w5.0*(GLfloat)h/(GLfloat)w-5.05.0);??
// glOrtho(0500.0500.0*(GLfloat)h/(GLfloat)w0*(GLfloat)h/(GLfloat)w-5.05.0
- 上一篇:用分治算法設計循環賽日程表
- 下一篇:銀行管理系統VC++版本,console界面
評論
共有 條評論