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



《計(jì)算機(jī)圖形圖像繪制技術(shù)》由會員分享,可在線閱讀,更多相關(guān)《計(jì)算機(jī)圖形圖像繪制技術(shù)(49頁珍藏版)》請?jiān)谘b配圖網(wǎng)上搜索。
1、單擊此處編輯母版標(biāo)題樣式,,單擊此處編輯母版文本樣式,,第二級,,第三級,,第四級,,第五級,,,*,計(jì)算機(jī)圖形圖像繪制技術(shù),,第二講,,,主要內(nèi)容,,顯示三維坐標(biāo)的程序(1),,幾何對象的變換,,變換矩陣,,平移glTranslatef,,旋轉(zhuǎn)glRotatef,,縮放glScalef,,三維實(shí)體,,顯示三維坐標(biāo)的程序(2),,顏色,,點(diǎn)與線的屬性,,面的顯示,,隱藏面與深度緩沖,,多邊形面的方向,,顯示模式,,練習(xí),,,,顯示三維坐標(biāo)的程序(1),,,,變換矩陣,,在OpenGL中使用矩陣進(jìn)行渲染三維場景所需要的數(shù)據(jù)計(jì)算,,為簡化操作,OpenGL提供一個(gè)矩陣棧,每次用棧頂?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.,,三維實(shí)體對象,,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,顏色其有四個(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通過簡單方法做隱藏面計(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. 簡單的城市模型,,,2 三維飛機(jī)模型,,,3,,,4 作三維成績統(tǒng)計(jì)餅圖或條形圖,,第二次課和第三次課練習(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)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年作風(fēng)建設(shè)學(xué)習(xí)教育開展情況的報(bào)告范文
- 在2025年民營企業(yè)座談會上的主持講話范文
- 在2025年全縣教育領(lǐng)域群眾身邊不正之風(fēng)和腐敗問題集中整治調(diào)度會上的講話范文
- 工委副書記在2025年機(jī)關(guān)DeepSeek應(yīng)用專題輔導(dǎo)培訓(xùn)班開班儀式上的講話范文
- 在2025年DeepSeek大模型政務(wù)應(yīng)用培訓(xùn)會上的講話范文
- 在青年干部培訓(xùn)結(jié)業(yè)典禮上的講話文稿
- 2025年副書記防汛工作會議上的講話范文
- 2025年主管商務(wù)部門黨組書記在理論學(xué)習(xí)中心組會上研討發(fā)言文稿
- 2025年國企黨委關(guān)于干部職工思想政治工作情況的報(bào)告范文
- 在機(jī)關(guān)單位作風(fēng)建設(shè)學(xué)習(xí)教育突出問題專項(xiàng)整治工作部署會議上的講話范文
- 醫(yī)院領(lǐng)導(dǎo)2025年黨風(fēng)廉政建設(shè)推進(jìn)會上的講話范文
- 2025年關(guān)于開展“以案促改”工作實(shí)施方案供參考
- 在2025年安全生產(chǎn)專項(xiàng)整治暨化工行業(yè)風(fēng)險(xiǎn)防控部署會上的講話范文
- 領(lǐng)導(dǎo)干部在“十五五”發(fā)展規(guī)劃編制啟動會上的講話文稿
- 2025年書記在慰問老干部暨情況通報(bào)會上的主持講話提綱范文
相關(guān)資源
更多