#include#include#include#defineGLUT_WHEEL_UP3//定義滾輪操作#defineGLUT_WHEEL_DOW">
立方體動(dòng)態(tài)畫(huà)家消隱算法

立方體動(dòng)態(tài)畫(huà)家消隱算法

ID:39643292

大小:45.00 KB

頁(yè)數(shù):6頁(yè)

時(shí)間:2019-07-08

立方體動(dòng)態(tài)畫(huà)家消隱算法_第1頁(yè)
立方體動(dòng)態(tài)畫(huà)家消隱算法_第2頁(yè)
立方體動(dòng)態(tài)畫(huà)家消隱算法_第3頁(yè)
立方體動(dòng)態(tài)畫(huà)家消隱算法_第4頁(yè)
立方體動(dòng)態(tài)畫(huà)家消隱算法_第5頁(yè)
資源描述:

《立方體動(dòng)態(tài)畫(huà)家消隱算法》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫(kù)

1、#include#include#include#include#defineGLUT_WHEEL_UP3//定義滾輪操作#defineGLUT_WHEEL_DOWN4floatPI=3.1415926;floatpoints[8][3]={{-1.0,-1.0,-1.0},{1.0,-1.0,-1.0},{1.0,1.0,-1.0},{-1.0,1.0,-1.0},{-1.0,-1.0,1.0},{1.0,-1.0,1.0},{1.0,1.0,1.0},{-1.0,1.0,1.0}};floatcolors[6][

2、3]={{0,1,1},{0,0,1},{1,0,0},{1,1,0},{0,1,0},{1,0,1}};intfaces[6][4]={{4,5,6,7},{1,2,6,5},{0,3,2,1},{0,4,7,3},{0,1,5,4},{2,3,7,6}};floatx[4],y[4],z[4];floatanglex=PI*30/180,angley=PI*30/180,anglez=PI*30/180;floatsize=1.0;GLubyteaoyun[]={//0,1,1,1,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1

3、,0,0,0,1,0,1,1,1,0};0x00,0x00,0x00,0x00,0x00,0x1E,0x07,0x00,0x03,0xFE,0x0F,0x80,0x07,0xFF,0x07,0xF0,0x0F,0xFF,0x83,0xF0,0x0F,0xFF,0xC1,0xF0,0x0F,0xFF,0xF0,0xF8,0x0F,0xFF,0xF8,0x78,0x0F,0xF3,0xF8,0x38,0x0F,0x80,0x7C,0x38,0x0F,0x00,0x38,0x78,0x07,0x04,0x30,0x70,0x0F,0x0C,0x20,0xF8,0x07,0x0C,0x01,0xF8

4、,0x07,0x0C,0x03,0xF8,0x00,0x0C,0x0F,0xF8,0x08,0x18,0x1F,0xF0,0x0E,0x38,0x0F,0xF0,0x0F,0xF0,0x8F,0xF0,0x0F,0xF0,0x8F,0xF0,0x0F,0xF0,0x8F,0xF0,0x06,0x00,0x0F,0xF0,0x04,0x00,0x03,0xF0,0x04,0x00,0x00,0x60,0x06,0x7F,0xF0,0x00,0x07,0x7E,0x3E,0x00,0x03,0xFC,0x3F,0x80,0x03,0xFC,0x3F,0x80,0x01,0xFE,0x7E,0x0

5、0,0x00,0xFF,0xF0,0x00,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00};voidRotationx(floatx_,floaty_,floatz_,inti)//點(diǎn)饒X軸旋轉(zhuǎn)時(shí),改變一個(gè)點(diǎn)的坐標(biāo){x[i]=x_;y[i]=y_*cos(anglex)-z_*sin(anglex);z[i]=y_*sin(anglex)+z_*cos(anglex);}voidRotationy(floatx_,floaty_,floatz_,inti)//點(diǎn)饒Y軸旋轉(zhuǎn)時(shí),改變一個(gè)點(diǎn)的坐標(biāo){x[i]=x_*cos(angley)+z_*sin(angley

6、);y[i]=y_;z[i]=z_*cos(angley)-x_*sin(angley);}voidRotationz(floatx_,floaty_,floatz_,inti)//點(diǎn)饒Z軸旋轉(zhuǎn)時(shí),改變一個(gè)點(diǎn)的坐標(biāo){x[i]=x_*cos(anglez)-y_*sin(anglez);y[i]=x_*sin(anglez)+y_*cos(anglez);z[i]=z_;}voidChangex(inta,intb,intc,intd)//一個(gè)平面饒X軸旋轉(zhuǎn)時(shí)4個(gè)點(diǎn)坐標(biāo)的該改{Rotationx(points[a][0],points[a][1],points[a][2],0);Rotatio

7、nx(points[b][0],points[b][1],points[b][2],1);Rotationx(points[c][0],points[c][1],points[c][2],2);Rotationx(points[d][0],points[d][1],points[d][2],3);}voidChangey()//一個(gè)平面饒Y軸旋轉(zhuǎn)時(shí)4個(gè)點(diǎn)坐標(biāo)的該改{Rotationy(x[0],y[0],z[

當(dāng)前文檔最多預(yù)覽五頁(yè),下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁(yè),下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動(dòng)畫(huà)的文件,查看預(yù)覽時(shí)可能會(huì)顯示錯(cuò)亂或異常,文件下載后無(wú)此問(wèn)題,請(qǐng)放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫(kù)負(fù)責(zé)整理代發(fā)布。如果您對(duì)本文檔版權(quán)有爭(zhēng)議請(qǐng)及時(shí)聯(lián)系客服。
3. 下載前請(qǐng)仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
4. 下載文檔時(shí)可能由于網(wǎng)絡(luò)波動(dòng)等原因無(wú)法下載或下載錯(cuò)誤,付費(fèi)完成后未能成功下載的用戶請(qǐng)聯(lián)系客服處理。