資源簡介
杭州電子科技大學(xué)計算機(jī)圖形學(xué)3d圖形——茶壺(含花紋,陰影)實驗
代碼片段和文件信息
#include
#include
using?namespace?std;
GLfloat?roate?=?0.0;//?set?rote?of?roate?ying?yu?bu?hao??bu?zhuang?le?設(shè)置旋轉(zhuǎn)速率
GLfloat?rote?=?0.0;//shezhi旋轉(zhuǎn)角度
GLfloat?anglex?=?0.0;//X?軸旋轉(zhuǎn)
GLfloat?angley?=?0.0;//Y?軸旋轉(zhuǎn)
GLfloat?anglez?=?0.0;//Z?軸旋轉(zhuǎn)
GLint?WinW?=?400;
GLint?WinH?=?400;
GLfloat?oldx;//當(dāng)左鍵按下時記錄鼠標(biāo)坐標(biāo)??
GLfloat?oldy;
float?xrot;
#define?stripeImageWidth?64
GLubyte?stripeImage[3?*?stripeImageWidth];
void?init(void)
{
//材質(zhì)反光性設(shè)置
GLfloat?mat_specular[]?=?{?1.0?1.0?1.0?1.0?};??//鏡面反射參數(shù)
GLfloat?mat_shininess[]?=?{?50.0?};???????????????//高光指數(shù)
GLfloat?light_position[]?=?{?1.0?1.0?1.0?0.0?};
GLfloat?white_light[]?=?{?1.0?1.0?1.0?1.0?};???//燈位置(111)?最后1-開關(guān)
GLfloat?Light_Model_Ambient[]?=?{?0.2?0.2?0.2?1.0?};?//環(huán)境光參數(shù)
glClearColor(0.
- 上一篇:C++GUI Qt4編程第二版配套程序
- 下一篇:文件壓縮與解壓C++
評論
共有 條評論