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

正文內(nèi)容

基于mfc的opengl編程(編輯修改稿)

2024-09-06 17:35 本頁面
 

【文章內(nèi)容簡介】 bLine=FALSE。m_bPolygon=TRUE。m_bTriangle=FALSE。InvalidateRect(NULL,FALSE)。}voidCCY457OpenGLView::OnShapesTriangle(){//畫三角形m_bPoint=FALSE。m_bLine=FALSE。m_bPolygon=FALSE。m_bTriangle=TRUE。InvalidateRect(NULL,FALSE)。}3,修改第二篇文章中的OnSize()函數(shù),因為本文中只繪制2維圖形.voidCCY457OpenGLView::OnSize(UINTnType,intcx,intcy){CView::OnSize(nType,cx,cy)。GLdoubleaspect_ratio。//width/heightratioif(0=cx||0=cy){return。}//selectthefullclientarea::glViewport(0,0,cx,cy)。//putetheaspectratio//thiswillkeepalldimensionscalesequalaspect_ratio=(GLdouble)cx/(GLdouble)cy。//selecttheprojectionmatrixandclearit::glMatrixMode(GL_PROJECTION)。::glLoadIdentity()。//selecttheviewingvolume//::gluPerspective(,aspect_ratio,.01f,)。::gluOrtho2D(,,,)。//switchbacktothemodelviewmatrixandclearit::glMatrixMode(GL_MODELVIEW)。::glLoadIdentity()。}4,在RenderScene中加入具體的繪制代碼:voidCCY457OpenGLView::RenderScene(){//繪制函數(shù)if(m_bPoint==TRUE){glPointSize()。glBegin(GL_POINTS)。glVertex2f(,)。glVertex2f(,)。glVertex2f(,)。glEnd()。}elseif(m_bLine==TRUE){glBegin(GL_LINES)。glVertex2f(,)。glVertex2f(,)。glEnd()。}elseif(m_bTriangle==TRUE){glBegin(GL_TRIANGLES)。glVertex2f(,)。glVertex2f(,)。glVertex2f(,)。glEnd()。}elseif(m_bPolygon==TRUE){glBegin(GL_POLYGON)。glVertex2f(,)。glVertex2f(,)。glVertex2f(,)。glVertex2f(,)。glVertex2f(,)。glEnd()。}}光榮在于平淡,艱巨因為漫長《基于MFC的OpenGL編程》Part 4 Drawing Simple 3D objects 視見體 Viewing Volume is nothing but the region of 3D Cartesian space in that will occupy the window. It is nothing but the minimum and maximum x, y and z values that are inside the window. So if a vertex is outside this range of x, y and z values then they are clipped by OpenGL before rendering can occur. Z BufferThe new term we have to deal with in addition to width and height of an object in 3D graphics is depth. The depth of an object is its distance from the viewpoint. The viewpoint is the location from which we are looking at that point. This depth value goes into the depth or Zbuffer. If we are drawing 2 objects that have some pixels that overlap, the first object will after it is rendered have its depth value in the depth buffer. When the next object is rendered, OpenGL will check to see whether the pixel it’s about to draw is in front of (with respect to the viewpoint) any pixel from the first object that’s already drawn. It does this by checking the Z value of the current pixel with the value that is already in the buffer. If the new pixel is closer to the viewpoint, OpenGL places its depth value in the depth buffer. This is how the Zbuffer works.正交投影和透視投影One term we need to understand very well to learn 3D Graphics well is projection. Well, puter graphics at its simplest is all about setting a color to a pixel on screen. And a pixel on a screen can have only two dimensions. So 3D graphics is merely an illusion. The 3D coordinates that we specify will have to be projected onto a 2D surface to create this illusion for us. And we have to specify how this projection works. By specifying a projection we specify the clipping or viewing volume. 基本3D圖形繪制1,BOOLm_bPoint。//StatusofPointBOOLm_bLine。//StatusofLineBOOLm_bPolygon。//StatusofPolygonBOOLm_bTriangle。//StatusofTriangle并且在構(gòu)造函數(shù)中初始化CCY457OpenGLView::CCY457OpenGLView(){m_bPoint=FALSE。m_bLine=FALSE。m_bPolygon=FALSE。m_bTriangle=FALSE。m_bCube=FALSE。m_bTorus=FALSE。m_bTeapot=FALSE。m_bIcosahedron=FALSE。m_bSimpleCube=FALSE。}2,加入五個菜單項及其對應(yīng)的事件處理程序。voidCCY457OpenGLView::OnObjectsTeapot(){//畫茶壺m_bCube=FALSE。m_bTorus=FALSE。m_bTeapot=TRUE。m_bIcosahedron=FALSE。m_bSimpleCube=FALSE。InvalidateRect(NULL,FALSE)。}voidCCY457OpenGLView::OnObjectsCube(){//畫立方體m_bCube=TRUE。m_bTorus=FALSE。m_bTeapot=FALSE。m_bIcosahedron=FALSE。m_bSimpleCube=FALSE。InvalidateRect(NULL,FALSE)。}voidCCY457OpenGLView::OnObjectsIcosahedron(){//畫二十面體m_bCube=FALSE。m_bTorus=FALSE。m_bTeapot=FALSE。m_bIcosahedron=TRUE。m_bSimpleCube=FALSE。InvalidateRect(NULL,FALSE)。}voidCCY457OpenGLView::OnObjectsTorus(){//畫環(huán)面m_bCube=FALSE。m_bTorus=TRUE。m_bTeapot=FALSE。m_bIcosahedron=FALSE。m_bSimpleCube=FALSE。InvalidateRect(NULL,FALSE)。}voidCCY457OpenGLView::OnObjectsSimplecube(){//畫簡單立方體m_bCube=FALSE。m_bTorus=FALSE。m_bTeapot=FALSE。m_bIcosahedron=FALSE。m_bSimpleCube=TRUE。InvalidateRect(NULL,FALSE)。}3,由于開始繪制3維圖形,因此使用第一篇文章的OnSize()函數(shù)。4,在RenderScene中加入具體
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1