opengl_qt_simple_draw

所属分类:OpenGL
开发工具:C/C++
文件大小:246KB
下载次数:136
上传日期:2012-08-23 16:05:09
上 传 者tornadomeet
说明:  本文来讲讲怎样使用opengl来画平面几何图形,这一节本来是很简单的,因为某些问题都弄大半天了。当然,这还是按照NeHe的教程来的学习的。 这次实现的功能是在窗口中画一个三角形,一个矩形,一个圆形。 下面来看看怎么绘制平面几何图形。在设置好需要画的几何图形的属性后,比如颜色信息,就以glBegin()开始,以glEnd()结束,glBegin()中的参数为所画几何图形的类型,比如说GL_ TRIANGLES代表三角形,GL_QUADS为矩形等等。 在glBegin()和glEnd()之间是放的点,这里是三维的点,这些点是对应所画矩形的类型的。 画圆的话稍微麻烦一点,因为opengl中没有直接对应的类型,一般都是采用三角形来逼近,其它很多几何图形也是类似的。在用三角形逼近时,是用的画连续三角形,一般有2种类型。
(This article say something about how to use opengl to draw a plane geometry, this section was very simple, because some of the issues Dounong most of the day. Of course, this is in accordance with the NeHe the tutorial come to learn. The functions realized in the window, drawing a triangle, a rectangle, a circle. Let' s take a look at how to draw a plane geometry. After setting up the need to draw geometric properties, such as color, glBegin () to glEnd () end glBegin () in the argument is drawn geometry type, for example, on behalf of the triangle GL_ TRIANGLES GL_QUADS is rectangular, etc.. GlBegin () and glEnd () between the discharge point, here is the three-dimensional points, these points correspond painted rectangular type. Draw a circle, then a little difficult, because opengl not directly correspond to the type of triangle are generally used to approximate many other geometry is similar. Painting with continuous triangle with triangular approximation, generally 2 types.)

文件列表:
opengl_nehe_02 (0, 2012-08-23)
opengl_nehe_02\glwidget.cpp (4034, 2012-08-23)
opengl_nehe_02\glwidget.h (487, 2012-08-22)
opengl_nehe_02\glwidget.ui (447, 2012-08-22)
opengl_nehe_02\main.cpp (183, 2012-08-22)
opengl_nehe_02\opengl_nehe_02.pro (135, 2012-08-23)
opengl_nehe_02\opengl_nehe_02.pro.user (17702, 2012-08-23)
OpenGL_Qt学习笔记之_02(绘制简单平面几何图形).pdf (266090, 2012-08-23)

近期下载者

相关文件


收藏者