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



《計(jì)算機(jī)圖形圖像繪制技術(shù)》由會(huì)員分享,可在線閱讀,更多相關(guān)《計(jì)算機(jī)圖形圖像繪制技術(shù)(49頁珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。
1、單擊此處編輯母版標(biāo)題樣式,,單擊此處編輯母版文本樣式,,第二級(jí),,第三級(jí),,第四級(jí),,第五級(jí),,,*,計(jì)算機(jī)圖形圖像繪制技術(shù),,第二講,,,主要內(nèi)容,,顯示三維坐標(biāo)的程序(1),,幾何對(duì)象的變換,,變換矩陣,,平移glTranslatef,,旋轉(zhuǎn)glRotatef,,縮放glScalef,,三維實(shí)體,,顯示三維坐標(biāo)的程序(2),,顏色,,點(diǎn)與線的屬性,,面的顯示,,隱藏面與深度緩沖,,多邊形面的方向,,顯示模式,,練習(xí),,,,顯示三維坐標(biāo)的程序(1),,,,變換矩陣,,在OpenGL中使用矩陣進(jìn)行渲染三維場(chǎng)景所需要的數(shù)據(jù)計(jì)算,,為簡(jiǎn)化操作,OpenGL提供一個(gè)矩陣棧,每次用棧頂?shù)木仃噷?duì)給定的物
2、體或場(chǎng)景進(jìn)行渲染,,用glPushMatrix和glPopMatrix函數(shù)來將矩陣壓棧和出棧,還可以用glScalef和glRotatef等函數(shù)對(duì)棧頂?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.,,三維實(shí)體對(duì)象,,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);,球,,立方體,,長(zhǎng)方體,,圓環(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,顏色其有四個(gè)分量:,,,,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,,,演示,,,,點(diǎn)與線的屬性,,,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)我們從某處看景物時(shí),接近于視點(diǎn)的物體遮擋了離視點(diǎn)較遠(yuǎn)的物體。,,深度緩沖區(qū)為每個(gè)像素保存一個(gè)距離或深度值,以便讓OpenGL通過簡(jiǎn)單方法做隱藏面計(jì)算。,,只有當(dāng)新像素的深度值小于舊像素的深度值時(shí),才允許像素的覆蓋。,,,,,畫家算法與深度排序,,,,畫家算法的局限性,,解決辦法:分割成兩個(gè),,演示,,,,多邊形面的方向,,,,,back-face,norm
24、al pointing inside,,法線方向的指定方法一,,v,0,v,1,v,2,v,3,v,0,v,1,v,2,v,3,根據(jù)頂點(diǎn)順序確定,,法線方向的指定方法二,,指定法線,,面的可見性,,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. 簡(jiǎn)單的城市模型,,,2 三維飛機(jī)模型,,,3,,,4 作三維成績(jī)統(tǒng)計(jì)餅圖或條形圖,,第二次課和第三次課練習(xí)作為一次大作業(yè);,,可任選題目;,,第一次大作業(yè)在第四次課,上課之前交.,,作業(yè)發(fā)email至:liuzhongtu@,,
- 溫馨提示:
1: 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 專題黨課講稿:以高質(zhì)量黨建保障國(guó)有企業(yè)高質(zhì)量發(fā)展
- 廉政黨課講稿材料:堅(jiān)決打好反腐敗斗爭(zhēng)攻堅(jiān)戰(zhàn)持久戰(zhàn)總體戰(zhàn)涵養(yǎng)風(fēng)清氣正的政治生態(tài)
- 在新錄用選調(diào)生公務(wù)員座談會(huì)上和基層單位調(diào)研座談會(huì)上的發(fā)言材料
- 總工會(huì)關(guān)于2025年維護(hù)勞動(dòng)領(lǐng)域政治安全的工作匯報(bào)材料
- 基層黨建工作交流研討會(huì)上的講話發(fā)言材料
- 糧食和物資儲(chǔ)備學(xué)習(xí)教育工作部署會(huì)上的講話發(fā)言材料
- 市工業(yè)園區(qū)、市直機(jī)關(guān)單位、市紀(jì)委監(jiān)委2025年工作計(jì)劃
- 檢察院政治部關(guān)于2025年工作計(jì)劃
- 辦公室主任2025年現(xiàn)實(shí)表現(xiàn)材料
- 2025年~村農(nóng)村保潔員規(guī)范管理工作方案
- 在深入貫徹中央8項(xiàng)規(guī)定精神學(xué)習(xí)教育工作部署會(huì)議上的講話發(fā)言材料4篇
- 開展深入貫徹規(guī)定精神學(xué)習(xí)教育動(dòng)員部署會(huì)上的講話發(fā)言材料3篇
- 在司法黨組中心學(xué)習(xí)組學(xué)習(xí)會(huì)上的發(fā)言材料
- 國(guó)企黨委關(guān)于推動(dòng)基層黨建與生產(chǎn)經(jīng)營(yíng)深度融合工作情況的報(bào)告材料
- 副書記在2025年工作務(wù)虛會(huì)上的發(fā)言材料2篇
相關(guān)資源
更多