計算機(jī)圖形圖像繪制技術(shù)

上傳人:jian****019 文檔編號:253303896 上傳時間:2024-12-11 格式:PPT 頁數(shù):49 大?。?86KB
收藏 版權(quán)申訴 舉報 下載
計算機(jī)圖形圖像繪制技術(shù)_第1頁
第1頁 / 共49頁
計算機(jī)圖形圖像繪制技術(shù)_第2頁
第2頁 / 共49頁
計算機(jī)圖形圖像繪制技術(shù)_第3頁
第3頁 / 共49頁

下載文檔到電腦,查找使用更方便

9.9 積分

下載資源

還剩頁未讀,繼續(xù)閱讀

資源描述:

《計算機(jī)圖形圖像繪制技術(shù)》由會員分享,可在線閱讀,更多相關(guān)《計算機(jī)圖形圖像繪制技術(shù)(49頁珍藏版)》請在裝配圖網(wǎng)上搜索。

1、單擊此處編輯母版標(biāo)題樣式,,單擊此處編輯母版文本樣式,,第二級,,第三級,,第四級,,第五級,,,*,計算機(jī)圖形圖像繪制技術(shù),,第二講,,,主要內(nèi)容,,顯示三維坐標(biāo)的程序(1),,幾何對象的變換,,變換矩陣,,平移glTranslatef,,旋轉(zhuǎn)glRotatef,,縮放glScalef,,三維實體,,顯示三維坐標(biāo)的程序(2),,顏色,,點與線的屬性,,面的顯示,,隱藏面與深度緩沖,,多邊形面的方向,,顯示模式,,練習(xí),,,,顯示三維坐標(biāo)的程序(1),,,,變換矩陣,,在OpenGL中使用矩陣進(jìn)行渲染三維場景所需要的數(shù)據(jù)計算,,為簡化操作,OpenGL提供一個矩陣棧,每次用棧頂?shù)木仃噷o定的物

2、體或場景進(jìn)行渲染,,用glPushMatrix和glPopMatrix函數(shù)來將矩陣壓棧和出棧,還可以用glScalef和glRotatef等函數(shù)對棧頂?shù)木仃囘M(jìn)行縮放和旋轉(zhuǎn)等修改,,Push / Pop Matrix,,void,glPushMatrix,(void);,,,Push Matrix,,Push / Pop Matrix,,Pop Matrix,void,glPopMatrix,(void);,,,,Example,,glPushMatrix();,,glTranslatef(...);,,glRotatef(...);,,glScalef(...);,,glutSolidCyli

3、nder(...);,,glPopMatrix();,,,平移glTranslatef,,void glTranslated (GLdouble x, GLdouble y, GLdouble z);,,void glTranslatef (GLfloat x, GLfloat y, GLfloat z);,,,演示,,,旋轉(zhuǎn)glRotatef,,void glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);,,void glRotatef (GLfloat angle, GLfloat x, GLfloat y, GL

4、float z);,,,演示,,縮放glScalef,,void glScaled (GLdouble x, GLdouble y, GLdouble z);,,void glScalef (GLfloat x, GLfloat y, GLfloat z);,,,演示,,Example,,glLoadIdentity();,,glPushMatrix();,,glTranslatef (…);,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix();,,glPushMatrix();,,glRotatef (…)

5、;,,glPopMatrix();,,glPopMatrix();,,,Example,,glLoadIdentity();,,glPushMatrix();,,glTranslatef (…);,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix();,,glPushMatrix();,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Identity,,,Example,,glLoadIdentity();,,glPushMatrix();,,glTransla

6、tef (…);,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix();,,glPushMatrix();,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Identity,,,Example,,glLoadIdentity();,,glPushMatrix();,,,glTranslatef (…);,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix();,,glPushMat

7、rix();,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Identity,,Translate,,,Example,,glLoadIdentity();,,glPushMatrix();,,glTranslatef (…);,,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix();,,glPushMatrix();,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Identity,,Translate,,,

