資源簡介
a.實現簡單渲染,生成一個真實感三維物體
b.允許用戶以鼠標位置指定光源位置
c.可以編輯,修改物體表面材質屬性
d.可以選擇一副圖像作為紋理貼到物體表面
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
using?namespace?std;
//將庫包含進來編譯
#pragma?comment(lib?“glaux.lib“)
const?int?w?=?500; //?窗口寬度
const?int?h?=?500; //?窗口高度
int?n;//球近似疊代次數
GLint?target=0;//狀態控制量
GLint?sub_menu1?=?4;//菜單常量
//頂點信息
typedef?float?point[3];
point?v[]?=?{{0.00.01.0}{0.00.942809-0.33333}{-0.816497-0.471405-0.333333}{0.816497-0.471405-0.333333}};
GLuint?texture[1];//存取貼圖id的數組
GLUquadricObj?*Sphere?=?0; // 底座?二次曲面
GLfloat?position[]?=?{0.5?0.3?1.0?0.0?};//光源位置
//材質參數
GLfloat?ambient[2][4]?={{0.80.80.81.0}{0.1350.22250.15750.95}};
GLfloat?diffuse[2][4]?={{0.8?0.0?0.81.0}{0.540.890.630.95}};
GLfloat?specular[2][4]={{1.0?0.0?1.0
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????326656??2011-11-27?20:08??計算機圖形學實驗報告二.doc
?????文件???????7771??2010-11-17?01:02??a_exp2.cpp
?????文件?????116214??2010-11-16?00:08??sea.bmp
-----------?---------??----------?-----??----
???????????????450641????????????????????3
- 上一篇:最優化方法乘子法程序
- 下一篇:fuel openstack 網絡拓撲詳解
評論
共有 條評論