freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于opengl的3d旋轉(zhuǎn)魔方的實現(xiàn)--終期報告加源碼(編輯修改稿)

2024-12-18 15:13 本頁面
 

【文章內(nèi)容簡介】 C 語言知識,也對編程及 3D 設(shè)計產(chǎn)生了一定的興趣,分析問題和解決問題的能力也得到了不小的提高。而且,我也學(xué)到了很多人生的道理。在做一件看似很難的事時,我14 們要有一個總體的框架,不要有畏難心理。靜下心來,沉著的分析問題,問題總會迎刃而解的。因此,成功的關(guān)鍵在于你是否擁有這樣的心理。 參考文獻(xiàn) [1]孫鑫 VC++深入詳解 第三版 北京 電子工業(yè)出版社 2020年 126 [2]楊柏林,陳根浪,徐靜 OpenGL 編程精粹 第三版 北京 機(jī)械工 業(yè)出版社 2020年 1121 [3]周純杰,劉正林,何頂新,周凱波 標(biāo)準(zhǔn) C 語言程序設(shè)計及應(yīng)用 第二版 武漢 華中科技大學(xué)出版社 2020年 1263 [4]Dave Shreiner, The Khronons OpenGLARB Working Group OpenGL編程指南 第七版 北京 機(jī)械工業(yè)出版社 2020年 21328 15 附上源碼 第一個文件 頭文件 ifndef _MO_FANG_H_ define _MO_FANG_H_ include // windows 的頭文件 include include gl/ // 包含 OpenGL 核心庫 include gl/ // 包含 OpenGL 實用庫 include gl/ // 包含 OpenGL 輔助庫 include // 包含數(shù)學(xué)函數(shù)庫 define PI2 define CYCLE_COUNT 90 define MAX_CHAR 128 //用于在窗口顯示文字而定義的常數(shù) define FRONT 0 define BACK 1 define LEFT 2 define RIGHT 3 define TOP 4 define BOTTOM 5 typedef struct { GLfloat vx,vy,vz。 16 }CubeVertex。 typedef struct { GLfloat p[3]。 }stPoint。 typedef struct { stPoint CubePoint[8]。 }stCube。 void reset_model()。 void Rotate_ZM()。 void Rotate_ZZ()。 void Rotate_ZP()。 void Rotate_XM()。 void Rotate_XZ()。 void Rotate_XP()。 void Rotate_YM()。 void Rotate_YZ()。 void Rotate_YP()。 void Rotate_Z(int ii)。 17 void Rotate_Y(int ii)。 void Rotate_X(int ii)。 void enable_X_roatate(int direction)。 void enable_Y_roatate(int direction)。 void enable_Z_roatate(int direction)。 void selectFont(int size, int charset, const char* face)。 void drawCNString(const char* str)。 void drawString(const char* str)。 extern stCube Cube[27]。 extern int rotAngle。 extern int rotCount。 extern int rotX,rotY,rotZ。 extern GLfloat Vx,Vy。 endif 第二個文件 /* * 這個 cpp 文件包含三階魔方變換的常規(guī)函數(shù) * 作者為張世清 學(xué) 號 U202020185 * 華中科技大學(xué)電子系集成 1001 班 * 當(dāng)然成果還離不開組員徐兮、雷韋拉以及何兆華的支持 */ //加入自己編寫的魔方頭文件,其中包含一些變量定義與函數(shù)聲明 include //對立方體各頂點(diǎn)編號 18 static stPoint CubePoint[8]= { { , , }, //0 { , , }, //1 {, , }, //2 {, , }, //3 {, , }, //4 {, , }, //5 {, , }, //6 {, , }, //7 }。 extern int cs。 stCube Cube[27]。 //定義一個 3 階魔方 stCube Static_Cube[27]。 //定義一個靜態(tài)的 3 階魔方 //旋轉(zhuǎn)控制 int rotAngle = 1。 //旋轉(zhuǎn)角度 int rotCount。 //一個旋轉(zhuǎn)周期內(nèi)旋轉(zhuǎn)次數(shù) CYCLE_COUNT = 90/rotAngle。 int rotX,rotY,rotZ。 //指定那個軸旋轉(zhuǎn) int rotDirect=1。 //正反向旋轉(zhuǎn) //對當(dāng)前魔方各個立方體進(jìn)行編號 BYTE ZP[9] = {0,1,2,3,4,5,6,7,8}。 //z 軸方向正向一層 BYTE ZZ[9] = {9,10,11,12,13,14,15,16,17}。 //z 軸方向中間一層 BYTE ZM[9] = {18,19,20,21,22,23,24,25,26}。 //z 軸方向負(fù)向一層 BYTE YM[9] = {0,1,2,11,10,9,18,19,20}。 //y 軸方向負(fù)向一層 BYTE YZ[9] = {3,4,5,14,13,12,21,22,23}。 //y 軸方向中 間一層 19 BYTE YP[9] = {6,7,8,17,16,15,24,25,26}。 //y 軸方向正向一層 BYTE XM[9] = {2,3,8,17,12,11,20,21,26}。 //x 軸方向正向一層 BYTE XZ[9] = {1,4,7,16,13,10,19,22,25}。 //x 軸方向中間一層 BYTE XP[9] = {0,5,6,15,14,9,18,23,24}。 //x 軸方向負(fù)向一層 //對靜態(tài)魔方各個立方體進(jìn)行編號 const BYTE SZP[9] = {0,1,2,3,4,5,6,7,8}。 //z 軸方向正向一層 const BYTE SZZ[9] = {9,10,11,12,13,14,15,16,17}。 //z 軸方向中間一層 const BYTE SZM[9] = {18,19,20,21,22,23,24,25,26}。 //z 軸方向負(fù)向一層 const BYTE SYM[9] = {0,1,2,11,10,9,18,19,20}。 //y 軸方向負(fù)向一層 const BYTE SYZ[9] = {3,4,5,14,13,12,21,22,23}。 //y 軸方向中間一層 const BYTE SYP[9] = {6,7,8,17,16,15,24,25,26}。 //y 軸方向正向一層 const BYTE SXM[9] = {2,3,8,17,12,11,20,21,26}。 //x 軸方向正向一層 const BYTE SXZ[9] = {1,4,7,16,13,10,19,22,25}。 //x 軸方向中間一層 const BYTE SXP[9] = {0,5,6,15,14,9,18,23,24}。 //x 軸方向負(fù)向一層 void Rotate(stCube *pCube,float angle,float x0,float y0,float z0)。 //聲明旋轉(zhuǎn)函數(shù) //判斷兩個立方體是否重合,即判斷兩個立方體所包含的所有頂點(diǎn)坐標(biāo)是否相同 int is_equal(stCube *pc1,stCube *pc2){ float x1,x2,y1,y2,z1,z2。 int isFind = 0。 for( int i=0。i8。i++) { x1 = pc1CubePoint[i].p[0]。 y1 = pc1CubePoint[i].p[1]。 z1 = pc1CubePoint[i].p[2]。 isFind = 0。 for(int j=0。j8。j++) 20 { x2 = pc2CubePoint[j].p[0]。 y2 = pc2CubePoint[j].p[1]。 z2 = pc2CubePoint[j].p[2]。 if( fabs(x1 x2)1e1 amp。amp。 fabs(y1y2)1e1 amp。amp。 fabs(z1z2)1e1) { pc1CubePoint[i].p[0] = pc2CubePoint[j].p[0]。 //消除累計誤差 pc1CubePoint[i].p[1] = pc2CubePoint[j].p[1]。 pc1CubePoint[i].p[2] = pc2CubePoint[j].p[2]。 isFind = 1。 break。 } } if( isFind == 0) return 0。 } return 1。 } //旋轉(zhuǎn)之后,查找當(dāng)前旋轉(zhuǎn)面里面包含新的角點(diǎn) void Update_Cube_index() { int i,j,k=0。 //根據(jù)逐一判斷立方體是否重合來更新每一層所包含的立方體的索引,總共三個方向有九層 k =0 。 for( i=0。i9。i++) { for( j=0。j27。j++) if( is_equal( amp。Cube[j], amp。Static_Cube[ SZM[i] ] ) ) { ZM[k++] = j。 } 21 } k=0。 for(i=0。i9。i++) { for(j=0。j27。j++) if(is_equal( amp。Cube[j], amp。Static_Cube[ SZZ[i] ] )) { ZZ[k++]=j。 } } k = 0。 for( i=0。i9。i++) { for( j=0。j27。j++) if( is_equal( amp。Cube[j] , amp。Static_Cube[ SZP[i] ] ) ) { ZP[k++] = j。 } } k =0 。 for( i=0。i9。i++) { for( j=0。j27。j++) if( is_equal( amp。Cube[j], amp。Static_Cube[ SXM[i] ] ) ) { XM[k++] = j。 } } k =0 。 for( i=0。i9。i++) 22 { for( j=0。j27。j++) if( is_equal( amp。Cube[j], amp。Static_Cube[ SXZ[i] ] ) ) { XZ[k++] = j。 } } k = 0。 for( i=0。i9。i++) { for(j=0。j27。j++) if( is_equal( amp。Cube[j], amp。Static_Cube[ SXP[i] ] ) ) { XP[k++] = j。 }
點(diǎn)擊復(fù)制文檔內(nèi)容
醫(yī)療健康相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1