nehe的opengl教程(pdf版)

所需积分/C币:9 2012-01-11 14:59:21 2.69MB PDF
0
收藏 收藏
举报

NEHE的opengl教程(pdf版),很清晰,但是一来不能搜索,二来是英文版,不过质量比较高,需要的谨慎下。
Table of contents Setting Up OpenGL In Mac OS Setting Up OpenGL In Solaris Setting Up OpenGL In Mac OS X Using GLUT 579 Lesson 01 Setting Up An Open gL Window Lesson 02 Your First Polygon 27 Lesson 03 Adding Color Les◎?c4 Rotation 35 Lesson 05 3D Shapes 39 Lesson 06 Texture Mapping 43 Lesson 07 Texture Filters, Lighting Keyboard control 49 Lesson 08 Blending 59 Lesson 09 Moving Bitmaps In 3D Space 63 Lesson 10 Loading And Moving Through a 3D World Lesson 11 Flag Effect (Waving Texture Lesson 12 Display Lists 81 Lesson 13 Bitmap Fonts 89 Lesson 4 Outline Fonts 97 Lesson 45 Texture Mapped Outline Fonts 105 Lesson 1@ Cool Looking Fog Less的“72 TExture Font 115 Lesson 18 Quadrics 125 Lesson 9 Particle Engine Using Triangle Strips 131 esson 20 Masking 145 Lesson 21 Lines, Antialiasing Timing, Ortho View And Simple Sounds 155 Lesson 22 Bump-Mapping, Multi-Texturing& Extensions 181 Lesson 23 Sphere Mapping Quadrics In OpenGL 205 Lesson 24 Tokens, Extensions, Scissor Testing And TGA Loading 211 Lesson 25 Morphing& Loading Objects From A File 225 -esson 25 Clipping Reflections Using The Stencil Buffer 237 Lesson 27 shadows 251 Lesson 28 Bezier Patches/fullscreen Fix 261 Lesson 29 Blitter Function, RAW Texture Loading 271 Lesson 30 Collision Detection 283 sesson 31 Model Loading 297 Lessan 32 Picking, Alpha Blending, Alpha Testing, Sorting 305 LesSon 33 Loading Compressed And Uncompressed TGAS 327 esson 34 Beautiful Landscapes By Means Of Height Mapping 335 Lessom 35 Playing avI Files In OpenGL 345 sesson 36 Radial Blur Rendering To A Texture 357 . 633on 37 Cel-Shading 365 Lesson 38 Loading Textures From A Resource File& Texturing Triangles 373 Lesson 39 Introduction to Physical Simulations 385 Lesson 4-c Rope Physics 395 Lesson 41 Volumetric Fog iPicture Image Loading 405 Lesson 42 Multiple viewports 417 Lesson 43 Free Type Fonts in OpenGL 431 Le3s00 44 3D Lens Flare With Occlusion Testing 443 Lesson 45 Vertex Buffer objects 457 Lesson 46 Fullscreen AntiAliasing 465 esson 4 CG Vertex Shader 471 esson 48 ArcBall Rotation 479 Setting Up OpenGL In Mac Os So you've been wanting to setup Open GL on Mac Os? Here's the place to learn what you need and how you need to do it What You'l need: First and foremost, you'll need a compiler. By far the best and most popular on the Macintosh is Metrowerks Codewarrior(www.metrowerks.com).Ifyou'reastudentgettheeducationalversion-there'snodifference between it and the professional version and it'll cost you a lot less Next, you'll need the OpenGL SDK (developer. apple. com/opengl/from Apple. Now we re ready to create an OpenGL program Getting Started with GLUT: Ok, here is the beginning of the program, where we include headers #include <GL/gl.h> Include <GL/glu.h> #include <GL/glut. h> Include tk. h" The first is the standard OpenGL calls, the other three provide additional calls which we will use in our programs Next we define some constants #define kWindowwidth 400 #define kWindowHeight 300 We use these for the height and width of our window. Next, the function prototypes GIvoid InitGL(Glvoid)i GLvoid DrawGLScene(Glvoid)i GIvoid ResizeGLScene(int Width, int Height) and the main( function int main(int argc, char** argv) glutInit (&argc, argv) 乎 Init8p1 anOde(吵 DOUBLE丨 LU RGB| GLUT DEPTH); glutInitWindowSize (kWindowWidth, kWindowHeight) glutInitwindowPosition (100, 100) glutCreateWindow (argv [0]); 工 nitAl(); lutDisplayFunc( DrawGLScene)i glutReshapeFunc(ReSizeGLScene) glutMainLoop() return glutInit(, glutlnit DisplayModeo, glutlnit Window Size(, glutInitWindow Position(, and glutCreate Window al set up our OpenGL program. InitGLo does the same thing in the Mac program as in the windows program glut Display Func(Draw GLScene) tells glut that we want the draw GLScene function to be used when we want to draw the scene. glutReshape Func(Re SizeGLScene)tells glut that we want the ReSize GLScene function to be used if the window is resized NeHe's OpenGL Tutorials Setting Up OpenGL In Mac OS 5 Later, we will use glutKeyboardFunco, which tells gLut which function we want to use when a key is pressed, and glutldleFunco which tells GLUt which function it will call repeatedly(we'l use it to spin stuff in space Finally, glutMainLoopo starts the program. Once this is called, it will only return to the maino function when the program is quitting You re done Well, that's about it. Most everything else is the same as NeHe's examples. I suggest you look at the read Me included with the Mac Os ports, as it has more detail on specific changes from the examples themselves Have fun Tony Parker(asp(usc. edu Setting Up OpenGL In Mac OS NeHe's OpenGL Tutorials Setting Up OpenGL In Solaris This document describes(quick and dirty) how to install OpenGL and gLUt libraries under Solaris 7 on a Sun workstation The Development Tools Make sure you have a Solaris dEVEloPeR installation on your machine. this means you have all the header files that are necessary for program development under Solaris installed. The easiest way is to install Solaris as a development version This can be done from the normal Solaris installation CD ROm After you've done this you should have your /usr/include and /usr/openwin/include directories filled with nice ittle header files ne C Compiler Sun doesnt ship a C or C++ compiler with Solaris. But you're lucky. You don't have to pay - http:/www.sunfreeware.com There you find gcc the gnU Compiler Collection for Solaris precompiled and ready for easy installation Get the version you like and install it pkgadd -d gcc-xxxversion This will install gcc under /usr/local. You can also do this with admintool: > admit。oL B上。wse→> Software Edit→>Add Then choose Source: " Hard disk"and specify the directory that you've stored the package in. I recommend also downloading and installation of the libstdc++ library if necessary for you gcc version The OpenGL library OpengL should be shipped with Solaris these days. Check if you've already installed it cd /usr/openwin/lib ls 1ibGL* This should print 1立bGL.so libGLU. sog libGIw. so@ 1ibGL.so.1*1ibGU.so.1★1 BgLU,so.1★ This means that you have the libraries already installed (runtime version) But are the header files also there? cd /usr/openwin/include/GL This should print NeHe's OpenGL Tutorials Setting Up openGL In Solaris 7 gl.h glu.h gland.h glxtokensh glmacros h glx.h glxproto h I have it. But what version is it? This is a FAQ http:/www.sun.com/software/graphics/opengl/developer/faq-1.1.2.html Helps you with questions dealing with OpenGL on Sun platforms Yes cool Seems they, re ready. Skip the rest of this step and go to GLUt You don't already have Open gL? Your version is too old? download a new one http://www.sun.com/solaris/opengl Helps you. Make sure to get the necessary patches for your os version and install them. BTW. You need root access to do this. Ask you local sysadmin to do it for you. Follow the online guide for installation GLUT Now you have OpengL but not GLUT. Where can you get it? Look right here http:/www.sun.com/software/graphics/opengl/demos/index.htm e personally downloaded the 32bit version unless I run the 64 bit kernel of solaris. Ive installed gLUt under /usr/local. This is normally a good place for stuff like this Well I have it, but when I try to run the samples in progs/ it claims that it can't find libglut a. To tell your OS where to look for runtime libraries you need to add the path to glut to your variable LD_LIBRARY PATH If you're using bin/sh do something like this LD_ LIBRARY PATH=/lib: /usr/lib: /usr/openwin/lib: /usr/dt/lib: /usr/local/lib: /usr/local/s parc_ solaris/glut-3 7/lib/glut export LD I工 BRARY PATH If you're using a csh do something like this setenv ID_LIBRARY_ PATH /lib: /usr/lib: /usr/openwin/lib: /usr/dt/lib: /usr/local/lib: /usr/ local/sparc_solaris/glut-37/lib/glut Verify that everything is correct echo SLD LIBRARY PATH /lib: /usr/lib: /usr/openwin/lib: /usr/dt/lib: /usr/local/lib: /usr/local/sparc_ solaris/glut- 3.7/lib/glut Congratulations you re done That's it folks. Now you should be ready to compile and run NeHe's OpenGL tutorials. If you find spelling mistakes(I'm not a native english speaking being), errors in my description, outdated links, or have a better install procedure please contact me Lakmal Gunasekara 1999 for nehe productions 8 Setting Up OpenGL In Solaris NeHe's OpenGL Tutorials Setting Up OpenGL In Mac os X Using GLUT So you've been wanting to setup Open GL on Mac os X? Here's the place to learn what you need and hoy you need to do it. This is a direct port from the Mac os ports, so if something seems familiar, that' s why What You'l need: You will need a compiler. Two compilers are currently available, Apple's "Project Builder"and Metrowerks CodeWarrior. Project Builder is being made free in Mid-october(2000), so this tutorial will demonstrate how to make a glut project in Project Builder Getting started with Project Builder: This bit is easy. Just choose"File->New Project"and select a "Cocoa Application "Now choose the name of your project, and your project IDE will pop up Now go to the "Project" Menu and"Add framework. to add the glut framework In 10. 1 you need to add the OpenGL framework as well, so do this now Getting Started with GLUT: Remove the default code by one of two ways: Delete the main. m file that comes with the default project, and insert a new main. c with the glut code or Select all the code in main. m and replace it with the glut code You need 3 headers to start with #include <OpenGL/gl.h> / Header File For The OpenGL32 Library #include <openGL/glu. h> / Header File For The GLu32 Library Include <GLuT/glut.h> //Header File For The GLut Library The first is the standard OpenGL calls, the other three provide additional calls which we will use in our programs Next we define some constants #define kWindowwidth 400 #define kwindowHeight 300 We use these for the height and width of our window. Next, the function prototypes GLvoid InitGL(Glvoid GLvoid DrawGLScene(GLvoid) GLvoid ResizeGLScene(int width, int Height)i and the main function: int main( nt argc,char★★argv) glutInit (&argc, argv)i glutInitDisplayMode (GLUT_DOUBLE I GLUT_RGB I GLUT_ DEPTH) glutInitwindowSize (kWindowWiath, kWindowHeight) glutInitwindowPosition (100, 100)i glutCreateWindow (argv[o]); 工 natL(); glutDisplayFunc(DrawGlScene)i glutReshapeFunc(ReSizeGLScene)i NeHe's OpenGL Tutorials Setting Up openGL In Mac Os X Using glut 9 g1 utMainI。op(); return 0: glutlnit(: glutInitDisplay Modeo, glutInitWindowSize(, glutInitWindowPosition(, and glutcreateWindow( all set up our OpengL program. InitGlo does the same thing in the mac program as in the windows program glutDisplay Func(DraW GLScene) tells gLUt that we want the Draw GLScene function to be used when we want to draw the scene. glutReshape Func(Re SizeGLScene)tells GLUT that we want the ReSizeGLScene function to be used if the window is resized ater, we will use glutKeyboardFunc(, which tells GLUT which function we want to use when a key is pressed, and glutldleFunco which tells GLUt which function it will call repeatedly( we ' ll use it to spin stuff in space Finally, glutMain Loop starts the program. Once this is called, it will only return to the main( function when he program is quitting All Done! Notice the only real difference here is that we are changing the headers. Pretty simple In later tutorials there will be some bigger differences, but for now its just as simple as changing the headers and adding the framework Have fun R.Goffunreality@mac.com) 10 Setting Up OpenGL In Mac OS X Using GLUT NeHe's OpenGL Tutorials

...展开详情
试读 127P nehe的opengl教程(pdf版)
立即下载 低至0.43元/次 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
塔尖的小蜗牛 经典的opengl教程,非常值得下载,我看过了,内容是相对比较全的
2015-01-24
回复
上传资源赚积分or赚钱
    最新推荐
    nehe的opengl教程(pdf版) 9积分/C币 立即下载
    1/127
    nehe的opengl教程(pdf版)第1页
    nehe的opengl教程(pdf版)第2页
    nehe的opengl教程(pdf版)第3页
    nehe的opengl教程(pdf版)第4页
    nehe的opengl教程(pdf版)第5页
    nehe的opengl教程(pdf版)第6页
    nehe的opengl教程(pdf版)第7页
    nehe的opengl教程(pdf版)第8页
    nehe的opengl教程(pdf版)第9页
    nehe的opengl教程(pdf版)第10页
    nehe的opengl教程(pdf版)第11页
    nehe的opengl教程(pdf版)第12页
    nehe的opengl教程(pdf版)第13页
    nehe的opengl教程(pdf版)第14页
    nehe的opengl教程(pdf版)第15页
    nehe的opengl教程(pdf版)第16页
    nehe的opengl教程(pdf版)第17页
    nehe的opengl教程(pdf版)第18页
    nehe的opengl教程(pdf版)第19页
    nehe的opengl教程(pdf版)第20页

    试读结束, 可继续阅读

    9积分/C币 立即下载 >