資源簡(jiǎn)介
a.實(shí)現(xiàn)簡(jiǎn)單渲染,生成一個(gè)真實(shí)感三維物體
b.允許用戶以鼠標(biāo)位置指定光源位置
c.可以編輯,修改物體表面材質(zhì)屬性
d.可以選擇一副圖像作為紋理貼到物體表面
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
using?namespace?std;
//將庫(kù)包含進(jìn)來(lái)編譯
#pragma?comment(lib?“glaux.lib“)
const?int?w?=?500; //?窗口寬度
const?int?h?=?500; //?窗口高度
int?n;//球近似疊代次數(shù)
GLint?target=0;//狀態(tài)控制量
GLint?sub_menu1?=?4;//菜單常量
//頂點(diǎn)信息
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的數(shù)組
GLUquadricObj?*Sphere?=?0; // 底座?二次曲面
GLfloat?position[]?=?{0.5?0.3?1.0?0.0?};//光源位置
//材質(zhì)參數(shù)
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
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件?????326656??2011-11-27?20:08??計(jì)算機(jī)圖形學(xué)實(shí)驗(yàn)報(bào)告二.doc
?????文件???????7771??2010-11-17?01:02??a_exp2.cpp
?????文件?????116214??2010-11-16?00:08??sea.bmp
-----------?---------??----------?-----??----
???????????????450641????????????????????3
評(píng)論
共有 條評(píng)論