8、Example,,glLoadIdentity();,,glPushMatrix();,,glTranslatef (…);,,glPushMatrix();,,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix();,,glPushMatrix();,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Identity,,Translate,,Identity,,,Example,,glLoadIdentity();,,glPushMatrix();,,glTranslatef (…);,,glPu

9、shMatrix();,,glLoadIdentity();,,,glTranslate (…);,,glPopMatrix();,,glPushMatrix();,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Identity,,Translate,,Identity,,Translate,,,Example,,glLoadIdentity();,,glPushMatrix();,,glTranslatef (…);,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,,glPopM

10、atrix();,,glPushMatrix();,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Identity,,Translate,,,Example,,glLoadIdentity();,,glPushMatrix();,,glTranslatef (…);,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix();,,,glPushMatrix();,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Ide

11、ntity,,Translate,,,Example,,glLoadIdentity();,,glPushMatrix();,,glTranslatef (…);,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix();,,glPushMatrix();,,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Identity,,Translate,,Rotate,,,Example,,glLoadIdentity();,,glPushMatrix();,,glTran

12、slatef (…);,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix();,,glPushMatrix();,,glRotatef (…);,,,glPopMatrix();,,glPopMatrix();,,Identity,,Translate,,,Example,,glLoadIdentity();,,glPushMatrix();,,glTranslatef (…);,,glPushMatrix();,,glLoadIdentity();,,glTranslate (…);,,glPopMatrix

13、();,,glPushMatrix();,,glRotatef (…);,,glPopMatrix();,,glPopMatrix();,,Identity,,,平移與旋轉(zhuǎn)的次序很重要,,glLoadIdentity(),,,,glRotated(45, 0, 0, 1),,,,glTranslated(5, 0, 0),OpenGL commands successively define new “l(fā)ocal” coordinate spaces in terms of the “current” or previous local space.,,三維實體對象,,Glaux.lib庫,,

14、void auxWireSphere(GLdouble);,,void auxSolidSphere(GLdouble);,,void auxWireCube(GLdouble);,,void auxSolidCube(GLdouble);,,void auxWireBox(GLdouble, GLdouble, GLdouble);,,void auxSolidBox(GLdouble, GLdouble, GLdouble);,,void auxWireTorus(GLdouble, GLdouble);,,void auxSolidTorus(GLdouble, GLdouble);,,

15、void auxWireCylinder(GLdouble, GLdouble);,,void auxSolidCylinder(GLdouble, GLdouble);,,void auxWireIcosahedron(GLdouble);,,void auxSolidIcosahedron(GLdouble);,,void auxWireOctahedron(GLdouble);,,void auxSolidOctahedron(GLdouble);,,void auxWireTetrahedron(GLdouble);,,void auxSolidTetrahedron(GLdouble

16、);,,void auxWireDodecahedron(GLdouble);,,void auxSolidDodecahedron(GLdouble);,,void auxWireCone(GLdouble, GLdouble);,,void auxSolidCone(GLdouble, GLdouble);,,void auxWireTeapot(GLdouble);,,void auxSolidTeapot(GLdouble);,球,,立方體,,長方體,,圓環(huán),,圓柱,,二十面體,,八面體,,四面體,,十二面體,,圓錐,,茶壺,,,Glut庫,,void glutWireSphere(G

17、Ldouble radius, GLint slices, GLint stacks);,,void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);,,void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);,,void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);,,void glutWireCube(GLdoubl

18、e size);,,void glutSolidCube(GLdouble size);,,void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);,,void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);,,void glutWireDodecahedron(void);,,void glutSolidDodecahedron(void);,,vo

