資源簡介
江蘇科技大學計科專業計算機圖形學實驗旋轉茶壺代碼,列表應該還有實驗報告
代碼片段和文件信息
/**************************
?*?Includes
?*
?**************************/
#include?
#include?
#include???
#include
#pragma?comment(lib?“glut32.lib“)??
#include???
using?namespace?std;
GLfloat?roate?=?0.0;//?set?rote?of?roate?ying?yu?bu?hao??bu?zhuang?le?設置旋轉速率
GLfloat?rote?=?0.0;//shezhi旋轉角度
GLfloat?anglex?=?0.0;//X?軸旋轉
GLfloat?angley?=?0.0;//Y?軸旋轉
GLfloat?anglez?=?0.0;//Z?軸旋轉
GLint?WinW?=?400;
GLint?WinH?=?400;
GLfloat?oldx;//當左鍵按下時記錄鼠標坐標??
GLfloat?oldy;
void?init(void)
{
glClearColor(1.0?1.0?1.0?1.0);?//背景黑色??
}
void?display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0?0.0?0.0);?//畫筆紅色
glLoadIdentity();??//加載單位矩陣??
gluLookAt(0.0?0.0?5.0?0.0?0.0?0.0?0.0?1.0?0.0);
glRotatef(rote?0
- 上一篇:C語言圖書管理系統
- 下一篇:基于c++的學生信息管理源代碼可執行
評論
共有 條評論