資源簡介
杭州電子科技大學計算機圖形學3d圖形——茶壺(含花紋,陰影)實驗
代碼片段和文件信息
#include
#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;
float?xrot;
#define?stripeImageWidth?64
GLubyte?stripeImage[3?*?stripeImageWidth];
void?init(void)
{
//材質反光性設置
GLfloat?mat_specular[]?=?{?1.0?1.0?1.0?1.0?};??//鏡面反射參數
GLfloat?mat_shininess[]?=?{?50.0?};???????????????//高光指數
GLfloat?light_position[]?=?{?1.0?1.0?1.0?0.0?};
GLfloat?white_light[]?=?{?1.0?1.0?1.0?1.0?};???//燈位置(111)?最后1-開關
GLfloat?Light_Model_Ambient[]?=?{?0.2?0.2?0.2?1.0?};?//環境光參數
glClearColor(0.
- 上一篇:C++GUI Qt4編程第二版配套程序
- 下一篇:文件壓縮與解壓C++
評論
共有 條評論