19、id glutWireTeapot(GLdouble size);,,void glutSolidTeapot(GLdouble size);,,void glutWireOctahedron(void);,,void glutSolidOctahedron(void);,,void glutWireTetrahedron(void);,,void glutSolidTetrahedron(void);,,void glutWireIcosahedron(void);,,void glutSolidIcosahedron(void);,,顯示三維坐標(biāo)的程序(2),,(演示),,顏色,,glCo

20、lor3fv(face color),,render_face(),,glColor3fv(eye color),,render_eyes(),,glColor3fv(hair color),,render_hair(),,glColor3fv(teeth color),,render_teeth(),,Colors,顏色其有四個分量:,,,,R - 紅 Red.,,G - 綠 Green.,,B - 藍(lán) Blue.,,A - 透明度 Transparent.,關(guān)于透明處理…,在后面講,!,,glShadeModel(GL_FLAT);,,glBegin(GL_QUADS);,,glCo

21、lor3f (1.0,0.0,0.0);,,glVertex3f(0.0,0.0,0.0);,,glColor3f (0.0,1.0,0.0);,,glVertex3f(1.0,0.0,0.0);,,glColor3f (0.0,0.0,1.0);,,glVertex3f(1.0,1.0,0.0);,,glColor3f (1.0,1.0,0.0);,,glVertex3f(0.0,1.0,0.0);,,glEnd();,Shading Models,,,glShadeModel(GL_SMOOTH);,,glBegin(GL_QUADS);,,glColor3f (1.0,0.0,

22、0.0);,,glVertex3f(0.0,0.0,0.0);,,glColor3f (0.0,1.0,0.0);,,glVertex3f(1.0,0.0,0.0);,,glColor3f (0.0,0.0,1.0);,,glVertex3f(1.0,1.0,0.0);,,glColor3f (1.0,1.0,0.0);,,glVertex3f(0.0,1.0,0.0);,,glEnd();,Shading Models,,,演示,,,,點與線的屬性,,,void,glPointSize(GLfloat,size);,,void,glLineWidth(GLfloat,width);,,

23、glLineStipple(1, 0x3F07);,glEnable(GL_LINE_STIPPLE);,,void,glLineStipple(GLint,factor,,Glushort,pattern);,,演示,,,,深度緩沖區(qū),,當(dāng)我們從某處看景物時,接近于視點的物體遮擋了離視點較遠(yuǎn)的物體。,,深度緩沖區(qū)為每個像素保存一個距離或深度值,以便讓OpenGL通過簡單方法做隱藏面計算。,,只有當(dāng)新像素的深度值小于舊像素的深度值時,才允許像素的覆蓋。,,,,,畫家算法與深度排序,,,,畫家算法的局限性,,解決辦法:分割成兩個,,演示,,,,多邊形面的方向,,,,,back-face,norm

24、al pointing inside,,法線方向的指定方法一,,v,0,v,1,v,2,v,3,v,0,v,1,v,2,v,3,根據(jù)頂點順序確定,,法線方向的指定方法二,,指定法線,,面的可見性,,void glCullFace (GLenum mode);,,GLenum取值:GL_FRONT、GL_BACK、GL_FRONT_AND_BACK,,多邊形顯示模式,,glPolygonMode(GLenum face, GLenum mode);,GL_FILL, GL_LINE, GL_POINT,GL_FRONT, GL_BACK, GL_FRONT_AND_BACK,GL_FILL,GL_LINE,GL_POINT,,演示,,,,練習(xí),,1. 簡單的城市模型,,,2 三維飛機(jī)模型,,,3,,,4 作三維成績統(tǒng)計餅圖或條形圖,,第二次課和第三次課練習(xí)作為一次大作業(yè);,,可任選題目;,,第一次大作業(yè)在第四次課,上課之前交.,,作業(yè)發(fā)email至:liuzhongtu@,,

展開閱讀全文
溫馨提示:
1: 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

相關(guān)資源

更多
正為您匹配相似的精品文檔
關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  sobing.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號:ICP2024067431-1 川公網(wǎng)安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng),我們立即給予刪除!