OpenglVC.rar

  • PUDN用户
    了解作者
  • Visual C++
    开发工具
  • 56KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 2
    下载次数
  • 2009-06-09 10:18
    上传日期
all about OPEN-GL in visual c
OpenglVC.rar
  • OpenglVC.pdf
    67.2KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/625090d374bc5c010569024d/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/625090d374bc5c010569024d/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">Using OpenGL in Visual C++</div><div class="t m0 x1 h3 y2 ff2 fs1 fc0 sc0 ls1 ws1">by A<span class="_ _0"></span>lan <span class="_ _0"></span>Oursland</div><div class="t m0 x1 h4 y3 ff3 fs1 fc0 sc0 ls2 ws2">Copyright<span class="_ _0"></span> &#169; 2000 Inte<span class="_ _0"></span>rface Techn<span class="_ _0"></span>ologies, Inc<span class="_ _0"></span>. All Ri<span class="_ _0"></span>ghts Rese<span class="_ _0"></span>rved.</div><div class="t m0 x1 h5 y4 ff4 fs2 fc0 sc0 ls3 ws3">Series Overview</div><div class="t m0 x1 h6 y5 ff1 fs1 fc0 sc0 ls4 ws4">W<span class="_ _1"></span>ith the release of<span class="_ _1"></span> NT 3.5, OpenG<span class="_ _1"></span>L becam<span class="_ _1"></span>e a part of<span class="_ _1"></span> the W<span class="_ _1"></span>indows operati<span class="_ _1"></span>ng system<span class="_ _1"></span>. Now with<span class="_ _1"></span> support</div><div class="t m0 x1 h6 y6 ff1 fs1 fc0 sc0 ls5 ws5">for O<span class="_ _1"></span>penGL in W<span class="_ _1"></span>indows 9<span class="_ _1"></span>5 and W<span class="_ _1"></span>indows 98 a<span class="_ _1"></span>nd low pr<span class="_ _1"></span>iced grap<span class="_ _1"></span>hics ac<span class="_ _1"></span>celerators<span class="_ _1"></span> becom<span class="_ _1"></span>ing read<span class="_ _1"></span>ily</div><div class="t m0 x1 h6 y7 ff1 fs1 fc0 sc0 ls6 ws6">availab<span class="_ _1"></span>le even o<span class="_ _1"></span>n low end m<span class="_ _1"></span>achines<span class="_ _1"></span>, the pros<span class="_ _1"></span>pects of<span class="_ _1"></span> using Ope<span class="_ _1"></span>nGL on a<span class="_ _1"></span>ny W<span class="_ _1"></span>indows m<span class="_ _1"></span>achine is</div><div class="t m0 x1 h6 y8 ff1 fs1 fc0 sc0 ls7 ws7">becom<span class="_ _1"></span>ing mor<span class="_ _1"></span>e attractive ev<span class="_ _1"></span>ery da<span class="_ _1"></span>y. If you are <span class="_ _1"></span>interes<span class="_ _1"></span>ted in creat<span class="_ _1"></span>ing q<span class="_ _1"></span>ualit<span class="_ _1"></span>y 2-D or 3-D gr<span class="_ _1"></span>aphics in</div><div class="t m0 x1 h6 y9 ff1 fs1 fc0 sc0 ls7 ws7">W<span class="_ _1"></span>indows, or if <span class="_ _1"></span>you alread<span class="_ _1"></span>y know anot<span class="_ _1"></span>her vari<span class="_ _1"></span>ant of G<span class="_ _1"></span>L, keep read<span class="_ _1"></span>ing. T<span class="_ _1"></span>his tutorial<span class="_ _1"></span> will sho<span class="_ _1"></span>w you ho<span class="_ _1"></span>w to</div><div class="t m0 x1 h6 ya ff1 fs1 fc0 sc0 ls7 ws7">use OpenG<span class="_ _1"></span>L and som<span class="_ _1"></span>e of<span class="_ _1"></span> its basic co<span class="_ _1"></span>mm<span class="_ _1"></span>ands.</div><div class="t m0 x1 h6 yb ff1 fs1 fc0 sc0 ls8 ws8">GL is a <span class="_ _1"></span>programm<span class="_ _1"></span>ing inter<span class="_ _1"></span>face des<span class="_ _1"></span>igned b<span class="_ _1"></span>y Silicon Gr<span class="_ _1"></span>aphics<span class="_ _1"></span>. OpenGL <span class="_ _1"></span>is a gen<span class="_ _1"></span>eric vers<span class="_ _1"></span>ion of the <span class="_ _1"></span>interf<span class="_ _1"></span>ace</div><div class="t m0 x1 h6 yc ff1 fs1 fc0 sc0 ls6 ws8">made ava<span class="_ _1"></span>ilable to <span class="_ _1"></span>a wide <span class="_ _1"></span>variet<span class="_ _1"></span>y of outside<span class="_ _1"></span> vendors<span class="_ _1"></span> in the int<span class="_ _1"></span>erest of<span class="_ _1"></span> standar<span class="_ _1"></span>dization<span class="_ _1"></span> of the la<span class="_ _1"></span>nguage.</div><div class="t m0 x1 h6 yd ff1 fs1 fc0 sc0 ls6 ws8">OpenGL <span class="_ _1"></span>allows <span class="_ _1"></span>you to creat<span class="_ _1"></span>e high qu<span class="_ _1"></span>alit<span class="_ _1"></span>y 3-D images<span class="_ _1"></span> without dea<span class="_ _1"></span>ling with <span class="_ _1"></span>the heavy m<span class="_ _1"></span>ath <span class="_ _1"></span>usuall<span class="_ _1"></span>y</div><div class="t m0 x1 h6 ye ff1 fs1 fc0 sc0 ls9 ws9">associated<span class="_ _1"></span> with com<span class="_ _1"></span>puter grap<span class="_ _1"></span>hics. Ope<span class="_ _1"></span>nGL hand<span class="_ _1"></span>les gra<span class="_ _1"></span>phics prim<span class="_ _1"></span>itives<span class="_ _1"></span>, 2-D and 3-D tr<span class="_ _1"></span>ansf<span class="_ _1"></span>ormations<span class="_ _1"></span>,</div><div class="t m0 x1 h6 yf ff1 fs1 fc0 sc0 ls7 ws7">lighting, s<span class="_ _1"></span>hading,<span class="_ _1"></span> Z-buf<span class="_ _1"></span>fering, hid<span class="_ _1"></span>den surfac<span class="_ _1"></span>e rem<span class="_ _1"></span>oval, and a <span class="_ _1"></span>host of oth<span class="_ _1"></span>er featur<span class="_ _1"></span>es. I'll <span class="_ _1"></span>use som<span class="_ _1"></span>e of these</div><div class="t m0 x1 h6 y10 ff1 fs1 fc0 sc0 ls6 ws6">topics i<span class="_ _1"></span>n the sam<span class="_ _1"></span>ple progr<span class="_ _1"></span>ams<span class="_ _1"></span> following; oth<span class="_ _1"></span>ers I'll <span class="_ _1"></span>leave to<span class="_ _1"></span> you to ex<span class="_ _1"></span>plore <span class="_ _1"></span>yourself. If<span class="_ _1"></span> you want to <span class="_ _1"></span>learn</div><div class="t m0 x1 h6 y11 ff1 fs1 fc0 sc0 ls9 ws9">mor<span class="_ _1"></span>e about OpenGL <span class="_ _1"></span>you can s<span class="_ _1"></span>earch the <span class="_ _1"></span>MSDN we<span class="_ _1"></span>bsite for th<span class="_ _1"></span>e ke<span class="_ _1"></span>yword "OpenG<span class="_ _1"></span>L".</div><div class="t m0 x1 h6 y12 ff1 fs1 fc0 sc0 lsa wsa">Here is t<span class="_ _1"></span>he list of<span class="_ _1"></span> topics<span class="_ _1"></span> covered <span class="_ _1"></span>in this s<span class="_ _1"></span>eries:</div><div class="t m0 x2 h6 y13 ff1 fs1 fc0 sc0 lsa wsa">1. <span class="_ _2"> </span>W<span class="_ _1"></span>riting an OpenGL<span class="_ _1"></span> Progr<span class="_ _1"></span>am</div><div class="t m0 x2 h6 y14 ff1 fs1 fc0 sc0 ls8 ws8">2. <span class="_ _2"> </span>Simple 2-<span class="_ _1"></span>D Graphic<span class="_ _1"></span>s</div><div class="t m0 x2 h6 y15 ff1 fs1 fc0 sc0 ls6 wsb">3. <span class="_ _2"> </span>Transf<span class="_ _1"></span>ormations and the Matr<span class="_ _1"></span>ix Stack</div><div class="t m0 x2 h6 y16 ff1 fs1 fc0 sc0 ls8 ws8">4. <span class="_ _2"> </span>Simple 3-<span class="_ _1"></span>D Graphic<span class="_ _1"></span>s</div><div class="t m0 x1 h5 y17 ff4 fs2 fc0 sc0 lsb wsc">Writing an OpenGL Program</div><div class="t m0 x1 h6 y18 ff1 fs1 fc0 sc0 lsc wsd">The f<span class="_ _1"></span>irst program<span class="_ _1"></span> demons<span class="_ _1"></span>trated here wi<span class="_ _1"></span>ll sho<span class="_ _1"></span>w you the m<span class="_ _1"></span>inimum<span class="_ _1"></span> requirem<span class="_ _1"></span>ents for<span class="_ _1"></span> setting up a<span class="_ _1"></span> <span class="_ _0"></span>W<span class="_ _1"></span>indows</div><div class="t m0 x1 h6 y19 ff1 fs1 fc0 sc0 lsd wse">program<span class="_ _1"></span> to displa<span class="_ _1"></span>y OpenGL gr<span class="_ _1"></span>aphics<span class="_ _1"></span>. As GDI n<span class="_ _1"></span>eeds a De<span class="_ _1"></span>vice Contex<span class="_ _1"></span>t (DC) to dr<span class="_ _1"></span>aw im<span class="_ _1"></span>ages, OpenGL</div><div class="t m0 x1 h6 y1a ff1 fs1 fc0 sc0 lsd wse">requires <span class="_ _1"></span>a Render<span class="_ _1"></span>ing Contex<span class="_ _1"></span>t (RC). Unl<span class="_ _1"></span>ike GDI, in <span class="_ _1"></span>which eac<span class="_ _1"></span>h GDI com<span class="_ _1"></span>mand r<span class="_ _1"></span>equires that a<span class="_ _1"></span> DC is</div><div class="t m0 x1 h6 y1b ff1 fs1 fc0 sc0 lse wsf">passed into <span class="_ _1"></span>it, OpenG<span class="_ _1"></span>L uses th<span class="_ _1"></span>e conce<span class="_ _1"></span>pt of a current<span class="_ _1"></span> RC. Once<span class="_ _1"></span> a renderi<span class="_ _1"></span>ng context <span class="_ _1"></span>has been m<span class="_ _1"></span>ade</div><div class="t m0 x1 h6 y1c ff1 fs1 fc0 sc0 ls5 ws5">current in<span class="_ _1"></span> a thread<span class="_ _1"></span>, all Op<span class="_ _1"></span>enGL ca<span class="_ _1"></span>lls in t<span class="_ _1"></span>hat threa<span class="_ _1"></span>d will use t<span class="_ _1"></span>he sam<span class="_ _1"></span>e current r<span class="_ _1"></span>enderin<span class="_ _1"></span>g contex<span class="_ _1"></span>t. W<span class="_ _1"></span>hile</div><div class="t m0 x1 h6 y1d ff1 fs1 fc0 sc0 ls9 ws9">multiple r<span class="_ _1"></span>ender<span class="_ _1"></span>ing contexts<span class="_ _1"></span> ma<span class="_ _1"></span>y be used to dr<span class="_ _1"></span>aw in a s<span class="_ _1"></span>ingle win<span class="_ _1"></span>dow, onl<span class="_ _1"></span>y one render<span class="_ _1"></span>ing con<span class="_ _1"></span>text ma<span class="_ _1"></span>y be</div><div class="t m0 x1 h6 y1e ff1 fs1 fc0 sc0 lsd wse">current at <span class="_ _1"></span>any tim<span class="_ _1"></span>e in a singl<span class="_ _1"></span>e thread.</div><div class="t m0 x1 h6 y1f ff1 fs1 fc0 sc0 lsc wsd">The goal <span class="_ _1"></span>of this s<span class="_ _1"></span>ample is to<span class="_ _1"></span> create<span class="_ _1"></span> and m<span class="_ _1"></span>ake curr<span class="_ _1"></span>ent an OpenGL r<span class="_ _1"></span>endering<span class="_ _1"></span> context.<span class="_ _1"></span> There ar<span class="_ _1"></span>e three</div><div class="t m0 x1 h6 y20 ff1 fs1 fc0 sc0 lsc wsd">steps to c<span class="_ _1"></span>reating an<span class="_ _1"></span>d m<span class="_ _1"></span>aking current <span class="_ _1"></span>a renderin<span class="_ _1"></span>g contex<span class="_ _1"></span>t:</div><div class="t m0 x2 h6 y21 ff1 fs1 fc0 sc0 lsf ws10">1. <span class="_ _2"> </span>Set the win<span class="_ _1"></span>dow's pix<span class="_ _1"></span>el form<span class="_ _1"></span>at.</div><div class="t m0 x2 h6 y22 ff1 fs1 fc0 sc0 lse wsf">2. <span class="_ _2"> </span>Create the re<span class="_ _1"></span>ndering<span class="_ _1"></span> context.</div><div class="t m0 x2 h6 y23 ff1 fs1 fc0 sc0 lse wsf">3. <span class="_ _2"> </span>Make the r<span class="_ _1"></span>endering co<span class="_ _1"></span>ntext curr<span class="_ _1"></span>ent.</div><div class="t m0 x1 h6 y24 ff1 fs1 fc0 sc0 ls9 ws9">Tak<span class="_ _1"></span>e the followin<span class="_ _1"></span>g steps t<span class="_ _1"></span>o create th<span class="_ _1"></span>e project:</div><div class="t m0 x2 h6 y25 ff1 fs1 fc0 sc0 lsd wse">1. <span class="_ _2"> </span>Create a ne<span class="_ _1"></span>w Projec<span class="_ _1"></span>t <span class="_ _0"></span>W<span class="_ _1"></span>orks<span class="_ _1"></span>pace of t<span class="_ _1"></span>y<span class="_ _0"></span>pe "MFC <span class="_ _1"></span>AppW<span class="_ _1"></span>izard (exe)". <span class="_ _1"></span>Select t<span class="_ _1"></span>he director<span class="_ _1"></span>y <span class="_ _1"></span>you where</div><div class="t m0 x3 h6 y26 ff1 fs1 fc0 sc0 ls7 ws7">you want th<span class="_ _1"></span>e projec<span class="_ _1"></span>t director<span class="_ _1"></span>y to be cr<span class="_ _1"></span>eated, an<span class="_ _1"></span>d type "G<span class="_ _1"></span>LSam<span class="_ _1"></span>ple1" as t<span class="_ _1"></span>he project n<span class="_ _1"></span>ame. Clic<span class="_ _1"></span>k</div><div class="t m0 x3 h6 y27 ff1 fs1 fc0 sc0 lsa wsa">"Create" <span class="_ _1"></span>to enter t<span class="_ _1"></span>he AppW<span class="_ _3"></span>izard. Follo<span class="_ _1"></span>wing is a <span class="_ _1"></span>list of<span class="_ _1"></span> the steps <span class="_ _1"></span>in the Ap<span class="_ _1"></span>pW<span class="_ _1"></span>izard and the</div><div class="t m0 x3 h6 y28 ff1 fs1 fc0 sc0 ls9 ws9">param<span class="_ _1"></span>eters you sh<span class="_ _1"></span>ould enter <span class="_ _1"></span>in each of<span class="_ _1"></span> them. An<span class="_ _1"></span>y param<span class="_ _1"></span>eters not l<span class="_ _1"></span>isted are o<span class="_ _1"></span>ptional.</div><div class="t m0 x2 h6 y29 ff1 fs1 fc0 sc0 lsf ws10">2. <span class="_ _2"> </span>Single Doc<span class="_ _1"></span>ument Int<span class="_ _1"></span>erface</div><div class="t m0 x2 h6 y2a ff1 fs1 fc0 sc0 ls10 ws11">3. <span class="_ _2"> </span>Database sup<span class="_ _1"></span>port: None</div><div class="t m0 x2 h6 y2b ff1 fs1 fc0 sc0 ls4 ws4">4. <span class="_ _2"> </span>Compond Doc<span class="_ _1"></span>ument Su<span class="_ _1"></span>pport: No<span class="_ _1"></span>ne</div></div><div class="pi" data-data='{"ctm":[1.568627,0.000000,0.000000,1.568627,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐
    • Open_GL 3D
      openGL 3D OpenGL三维图形编程,OpenGL是目前最新的开放式的三维图形标准,用OpenGL编写的程序不仅可以在SGI、 DEC、SUN、HP等图形工作站上运行,而且可以在微机环境下运行。本书系统地讲述了OpenGL ...
    • Open GL手册
      OpenGL是一个图形硬件的软件接口(“GL”即Graphics Library)。这一接口包含了数百个函数,图形程序员可以利用这些函数指定设计高品质的三维彩色图像所需的对象和操作。这些函数中有许多实际上是其他函数的简单变形...
    • java3d open GL API
      java3d的API,有做相关开发的可以直接安装查询。
    • 基于Open GL 的作品
      文件附带代码和实验报告,实现了雾化效果、灯光效果、纹理贴图、模拟光源
    • Open gl学习
      glut工具,及其在windows下的使用方法。open gl 在win32 console 和MFC 对话框及MFC 单文档中的使用方法
    • open GL 立方体
      open GL 立方体运动 实例, 源码; 适合在此基础上开发出各类3D动画,游戏等;
    • 计算机图形学 open gl
      计算机图形学(Computer Graphics,简称CG)是一种使用数学算法将二维或三维图形转化为计算机显示器的栅格形式的科学。简单地说,计算机图形学的主要研究内容就是研究如何在计算机中表示图形、以及利用计算机进行图形...
    • OPEN gl小程序代码
      做程序的时候做的,OPENGL小程序,控制小棍转动
    • OPEN GL绘图—球
      在VC++6.0中使用OPEN GL绘图,包括有OPEN GL如何初始化,适合入门学习
    • OPEN GL 学习.zip
      关于学习opengl的文档,非常适合新手的文档学习