Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - NeHe OPENGL
Search - NeHe OPENGL - List
本文来讲讲怎样使用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.
Date : Size : 246kb User : wuwei

四棱锥由5个面构成一个封闭的立体图,其中4个共顶点的侧面是三角形,底面是个四边形。如果我们要绘制一个3D的四棱锥只需要绘制这5个面即可,绘制的方法和前一篇文章OpenGL_Qt学习笔记之_03(平面图形的着色和旋转)的相同。只不过这里的顶点坐标是3维的,所以图像深度那一维不一定为0。因此我们可以事先计算好四棱锥各个顶点的坐标,这对学过立体几何的人来说应该是小case了。然后绘制每个面就可以。 注意,在opengl中绘制每个面时,所有面给出的顶点的顺序都要按照逆时针或者顺时针(我这里采用的是逆时针),这样才能保证所绘制出来的图像时正确的。 现在我们在paintGL中开始绘制四棱锥,如果按照NeHe的教程,它只是绘制了个金字塔,并没有底面,只有4个侧面,这里,我采用它的方法,代码如下: -A closed perspective view of four-sided pyramid is constituted by 5 surface, wherein the side of vertex 4 is triangular, the bottom surface is a quadrangle. If we want to draw a 3D pyramid only need to draw the five faces can, the drawn and former article OpenGL_Qt study notes _03 (planar graph coloring and rotation). But here vertex coordinates of a three-dimensional, so the image depth that dimension is not necessarily 0. So we can be calculated in advance the good four-sided pyramid coordinates of each vertex should learn solid geometry, is a small case. Then you can draw each face. Opengl in draw each surface, all surface given vertex order must be in accordance with the counterclockwise or clockwise (I used counterclockwise), so as to ensure the drawn image. Now we start drawing in paintGL four pyramid NeHe tutorial, it just draws a pyramid and the bottom surface of only four sides, here, I adopt its methods, the code is as follows:
Date : Size : 302kb User : wuwei

Nehe的opengl教程中文版,里面含有很多实例并有详细的解析-Nehe' s opengl tutorials Chinese version, which contains many examples and a detailed analysis
Date : Size : 571kb User : 蒋健

创建一个OpenGL窗口NEHE课程,openGL初步学习-Create an OpenGL window NEHE course, openGL preliminary study
Date : Size : 23kb User : 邓文洵

OpenGL程序-会飘动的时钟,根据NeHe框架编写,时钟纹理使用GDI+编写,初学图形学作品。-The OpenGL program- the flying clock, according NeHe framework written clock texture GDI+ write beginner graphics work.
Date : Size : 315kb User : 李明

Nehe的OpenGL教程,vc版本第1课源代码,unicode编码,解决vc2005及以上版本链接库错误问题
Date : 2013-03-06 Size : 5.09kb User : fkasdf

根据NeHe教程自己编写的五彩环,可以前后左右移动,OpenGL程序,大家都来看看。OpenGL编译环境一定要配置好。-NeHe tutorial to write your own colorful ring can move around, OpenGL program, take a look at everyone. OpenGL compilation environment must be configured.
Date : Size : 2.93mb User : xiexin

OPENGL凹凸映射算法,虽然不如视差映射的方法好,但是凹凸映射我只在NEHE中见过,这个是我找的另一个凹凸映射的例子-OPENGL bump mapping algorithm, although not as good as parallax mapping, but the bump mapping seen only in NEHE, this I find another example of bump mapping
Date : Size : 4.22mb User : tt

nehe的小游戏源代码及相关资源,正常的opengl库都能调通的噢~-nehe small game source code and related resources
Date : Size : 466kb User : 林雪莹

NeHe,第五课,三D动画,OPengl基础。-NeHe, fifth class, three-D animation, OPengl foundation.
Date : Size : 1.95mb User : richard

opengl快速地形生成,nehe教程代码,windows平台下,快速学习opengl-opengl fast terrain generation, nehe tutorial code, windows platform, fast learning opengl
Date : Size : 9.23mb User : 逍遥

Nehe写的OpenGl的贝塞尔曲面教程源码,是基本贝塞尔曲面的实现,源码条理清晰,可配合NeHe的教程研究。-Nehe Bezier Bezier surfaces tutorial source
Date : Size : 63kb User : roger

nehe的拾取游戏OpenGL代码,游戏比较简单,但是OpenGL交互操作、视口等等的基础。-OpenGL code nehe pickup game, the game is relatively simple, but OpenGL interoperability, and so on the basis of the viewport.
Date : Size : 378kb User : roger

Nehe的影子OpenGl代码,是在3D环境中对模型的影子进行建模,实现逼真的效果。比较简单-Nehe shadow OpenGl code, is the model in a 3D environment modeling shadow to achieve realistic results. Simple
Date : Size : 37kb User : roger

这是基于VS2010下的nehe的opengl第20课课程内容。-This program is based in VS2010.It includes nehe s opengl 20th class.
Date : Size : 16.87mb User : 翁凌韬

在OpenGL学习过程中,NeHe 的教程为 Win32 窗口程序,对于初学者来说,多有不便,这里我写了一个基于MFC的框架,其中已经包含了 鼠标旋转 等功能。-Learning process in OpenGL, NeHe tutorials for Win32 window procedure, for starters, more inconvenient, where I wrote a MFC-based framework, which already contains the mouse to rotate and other functions.
Date : Size : 556kb User : 杨网

opengl,显示列表,nehe教程第12课实例-opengl, display a list, nehe Tutorial Lesson 12 instances
Date : Size : 6kb User : ilu

Opengl Nehe版中文教程的源代码,包括opengl的各种用法-Opengl Nehe version of Chinese tutorial source code, including various uses opengl
Date : Size : 6.57mb User : 吴敬梓

Nehe个人网站上OpenGL的源代码,里面是lesson one至lesson 8的部分。-OpenGL codes for Nehe
Date : Size : 22.71mb User : 沈晓明

Nehe 个人网站上OpenGL的源代码,其中是lesson9至lesson18的部分。-openGL codes for Nehe
Date : Size : 23.64mb User : 沈晓明
« 1 2 ... 25 26 27 28 29 3031 »
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.