﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-bneliao-文章分类-graph/game</title><link>http://www.cppblog.com/bneliao/category/8088.html</link><description /><language>zh-cn</language><lastBuildDate>Mon, 01 Sep 2008 00:45:30 GMT</lastBuildDate><pubDate>Mon, 01 Sep 2008 00:45:30 GMT</pubDate><ttl>60</ttl><item><title>数学在计算机图形学中的应用 zz</title><link>http://www.cppblog.com/bneliao/articles/60482.html</link><dc:creator>bneliao</dc:creator><author>bneliao</author><pubDate>Sat, 30 Aug 2008 20:22:00 GMT</pubDate><guid>http://www.cppblog.com/bneliao/articles/60482.html</guid><wfw:comment>http://www.cppblog.com/bneliao/comments/60482.html</wfw:comment><comments>http://www.cppblog.com/bneliao/articles/60482.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bneliao/comments/commentRss/60482.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bneliao/services/trackbacks/60482.html</trackback:ping><description><![CDATA[http://blog.hjenglish.com/fjren/articles/143735.html<br>
<br>
<h1>Mathematics for Computer Graphics</h1>
<h2>Greg Turk, August 1997</h2>
<p>"What math should I learn in order to study computer graphics?" This is
perhaps the most common general question that students ask me about computer
graphics. The answer depends on how deeply you wish to go into the field. If you
wish to begin to use off-the-shelf graphics programs then the answer is that you
probably do not need to know very much math at all. If you wish to take an
introductory course in computer graphics, then you should read the first two
sections below for my recommendations (algebra, trigonometry and linear
algebra). If you want some day to be a researcher in graphics then I believe
that you should consider your mathematics education to be an ongoing process
throughout your career.
</p>
<p>If you do not particularly care for mathematics, is there still a chance of
working in the field? Yes, a few areas within computer graphics are not much
concerned with mathematical ideas. You should not give up on graphics just
because you are not a math wizard. It is likely, however, that you will have
more freedom in choosing research topics if you have a willingness to learn
about new mathematical ideas.
</p>
<p>There is no absolute answer to what mathematics is important in computer
graphics. Different areas within the field require different mathematical
techniques, and your own interests will likely lead you towards some topics and
may never touch others. Below are descriptions of a number of areas in
mathematics that I believe are useful in computer graphics. Do not feel that you
need to be an expert in each of these areas to become a graphics researcher! I
deliberately included many areas below to give a fairly broad view of the
mathematical ideas used in graphics. Many researchers, however, will never find
the need to look at some of the topics that I mention below.
</p>
<p>Finally, although it should be clear from reading this, the opinions given
within this document are entirely my own. It is likely that you would get a
different list of topics or at least different emphases from other people who
work in computer graphics. Now on to the list of topics.
</p>
<p>
</p>
<h2>Algebra and Trigonometry</h2>
High-school level algebra and trigonometry are
probably the most important areas to know in order to begin to learn about
computer graphics. Just about every day I need to determine one or more unknowns
from a simple set of equations. Almost as often I need to perform simple
trigonometry such as finding the length of the edge of some geometric figure
based on other lengths and angles. Algebra and trigonometry are the subjects
that will solve such day-to-day tasks in computer graphics.
<p>What about the geometry that we learn in high school? It may come as a
surprise, but our high school geometry is not very often needed for most tasks
in computer graphics. The reason for this is that geometry as it is taught in
many schools actually is a course in how to construct mathematical proofs. While
proof construction is definitely a valuable intellectual tool, the actual
theorems and proofs from your geometry class are not often used in computer
graphics. If you go to graduate school in a mathematics related field (including
computer graphics) then you may well find yourself proving theorems, but this is
not necessary in order to start out in graphics.
</p>
<p>If you have a good understanding of algebra and trigonometry then you are
quite prepared to begin reading an introductory book in computer graphics. Most
such books contain at least an abbreviated introduction to the next important
area of mathematics for computer graphics, namely linear algebra.
</p>
<p>Book recommendation:
</p>
<dl><dd>Computer Graphics: Principles and Practice
</dd><dd>James Foley, Andries van Dam, Steven Feiner, John Hughes
</dd><dd>Addison-Wesley
</dd><dd>[a huge book, but still my favorite] </dd></dl>
<h2>Linear Algebra</h2>
The ideas of linear algebra are used throughout computer
graphics. In fact, any area that concerns itself with numerical representations
of geometry often will collect together numbers such as x,y,z positions into
mathematical objects called vectors. Vectors and a related mathematical object
called a matrix are used all the time in graphics. The language of vectors and
matrices is an elegant way to describe (among other things) the way in which an
object may be rotated, shifted (translated), or made larger or smaller (scaled).
Linear algebra is usually offered either in an advanced high school class or in
college. Anyone who wishes to work in computer graphics should eventually get a
solid grounding in this subject. As I mentioned before, however, many textbooks
in graphics give a reasonable introduction to this topic-- often enough to get
you through a first course in graphics.
<p>Book recommendation:
</p>
<p>
</p>
<dl><dd>Linear Algebra and Its Applications
</dd><dd>Gilbert Strang
</dd><dd>Academic Press </dd></dl>
<h2>Calculus</h2>
Knowledge of calculus is an important part of advanced computer
graphics. If you plan to do research in graphics, I strongly recommend getting a
basic grounding in calculus. This is true not just because it is a collection of
tools that are often used in the field, but also because many researchers
describe their problems and solutions in the language of calculus. In addition,
a number of important mathematical areas require calculus as a prerequisite.
This is the one area in mathematics in addition to basic algebra that can open
the most doors for you in computer graphics in terms of your future mathematical
understanding.
<p>Calculus is the last of the topics that I will mention that is often
introduced in high school. The topics to follow are almost always found in
college courses.
</p>
<p>
</p>
<h2>Differential Geometry</h2>
This area of mathematics studies equations that
govern the geometry of smooth curves and surfaces. If you are trying to figure
out what direction is perpendicular to (points directly away from) a smooth
surface (the "normal vector") then you are using differential geometry. Making a
vehicle travel at a particular speed along a curved path is also differential
geometry. There is a common technique in graphics for making a smooth surface
appear rough known as "bump mapping", and this method draws on differential
geometry. If you plan to do work with curves and surfaces for shape creation
(called "modeling" in the graphics field) then you should learn at least the
basics of differential geometry. Multivariable calculus is the prerequisite for
this area.
<p>Book recommendation:
</p>
<p>
</p>
<dl><dd>Elementary Differential Geometry
</dd><dd>Barrett O'Neill
</dd><dd>Academic Press </dd></dl>
<h2>Numerical Methods</h2>
Almost every time we represent and manipulate numbers
in the computer we use approximate instead of exact values, and because of this
there is always the possibility for errors to creep in. Moreover, there are
often many different approaches to solving a given numerical problem, and some
methods will be faster, more accurate or require less memory than others. The
study of these issues goes by a number of names including "numerical methods"
and "scientific computing". This is a very broad area, and several of the other
areas of mathematics that I will mention can be considered sub-areas underneath
this umbrella. These sub-areas include sampling theory, matrix equations,
numerical solution of differential equations, and optimization.
<p>Book recommendation:
</p>
<p>
</p>
<dl><dd>Numerical Recipes in C: The Art of Scientific Computing
</dd><dd>William Press, Saul Teukolsky, William Vetterling and Brian Flannery
</dd><dd>Cambridge University Press
</dd><dd>[this is a very valuable reference but is not normally used as a textbook]
</dd></dl>
<h2>Sampling Theory and Signal Processing</h2>
Over and over in computer graphics
we represent some object such as an image or a surface as a collection of
numbers that are stored in a regular two-dimensional array. Whenever we do this
we are creating a "sampled" representation of the object. A good understanding
of sampling theory is important if we are to use and to control the quality of
such representations. A common issue in sampling as it applies to graphics is
the jagged edges that can appear on the silhouette of an object when it is drawn
on a computer screen. The appearance of such jagged edges (one form of a
phenomenon known as "aliasing") is very distracting, and this can be minimized
by using well-understood techniques from sampling theory. At the heart of
sampling theory are concepts such as convolution, the Fourier transform, and
spatial and frequency representations of functions. These ideas are also
important in the fields of image and audio processing.
<p>Book recommendation:
</p>
<p>
</p>
<dl><dd>The Fourier Transform and Its Applications
</dd><dd>Ronald N. Bracewell
</dd><dd>McGraw Hill </dd></dl>
<h2>Matrix Equations</h2>
There are a wide variety of problems that come up in
computer graphics that require the numerical solution of matrix equations. Some
problems that need matrix techniques include: finding the best position and
orientation to match one object to another (one example of a "least squares"
problem), creating a surface that drapes over a given collection of points with
minimal creases (thin-plate splines), and simulation of materials such as water
or cloth. Matrix formulations of problems come up often enough in graphics that
I rank this area very high on my list of topics to know.
<p>Book recommendation:
</p>
<p>
</p>
<dl><dd>Matrix Computations
</dd><dd>Gene Golub and Charles Van Loan
</dd><dd>Johns Hopkins University Press </dd></dl>
<h2>Physics</h2>
Physics is obviously a field of study in its own right and not a
sub-category of mathematics. Nevertheless, physics and mathematics are closely
tied to one another in several areas within computer graphics. Examples of
graphics problems that involve physics include how light interacts with the
surfaces of objects, how light bounces around in a complex environment, the way
people and animals move, and the motion of water and wind. Knowledge of physics
is important for simulating all of these phenomena. This is closely tied to
solving differential equations, which I shall discuss next.
<p>
</p>
<h2>Numerical Solutions of Differential Equations</h2>
It is my belief that
techniques for solving differential equations are extremely important to
computer graphics. As we just discussed, much of computer graphics is devoted to
simulating physical systems from the real world. How waves form in water and how
an animal walks across the ground are two examples of physical simulation.
Simulation of physical systems very often leads to numerical solutions of
differential equations. Note that this is actually very different than symbolic
solutions to differential equations. Symbolic solutions are exact answers, and
usually can be found only for extremely simple sets of equations. Sometimes a
college course called "Differential Equations" will only examine symbolic
solutions, and this will not help much for most computer graphics problems.
<p>In physical simulation, one breaks the world down into little pieces that are
represented as large vectors. Then the relations between the parts of the world
are captured in the entries in matrices. Solving the matrix equations that arise
is not usually done exactly, but is instead performed by carrying out a long
series of calculations that yields an approximate solution as a list of numbers.
This is what numerical solutions of differential equations are about. Note that
the solution of matrix equations is an intimate part of numerical solutions to
differential equations.
</p>
<p>
</p>
<h2>Optimization</h2>
Quite often in computer graphics we are looking for a
description of an object or a collection of objects that satisfies some desired
goal. Examples include looking for the positions of lights that give a certain
"feeling" to how a room is lit, figuring out how an animated character can move
its limbs to carry out a particular action, and positioning shapes and text on a
page so that the result does not look cluttered. Each of these examples can be
stated as an optimization problem. Ten years ago there was little in the
graphics literature that made use of optimization techniques, but the field is
using optimization more and more in recent work. I think that optimization will
continue to play an increasingly important role in computer graphics.
<p>
</p>
<h2>Probability and Statistics</h2>
There are a number of areas within computer
graphics that make use of probability and/or statistics. Certainly when
researchers carry out studies using human subject, they require statistical
methods in order to perform the analysis of the data. Graphics related areas
that often make use of human subjects include Virtual Reality and Human-Computer
Interaction (HCI). In addition, many computer descriptions of the real world
involve using various probabilities that a given action will occur. The
probability that a tree limb will branch during growth or that a synthetic
animal will decide to walk in a particular direction are two examples of this.
Finally, some techniques for solving difficult equations make use of random
numbers to estimate their solutions. An important example of this is a class of
techniques known as Monte Carlo methods that are often used to determine how
light propagates in an environment. These are just a few of the ways that
probability and statistics are used in computer graphics.
<p>
</p>
<h2>Computational Geometry</h2>
Computational geometry is the study of efficient
ways to represent and manipulate geometry within the computer. Typical problems
include testing whether two objects collide, deciding how to break up a polygon
into triangles, and finding the nearest point in a group to a given location.
This area is a blend of algorithms, data structures and mathematics. Researchers
in graphics who work on creating shapes (modeling) draw heavily upon this area.
<p>Book recommendations:
</p>
<p>
</p>
<dl><dd>Computational Geometry in C
</dd><dd>Joseph O'Rourke
</dd><dd>Cambridge University Press
</dd><dd>[undergraduate text]
</dd><dd>Computational Geometry: An Introduction
</dd><dd>Franco Preparata and Michael Shamos
</dd><dd>Springer-Verlag
</dd><dd>[the classic text, somewhat dated] </dd></dl>
<h2>Concluding Words: Applied and Pure Mathematics</h2>
One common thread to many
of the mathematical topics that are associate with graphics is that they are
from the applied side instead of the theoretical side of mathematics. This
should not come as a surprise. Many of the problems in computer graphics are
closely tied to problems that physicists and engineers have studied, and the
mathematical tools of the physicist and of the engineer are overwhelmingly the
tools that graphics researchers use. Most of the topics that make up theoretical
("pure") mathematics are seldom put to use in computer graphics. This should not
be taken as an absolute truth, however. We should pay attention to examples from
other fields: molecular biology is now drawing upon knot theory for the study of
DNA dynamics, and subatomic physics makes use of abstract group theory. Who can
tell when a "pure" mathematics topic will be put to use in computer graphics?
<p>There are a few areas of mathematics that seem as though they ought to be
important and yet never really play a large part in computer graphics. Perhaps
the most interesting of these areas is topology. The usual one-sentence
description of topology is the study of why a doughnut and a coffee cup are the
same. The answer is that they are both surfaces with one hole. Here we are
talking about ideas from topology. Aren't surfaces a big part of computer
graphics? Yes, but it turns out that most of the ideas in topology that are
useful to graphics can be learned in a first course in differential geometry.
Differential geometry studies the *shapes* of surfaces, whereas topology studies
things such as which parts of a surface are next to which other parts. I have
seen very little topology that is put to use in graphics, and I believe that
this is because much of topology is concerned with rather abstract sets, and
that much of topology is far removed from the concepts in three dimensional
Euclidean space that is so central to most of graphics. There are times when the
formalism of topology (the symbolic notation) is a convenient way to express
ideas in graphics, but the actual tools from abstract topology so seldom play a
role in graphics. Study this beautiful subject for its own sake, but don't
expect an immediate payoff for graphics!
</p>
<p>I have been asked a few times whether either abstract algebra (group theory,
rings, etc.) or number theory play a role in computer graphics. Not much that I
have seen. These subjects, like topology, are areas that are full of beautiful
ideas. Unfortunately these ideas seldom find their way into computer graphics.
</p>
<p>Mathematics&nbsp;for&nbsp;Computer&nbsp;Graphics<br>数学在计算机图形学中的应用<br>Greg&nbsp;Turk,&nbsp;August&nbsp;1997<br>&nbsp;&#8220;学习计算机图形学需要多少的数学？&#8221;这是初学者最经常问的问题。答案取决于你想在计算机图形学领域钻研多深。如果仅仅使用周围唾手可得的图形软件，你不需要知道多少数学知识。如果想学习计算机图形学的入门知识，我建议你读一读下面所写的前两章（代数，三角学和线性代数）。如果想成为一名图形学的研究者，那么对数学的学习将是活到老，学到老。<br>如果你并不特别喜欢数学，是否仍有在计算机图形学领域工作的机会？是的，计算机图形学的确有一些方面不需要考虑太多的数学问题。你不应该因为数学成绩不好而放弃它。不过，如果学习了更多的数学知识，似乎你将在研究课题上有更多的选择余地。<br>对于在计算机图形学中哪些数学才是重要的还没有明确的答案。这领域里不同的方面要求掌握不同的数学知识，也许兴趣将会决定了你的方向。以下介绍我认为对于计算机图形学有用的数学。别以为想成为一名图形学的研究者就必须精通各门数学！为了对用于图形学的数学有一个全面的看法，我特地列出了很多方面。但是许多研究者从不需要考虑下面提到的数学。<br>最后，虽然读了这篇文章后，你应该会对数学在计算机图形学中的应用有所了解，不过这些观点完全是我自己的。也许你应该阅读更多的此类文章，或者至少从其他从事计算机图形学工作的人那里了解不同的学习重点。现在开始切入正题。
</p>
<p>代数和三角学<br>对于计算机图形学的初学者来说，高中的代数和三角学可能是最重要的数学。日复一日，我从简单的方程解出一个或更多的根。我时常还要解决类似求一些几何图形边长的简单三角学问题。代数和三角学是计算机图形学的最基础的知识。<br>那么高中的几何学怎么样呢？可能让人惊讶，不过在多数计算机图形学里，高中的几何学并不经常被用到。原因是许多学校教的几何学实际上是如何建立数学证明的课程。虽然证明题对提高智力显然是有效的，但对于计算机图形学来说，那些与几何课有关的定理和证明并不常被用到。如果你毕业于数学相关领域（包括计算机图形学），就会发现虽然你在证明定理，不过这对开始学习图形学不是必要的。<br>如果精通代数和三角学，就可以开始读一本计算机图形学的入门书了。下一个重要的用于计算机图形学的数学——线性代数，多数此类书籍至少包含了一个对线性代数的简要介绍。<br>推荐的参考书:&nbsp;<br>Computer&nbsp;Graphics:&nbsp;Principles&nbsp;and&nbsp;Practice&nbsp;<br>James&nbsp;Foley,&nbsp;Andries&nbsp;van&nbsp;Dam,&nbsp;Steven&nbsp;Feiner,&nbsp;John&nbsp;Hughes&nbsp;<br>Addison-Wesley&nbsp;<br>[虽然厚重，可是我很喜欢]</p>
<p>线性代数<br>线性代数的思想贯穿于计算机图形学。事实上，只要牵涉到几何数值表示法,就常常抽象出例如x,y,z坐标之类的数值，我们称之为矢量。图形学自始至终离不开矢量和矩阵。用矢量和矩阵来描述旋转，平移，或者缩放是再好不过了。高中和大学都有线性代数的课程。只要想在计算机图形学领域工作，就应该打下坚实的线性代数基础。我刚才提到，许多图形学的书都有关于线性代数的简要介绍——足够教给你图形学的第一门课。<br>推荐的参考书:&nbsp;<br>Linear&nbsp;Algebra&nbsp;and&nbsp;Its&nbsp;Applications&nbsp;<br>Gilbert&nbsp;Strang&nbsp;<br>Academic&nbsp;Press</p>
<p>微积分学&nbsp;<br>微积分学是高级计算机图形学的重要成分。如果打算研究图形学，我强烈建议你应该对微积分学有初步认识。理由不仅仅是微积分学是一种很有用的工具，还有许多研究者用微积分学的术语来描述他们的问题和解决办法。另外，在许多重要的数学领域，微积分学被作为进一步学习的前提。学习了基本代数之后，微积分学又是一种能为你打开多数计算机图形学与后继的数学学习之门的课程。<br>微积分学是我介绍的最后一个中学课程，以下提及的科目几乎全部是大学的课程。</p>
<p>微分几何学<br>微分几何学研究支配光滑曲线，曲面的方程组。如果你要计算出经过某个远离曲面的点并垂直于曲面的矢量（法向矢量）就会用到微分几何学。让一辆汽车以特定速度在曲线上行驶也牵涉到微分几何学。有一种通用的绘制光滑曲面的图形学技术，叫做&#8220;凹凸帖图&#8221;，这个技术用到了微分几何学。如果要着手于用曲线和曲面来创造形体（在图形学里称之为建模）你至少应该学习微分几何学的基础。<br>推荐的参考书:&nbsp;<br>Elementary&nbsp;Differential&nbsp;Geometry&nbsp;<br>Barrett&nbsp;O'Neill&nbsp;<br>Academic&nbsp;Press&nbsp;</p>
<p>数值方法<br>几乎任何时候，我们在计算机里用近似值代替精确值来表示和操作数值，所以计算过程总是会有误差。而且对于给定的数值问题，常常有多种解决的方法，一些方法会更块，更精确或者对内存的需求更少。数值方法研究的对象包括&#8220;计算方法&#8221;和&#8220;科学计算&#8221;等等。这是一个很广阔的领域，而且我将提及的其他几门数学其实是数值方法的一些分支。这些分支包括抽样法理论，矩阵方程组，数值微分方程组和最优化。<br>推荐的参考书:&nbsp;<br>Numerical&nbsp;Recipes&nbsp;in&nbsp;C:&nbsp;The&nbsp;Art&nbsp;of&nbsp;Scientific&nbsp;Computing&nbsp;<br>William&nbsp;Press,&nbsp;Saul&nbsp;Teukolsky,&nbsp;William&nbsp;Vetterling&nbsp;and&nbsp;Brian&nbsp;Flannery&nbsp;<br>Cambridge&nbsp;University&nbsp;Press&nbsp;<br>[这本参考书很有价值可是很少作为教材使用]</p>
<p>抽样法理论和信号处理<br>在计算机图形学里我们反复使用储存在正规二维数组里的数字集合来表示一些对象，例如图片和曲面。这时，我们就要用抽样法来表示这些对象。如果要控制这些对象的品质，抽样法理论就变得尤为重要。抽样法应用于图形学的常见例子是当物体被绘制在屏幕上时，它的轮廓呈现锯齿状的边缘。这锯齿状的边缘（被认为是&#8220;混淆&#8221;现象）是非常让人分散注意力的，用抽样法中著名的技术例如回旋，傅立叶变换，空间和频率的函数表示就能把这个现象减少到最小。这些思想在图像和音频处理领域是同样重要的。<br>推荐的参考书:&nbsp;<br>The&nbsp;Fourier&nbsp;Transform&nbsp;and&nbsp;Its&nbsp;Applications&nbsp;<br>Ronald&nbsp;N.&nbsp;Bracewell&nbsp;<br>McGraw&nbsp;Hill</p>
<p>矩阵方程组<br>计算机图形学的许多问题要用到矩阵方程组的数值解法。一些涉及矩阵的问题包括：找出最好的位置与方向以使对象们互相匹配（最小二乘法），创建一个覆盖所给点集的曲面，并使皱折程度最小（薄板样条算法），还有材质模拟，例如水和衣服等。在图形学里矩阵表述相当流行，因此在用于图形学的数学中我对矩阵方程组的评价是很高的。<br>推荐的参考书:&nbsp;<br>Matrix&nbsp;Computations&nbsp;<br>Gene&nbsp;Golub&nbsp;and&nbsp;Charles&nbsp;Van&nbsp;Loan&nbsp;<br>Johns&nbsp;Hopkins&nbsp;University&nbsp;Press</p>
<p>物理学<br>物理学显然不是数学的分支，它是自成一家的学科。但是在计算机图形学的某些领域，物理学和数学是紧密联系的。在图形学里，牵涉物理学的问题包括光与物体的表面是怎样互相影响的，人与动物的移动方式，水与空气的流动。为了模拟这些自然现象，物理学的知识是必不可少的。这和解微分方程紧密联系，我将会在下一节提到微分方程。</p>
<p>微分方程的数值解法<br>我相信对于计算机图形学来说，解微分方程的技巧是非常重要的。像我们刚才讨论的，计算机图形学致力于模拟源于真实世界的物理系统。波浪是怎样在水里形成的，动物是怎样在地面上行走的，这就是两个模拟物理系统的例子。模拟物理系统的问题经常就是怎样解微分方程的数值解。请注意，微分方程的数值解法与微分方程的符号解法是有很大差异的。符号解法求出没有误差的解，而且时常只用于一些非常简单的方程。有时大学课程里的&#8220;微分方程&#8221;只教符号解法，不过这并不会对多数计算机图形学的问题有帮助。<br>在对物理系统的模拟中，我们把世界细分为许多表示成矢量的小元素。然后这些元素之间的关系就可以用矩阵来描述。虽然要处理的矩阵方程组往往没有很精确的解，但是取而代之的是执行了一系列的计算，这些计算产生一个表示成数列的近似解。这就是微分方程的数值解法。请注意，矩阵方程的解法与微分方程数值解法的关系是很密切的。&nbsp;</p>
<p>最优化<br>在计算机图形学里，我们常常为了期望的目标寻求一种合适的描述对象或者对象集的方法。例如安排灯的位置使得房间的照明看起来有种特殊的&#8220;感觉&#8221;，动画里的人物要怎样活动四肢才能实现一个特殊的动作，怎样排版才不会使页面混乱。以上这些例子可以归结为最优化问题。十年前的计算机图形学几乎没有最优化技术的文献，不过最近这个领域越来越重视最优化理论。我认为在计算机图形学里，最优化的重要性将会日益增加。</p>
<p>概率论与统计学<br>计算机图形学的许多领域都要用到概率论与统计学。当研究者涉足人类学科时，他们当然需要统计学来分析数据。图形学相关领域涉及人类学科，例如虚拟现实和人机交互(HCI)。另外，许多用计算机描绘真实世界的问题牵涉到各种未知事件的概率。两个例子：一棵成长期的树,它的树枝分杈的概率；虚拟的动物如何决定它的行走路线。最后，一些解高难度方程组的技巧用了随机数来估计方程组的解。重要的例子：蒙特卡罗方法经常用于光如何传播的问题。以上仅是一部分在计算机图形学里使用概率论和统计学的方法。</p>
<p>计算几何学<br>计算几何学研究如何用计算机高效地表示与操作几何体。典型问题如，碰撞检测，把多边形分解为三角形，找出最靠近某个位置的点，这个学科包括了运算法则，数据结构和数学。图形学的研究者，只要涉足创建形体（建模），就要大量用到计算几何学。<br>推荐的参考书:&nbsp;<br>Computational&nbsp;Geometry&nbsp;in&nbsp;C&nbsp;<br>Joseph&nbsp;O'Rourke&nbsp;<br>Cambridge&nbsp;University&nbsp;Press&nbsp;<br>[大学教材]&nbsp;<br>Computational&nbsp;Geometry:&nbsp;An&nbsp;Introduction&nbsp;<br>Franco&nbsp;Preparata&nbsp;and&nbsp;Michael&nbsp;Shamos&nbsp;<br>Springer-Verlag&nbsp;<br>[很经典，不过有点旧了]</p>
<p>总结：数学应用和数学理论<br>对于图形学来说，以上提到的许多数学学科都有个共同点：比起这些数学的理论价值，我们更倾向于发掘它们的应用价值。不要惊讶。图形学的许多问题和物理学者与工程师们研究的问题是紧密联系的，并且物理学者与工程师们使用的数学工具正是图形学研究者们使用的。多数研究纯数学理论的学科从不被用于计算机图形学。不过这不是绝对的。请注意这些特例：分子生物学正利用节理论来研究DNA分子动力学，亚原子物理学用到了抽象群论。也许有一天，纯数学理论也能推动计算机图形学的发展，谁知道呢？<br>有些看来重要的数学实际上在计算机图形学里不常被用到。可能拓扑学是此类数学中最有意思的。用一句话来形容拓扑学，它研究油炸圈饼与咖啡杯为什么在本质上是相同的。答案是他们都是只有一个洞的曲面。我们来讨论一下拓扑学的思想。虽然曲面是计算机图形学的重要成分，不过微分几何学的课程已经涵盖了多数对图形学有用的拓扑学知识。微分几何学研究曲面的造型，可是拓扑学研究曲面的相邻关系。我觉得拓扑学对于图形学来说几乎没用，这是由于拓扑学关心抽象的事物，而且拓扑学远离了多数图形学的核心——三维欧氏空间的概念。对于图形学来说，拓扑学的形式（符号表示法）是表达思想的简便方法，不过图形学很少用到抽象拓扑学的实际工具。对图形学来说，拓扑学像一个好看的花瓶，不过别指望它能立即带给你回报。<br>有人曾经这么问我，计算机图形学是否用到了抽象代数（群论，环，等等&#8230;.）或者数论。我没怎么遇到过。和拓扑学一样，这些学科有很多美好的思想。可是很不幸，这些思想很少用于计算机图形学。<br>--The&nbsp;End--</p>
<p>[小鹏翻译&nbsp;email:&nbsp;rggg_clp@163.com]</p>
<br><br><img src ="http://www.cppblog.com/bneliao/aggbug/60482.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bneliao/" target="_blank">bneliao</a> 2008-08-31 04:22 <a href="http://www.cppblog.com/bneliao/articles/60482.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OpenGL开发库的介绍zz</title><link>http://www.cppblog.com/bneliao/articles/60480.html</link><dc:creator>bneliao</dc:creator><author>bneliao</author><pubDate>Sat, 30 Aug 2008 19:56:00 GMT</pubDate><guid>http://www.cppblog.com/bneliao/articles/60480.html</guid><wfw:comment>http://www.cppblog.com/bneliao/comments/60480.html</wfw:comment><comments>http://www.cppblog.com/bneliao/articles/60480.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bneliao/comments/commentRss/60480.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bneliao/services/trackbacks/60480.html</trackback:ping><description><![CDATA[<meta http-equiv="Content-Type" content="text/html; charset=" utf-8="">
<meta name="ProgId" content="Word.Document">
<meta name="Generator" content="Microsoft Word 12">
<meta name="Originator" content="Microsoft Word 12">
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Caa%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml">
<link rel="Edit-Time-Data" href="file:///C:%5CDOCUME%7E1%5Caa%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_editdata.mso"><!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<link rel="themeData" href="file:///C:%5CDOCUME%7E1%5Caa%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx">
<link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5Caa%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"><!--[if gte mso 9]><xml>
Normal
0
false
7.8 磅
0
2
false
false
false
EN-US
ZH-CN
X-NONE
MicrosoftInternetExplorer4
</xml><![endif]--><!--[if gte mso 9]><xml>
</xml><![endif]--><style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;
mso-font-charset:2;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;
mso-font-charset:1;
mso-generic-font-family:roman;
mso-font-format:other;
mso-font-pitch:variable;
mso-font-signature:0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
{font-family:新宋体;
panose-1:2 1 6 9 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@新宋体";
panose-1:2 1 6 9 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:宋体;
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;
mso-font-kerning:1.0pt;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:42.55pt;
mso-footer-margin:49.6pt;
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:644120006;
mso-list-template-ids:-697145344;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1
{mso-list-id:1067263975;
mso-list-template-ids:-519924140;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2
{mso-list-id:1433359008;
mso-list-template-ids:350390366;}
@list l2:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l3
{mso-list-id:1728796189;
mso-list-template-ids:-613503608;}
@list l3:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l4
{mso-list-id:1817405750;
mso-list-template-ids:769680314;}
@list l4:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l5
{mso-list-id:1912345468;
mso-list-template-ids:-1579885288;}
@list l5:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l6
{mso-list-id:2133940067;
mso-list-template-ids:1508027148;}
@list l6:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.5pt;
mso-bidi-font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-font-kerning:1.0pt;}
</style>
<![endif]-->
<p>开发基于OpenGL的应用程序，必须先了解OpenGL的库函数。它采用C语言风格，提供大量的函数来进行图形的处理和显示。OpenGL库函数的命名方式非常有规律。所有OpenGL函数采用了以下格式： </p>
<p>&lt;库前缀&gt;&lt;根命令&gt;&lt;可选的参数个数&gt;&lt;可选的参数类型&gt;</p>
<p>　　库前缀有gl、glu、aux、glut、wgl、glx、agl等等，分别表示该函数属于OpenGL那个开
发库，从函数名后面中还可以看出需要多少个参数以及参数的类型。I代表int型，f代表float型，d代表double型，u代表无符号整型。例如 glVertex3fv()表示了该函数属于gl库，参数是三个float型参数指针。我们用glVertex*()</p>
<p>来表示这一类函数。</p>
<p>
</p>
<p align="center"><img src="http://www.86vr.com/files/2005-07/6197/6197.jpg" border="0" width="377" height="198"></p>
<p>&#160;</p>
<p>　　OpenGL函数库相关的API有核心库(gl)、实用库(glu)、辅助库(aux)、实用工具库(glut)、窗口库(glx、 agl、wgl)和扩展函数库等。从图可以看出，gl是核心，glu是对gl的部分封装。glx、agl、wgl 是针对不同窗口系统的函数。glut是为跨平台的OpenGL程序的工具包，比aux功能强大。扩展函数库是硬件厂商为实现硬件更新利用OpenGL的扩 展机制开发的函数。下面逐一对这些库进行详细介绍。</p>
<p><strong>1</strong><strong>．OpenGL核心库</strong></p>
<p>　　核心库包含有115个函数，函数名的前缀为gl。这部分函数用于常规的、核心的图形处理。此函数由gl.dll来负责解释执行。由于许多函数可以接收不同数以下几类。据类型的参数，因此派生出来的函数原形多达300多个。核心库中的函数主要可以分为以下几类函数：</p>
<ul type="disc">
    <li class="MsoNormal" style="text-align: left;">绘制基本几何图元的函数：glBegain()、glEnd()、glNormal*()、glVertex*()； </li>
    <li class="MsoNormal" style="text-align: left;">矩阵操作、几何变换和投影变换的函数：如矩阵入栈函数glPushMatrix()，矩阵出栈函数glPopMatrix()，装载矩阵函数 glLoadMatrix()，矩阵相乘函数glMultMatrix()，当前矩阵函数glMatrixMode()和矩阵标准化函数 glLoadIdentity()，几何变换函数glTranslate*()、glRotate*()和glScale*()，投影变换函数 glOrtho()、glFrustum()和视口变换函数glViewport()；</li>
    <li class="MsoNormal" style="text-align: left;">颜色、光照和材质的函数：如设置颜色模式函数glColor*()、glIndex*()，设置光照效果的函数glLight*() 、glLightModel*()和设置材质效果函数glMaterial()；</li>
    <li class="MsoNormal" style="text-align: left;">显示列表函数：主要有创建、结束、生成、删除和调用显示列表的函数glNewList()、glEndList()、glGenLists()、glCallList()和glDeleteLists()；</li>
    <li class="MsoNormal" style="text-align: left;">纹理映射函数：主要有一维纹理函数glTexImage1D()、二维纹理函数glTexImage2D()、设置纹理参数、纹理环境和纹理坐标的函数glTexParameter*()、glTexEnv*()和glTetCoord*()；</li>
    <li class="MsoNormal" style="text-align: left;">特殊效果函数：融合函数glBlendFunc()、反走样函数glHint()和雾化效果glFog*()；</li>
    <li class="MsoNormal" style="text-align: left;">光栅化、象素操作函数：如象素位置glRasterPos*()、线型宽度glLineWidth()、多边形绘制模式glPolygonMode()，读取象素glReadPixel()、复制象素glCopyPixel()；</li>
    <li class="MsoNormal" style="text-align: left;">选择与反馈函数：主要有渲染模式glRenderMode()、选择缓冲区glSelectBuffer()和反馈缓冲区glFeedbackBuffer()；</li>
    <li class="MsoNormal" style="text-align: left;">曲线与曲面的绘制函数：生成曲线或曲面的函数glMap*()、glMapGrid*()，求值器的函数glEvalCoord*() glEvalMesh*()；</li>
    <li class="MsoNormal" style="text-align: left;">状态设置与查询函数：glGet*()、glEnable()、glGetError()。</li>
</ul>
<p><strong>2</strong><strong>．OpenGL实用库The OpenGL Utility Library (GLU)</strong></p>
<p>　 　包含有43个函数，函数名的前缀为glu。OpenGL提供了强大的但是为数不多的绘图命令，所有较复杂的绘图都必须从点、线、面开始。Glu
为了减轻繁重的编程工作，封装了OpenGL函数，Glu函数通过调用核心库的函数，为开发者提供相对简单的用法，实现一些较为复杂的操作。此函数由 glu.dll来负责解释执行。OpenGL中的核心库和实用库可以在所有的OpenGL平台上运行。主要包括了以下几种：</p>
<ul type="disc">
    <li class="MsoNormal" style="text-align: left;">辅助纹理贴图函数：gluScaleImage()
    、gluBuild1Dmipmaps()、gluBuild2Dmipmaps()；
    </li>
    <li class="MsoNormal" style="text-align: left;">坐标转换和投影变换函数：定义投影方式函数gluPerspective()、gluOrtho2D() 、gluLookAt()，拾取投影视景体函数gluPickMatrix()，投影矩阵计算gluProject()和gluUnProject()；</li>
    <li class="MsoNormal" style="text-align: left;">多边形镶嵌工具：gluNewTess()、gluDeleteTess()、gluTessCallback()、gluBeginPolygon()、gluTessVertex()、gluNextContour()、gluEndPolygon()；</li>
    <li class="MsoNormal" style="text-align: left;">二次曲面绘制工具，主要有绘制球面、锥面、柱面、圆环面gluNewQuadric()、gluSphere()、gluCylinder()、gluDisk()、gluPartialDisk()、gluDeleteQuadric()；</li>
    <li class="MsoNormal" style="text-align: left;">非均匀有理B样条绘制工具：主要用来定义和绘制Nurbs曲线和曲面，包括gluNewNurbsRenderer()、 gluNurbsCurve()、gluBeginSurface()、gluEndSurface()、gluBeginCurve()、 gluNurbsProperty()；</li>
    <li class="MsoNormal" style="text-align: left;">错误反馈工具：获取出错信息的字符串gluErrorString()。</li>
</ul>
<p><strong>3</strong><strong>．OpenGL辅助库</strong></p>
<p>　 　包含有31个函数，函数名前缀为aux。这部分函数提供窗口管理、输入输出处理以及绘制一些简单三维物体。此函数由glaux.dll来负责解释执行。 创建aux库是为了学习和编写OpenGL程序，它更像是一个用于测试创意的预备基础接管。Aux库在windows实现有很多错误，因此很容易导致频繁 的崩溃。在跨平台的编程实例和演示中，aux很大程度上已经被glut库取代。OpenGL中的辅助库不能在所有的OpenGL平台上运行。</p>
<p>　　辅助库函数主要包括以下几类：</p>
<ul type="disc">
    <li class="MsoNormal" style="text-align: left;">窗口初始化和退出函数：auxInitDisplayMode()和auxInitPosition()； </li>
    <li class="MsoNormal" style="text-align: left;">窗口处理和时间输入函数：auxReshapeFunc()、auxKeyFunc()和auxMouseFunc()； </li>
    <li class="MsoNormal" style="text-align: left;">颜色索引装入函数：auxSetOneColor()；
    </li>
    <li class="MsoNormal" style="text-align: left;">三 维物体绘制函数：包括了两种形式网状体和实心体，如绘制立方体auxWireCube()和 auxSolidCube()。这里以网状体为例，长方体auxWireBox()、环形圆纹面auxWireTorus()、圆柱 auxWireCylinder()、二十面体auxWireIcosahedron()、八面体auxWireOctahedron()、四面体
    auxWireTetrahedron()、十二面体auxWireDodecahedron()、圆锥体auxWireCone()和茶壶 auxWireTeapot()；
    </li>
    <li class="MsoNormal" style="text-align: left;">背景过程管理函数：auxIdleFunc()；</li>
    <li class="MsoNormal" style="text-align: left;">程序运行函数：auxMainLoop()。</li>
</ul>
<p><strong>4</strong><strong>．OpenGL工具库 OpenGL Utility Toolkit</strong></p>
<p>　 　包含大约30多个函数，函数名前缀为glut。glut是不依赖于窗口平台的OpenGL工具包，由Mark KLilgrad在SGI编写（现在在Nvidia），目的是隐藏不同窗口平台API的复杂度。 函数以glut开头，它们作为aux库功能更强的替代品，提供更为复杂的绘制功能，此函数由glut.dll来负责解释执行。由于glut中的窗口管理函 数是不依赖于运行环境的，因此OpenGL中的工具库可以在X-Window, Windows NT, OS/2等系统下运行，特别适合于开发不需要复杂界面的OpenGL示例程序。对于有经验的程序员来说，一般先用glut理顺3D图形代码，然后再集成为 完整的应用程序。</p>
<p>　　这部分函数主要包括：</p>
<ul type="disc">
    <li class="MsoNormal" style="text-align: left;">窗口操作函数：窗口初始化、窗口大小、窗口位置函数等[glutInit()、glutInitDisplayMode()、glutInitWindowSize()、glutInitWindowPosition()]；</li>
    <li class="MsoNormal" style="text-align: left;">回调函数：响应刷新消息、键盘消息、鼠标消息、定时器函数[GlutDisplayFunc()、glutPostRedisplay()、 glutReshapeFunc()、glutTimerFunc()、glutKeyboardFunc()、glutMouseFunc()]；</li>
    <li class="MsoNormal" style="text-align: left;">创建复杂的三维物体：这些和aux库的函数功能相同；</li>
    <li class="MsoNormal" style="text-align: left;">菜单函数：创建添加菜单的函数GlutCreateMenu()、glutSetMenu()、glutAddMenuEntry()、glutAddSubMenu()和glutAttachMenu()；</li>
    <li class="MsoNormal" style="text-align: left;">程序运行函数：glutMainLoop()。</li>
</ul>
<p><strong>5</strong><strong>．Windows专用库</strong></p>
<p>　　针对windows平台的扩展，包含有16个函数，函数名前缀为wgl。这部分函数主要用于连接OpenGL和Windows ，以弥补OpenGL在文本方面的不足。&nbsp;&nbsp; Windows专用库只能用于Windows环境中。</p>
<p>　　这类函数主要包括以下几类：</p>
<ul type="disc">
    <li class="MsoNormal" style="text-align: left;">绘图上下文相关函数：wglCreateContext()、wglDeleteContext()、wglGetCurrentContent()、wglGetCurrentDC()、wglDeleteContent()；</li>
    <li class="MsoNormal" style="text-align: left;">文字和文本处理函数：wglUseFontBitmaps()、wglUseFontOutlines()；</li>
    <li class="MsoNormal" style="text-align: left;">覆盖层、地层和主平面层处理函数：wglCopyContext()、wglCreateLayerPlane()、wglDescribeLayerPlane()、wglReakizeLayerPlatte()；</li>
    <li class="MsoNormal" style="text-align: left;">其他函数：wglShareLists()、wglGetProcAddress()。</li>
</ul>
<p><strong>6</strong><strong>．Win32 API函数库</strong></p>
<p>　　包含有6个函数，函数名无专用前缀，是win32扩展函数。这部分函数主要用于处理像素存储格式和双帧缓存；这6个函数将替换Windows GDI中原有的同样的函数。Win32API函数库只能用于Windows 95/98/NT环境中。</p>
<p><strong>7</strong><strong>．X窗口专用库</strong></p>
<p>　　是针对Unix和Linux的扩展函数。包括渲染上下文、绘制图元、显示列表、纹理贴图等；</p>
<ul type="disc">
    <li class="MsoNormal" style="text-align: left;">初始化：glXQueryExtension()；
    </li>
    <li class="MsoNormal" style="text-align: left;">渲染上下文函数：glXCreateContext()、glXDestroyContext()、glXCopyContext()、glXMakeCurrent()、glXCreateGLXPixmap()；</li>
    <li class="MsoNormal" style="text-align: left;">执行：glXWaitGL()、glXWaitX()；</li>
    <li class="MsoNormal" style="text-align: left;">缓冲区和字体：glXSwapBuffers()、glXUseXFont()。</li>
</ul>
<p><strong>8</strong><strong>．其他扩展库</strong></p>
<p>　 　这些函数可能是新的OpenGL函数，并没有在标准OpenGL库中实现，或者它们是用来扩展已存在的OpenGL函数的功能。和glu、glx和 wgl一样，这些OpenGL扩展是由硬件厂商和厂商组织开发的。OpenGL扩展(OpenGL Extention)包含了大量的扩展API函数。</p>
<p>　 　随着硬件的更新，硬件厂商首先向SGI申请登记新的扩展，编写规格说明书（specification）。然后按照说明书进行开发扩展程序。不同的 OpenGL实现（OpenGL Implementation）支持的扩展可能不一样，只有随着某一扩展的推广与应用以及硬件技术的提高该扩展才会在所有的OpenGL实现中被给予支 持，从而最终成为OpenGL标准库的一部分。扩展由SGI维护，在SGI网站上列出了目前公开的已注册的扩展及其官方说明书。扩展源由扩展函数的后缀来
指明(或使用扩展常量后缀)。例如，后缀WIN表明一个符合Windows规范的扩展，EXT或ARB后缀表明该扩展由多个卖主定义。</p>
<p>下面给出OpenGL官方规定的命名规则：</p>
<ul type="disc">
    <li class="MsoNormal" style="text-align: left;">ARB &#8211; OpenGL
    Architecture Review Board正式核准的扩展，往往由厂商开发的扩展发展而来，如果同时存在厂商开发的扩展和ARB扩展，应该优先使用ARB扩展；</li>
    <li class="MsoNormal" style="text-align: left;">EXT &#8211; 多家OpenGL厂商同意支持的扩展；</li>
    <li class="MsoNormal" style="text-align: left;">HP &#8211; Hewlett-Packard
    惠普；</li>
    <li class="MsoNormal" style="text-align: left;">IBM &#8211;
    International Business Machines ；</li>
    <li class="MsoNormal" style="text-align: left;">KTX &#8211; Kinetix,
    maker of 3D Studio Max ；</li>
    <li class="MsoNormal" style="text-align: left;">INTEL &#8211; Intel 公司；</li>
    <li class="MsoNormal" style="text-align: left;">NV &#8211; NVIDIA 公司；</li>
    <li class="MsoNormal" style="text-align: left;">MESA &#8211; Brian
    Paul&#8217;s freeware portable OpenGL implementation ；</li>
    <li class="MsoNormal" style="text-align: left;">SGI &#8211; Silicon
    Graphics公司开发的扩展；</li>
    <li class="MsoNormal" style="text-align: left;">SGIX &#8211;
    Silicon Graphics (experimental) 公司开发的实验性扩展；</li>
    <li class="MsoNormal" style="text-align: left;">SUN &#8211; Sun
    Microsystems；</li>
    <li class="MsoNormal" style="text-align: left;">WIN &#8211; Microsoft 。</li>
</ul>
<p>　　由于OpenGL扩展在针对不同平台和不同驱动，OpenGL不可能把所有的接口程序全部放到gl.h、glx.h、wgl.h中，而是将这些函数头放在了glext.h、glxext.h和wglext.h中。这些扩展被看作时OpenGL核心库规范的增加和修改。</p><img src ="http://www.cppblog.com/bneliao/aggbug/60480.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bneliao/" target="_blank">bneliao</a> 2008-08-31 03:56 <a href="http://www.cppblog.com/bneliao/articles/60480.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>zz白话说学计算机图形学</title><link>http://www.cppblog.com/bneliao/articles/60210.html</link><dc:creator>bneliao</dc:creator><author>bneliao</author><pubDate>Wed, 27 Aug 2008 20:57:00 GMT</pubDate><guid>http://www.cppblog.com/bneliao/articles/60210.html</guid><wfw:comment>http://www.cppblog.com/bneliao/comments/60210.html</wfw:comment><comments>http://www.cppblog.com/bneliao/articles/60210.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bneliao/comments/commentRss/60210.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bneliao/services/trackbacks/60210.html</trackback:ping><description><![CDATA[白话说学计算机图形学<br>一个很好的学习途径就是国外大学开的CG的课程，standford，unc，unm，waterloo等等，等等，
一堆大学，都可以下到课件，以及相关的论文，standford的&#8220;real time graphics architecture&#8221;可是kurt Akeley开的哦。<br>另外就是source code，包括mesa，standford的glsim，还有人用c sharp做的csgl等，也不少。这些东西很值得细细研究，只是很花时间啊。<br>我也是才学这方面的，不过我觉得方法上面还是top－down的方法好些，对一些东西，有感性认识了，再钻下去会比较好。
<p>【引言】<br>什么是计算机图形学？ 本文尽量避免给它做严格的定义，但是通常来说，计算机图形学是数字图象处理的逆过程，这只是一个不确切的定义，后面我们会看到，实际上，计算机图形学、数字图象处理和计算机视觉在很多地方的区别不是非常清晰的，很多概念是相通的。<br>计算机图形学是用计算机来画东西的学科，数字图象处理是把外界获得的图象用计算机进行处理的学科。在法国，图形图象是一门课程。<br>如何学习计算机图形学呢？除了计算机图形学的基础知识以外，你还需要有以下的知识，你懂的越多，当然做的越好。<br>* 英语， 你一定要把英语学好，如果你想学习计算机图形学的话，尽量看英文的书籍和资料<br>* 数学， 计算机图形学里面的数学用的比较多，，我们可以列举一些常用的：<br>高等数学，数值分析，微分几何，拓扑，概率， 插值理论，（偏）微分方程&#8230;<br>* 物理， 如果你要进行基于物理的建模，一些物理理论是要学习的：<br>力学（运动学，动力学，流体力学&#8230;），光学，有限元&#8230;<br>* 编程语言： C或C++是计算机图形学最通用的&#8216;普通话&#8217;，<br>* 数据结构： 你需要数据结构来描述你的图形对象，除了通用的链表、树等数据结构外，图形学还有自己特殊的数据结构<br>* 其他类别： 有的时候你需要其他学科的知识，根据你的需要去学习吧 </p>
<p>上面列举的不是你必须学习的东西，而是计算机图形学可能会用到的东西，一定要记住，不要指望通过一本教材就学会计算机图形学，它比你想象的要复杂的多。 </p>
<p>【图形学的问题】<br>每个学科都有自己学科的特定问题，图形学要解决的是如何画出图来，得到需要的效果，当然这是图形学最大的一个问题。 </p>
<p>在开始学习计算机图形学的时候，找一本简单的书看，对计算机图形学有个大概的认识，你就可以开始图形学之旅了： </p>
<p>OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 1.4, Fourth Edition<br>OpenGL SuperBible (3rd Edition)  </p>
<p>是比较好的学习计算机图形学的入门教材，在练中去学，一开始就去啃Foley的<br>Computer Graphics: Principles and Practice, Second Edition in C <br>不是好主意，会看的一头雾水，一本什么都讲的书的结果往往是什么都没讲清楚。<br>当你把OpenGL的基本内容掌握之后，你对图形学就有了大概的了解了。 </p>
<p>那么下面你可以来学习一下计算机图形学的数据结构和算法，下面的书比较适合：<br>Joseph O'Rourke 的Computational Geometry in C，书里面有C的源代码，讲述简单，清晰，适合程序员学习。 </p>
<p>总的来说，计算机图形学涉及到2大部分：建模和渲染<br>(1)<strong> 建模<br></strong> 你想画一个东西，首先要有它的几何模型，那么这个几何模型从什么地方来呢？下面的书很不错的：<br>Gerald Farin 的Curves and Surfaces for CAGD: A Practical Guide<br>这本书就有一点的难度了，呵呵，要努力看啊。这本书算是CAGD (计算机辅助几何设计)的经典图书，CAGD方面的全貌，还有2本很好的讲述曲面的书Bezier和Nurbs的书<br>Les A. Piegl, Wayne Tiller 的The Nurbs Book <br>书里面有NURBS曲线、曲面的程序伪代码，很容易改成C的，书讲的通俗、易懂，但是你要有耐心看的：） </p>
<p>《曲线与曲面的数学》<br>这本书是法国人写的中文翻译版，里面还有Bezie本人写的序J，翻译的很不错的，看了你就掌握Bezier曲面技术了。<br>还有其他的一些造型技术，比如：<br>隐式曲面(Implicit Surface)的造型：<br>就是用函数形式为F( x ,y ,z ) = 0的曲面进行造型，这样的造型技术适合描述动物器官一样的肉乎乎的东西，有2本书推荐大家：<br>Jules
Bloomenthal编辑的Introduction to Implicit Surfaces，是一本专著，讲述了Implicit
Surface建模型(Modeling)，面片化(Polygonization)，渲染(Rendering)的问题。<br>Luiz Velho 的 Implicit Objects Computer Graphics 也是一本专著，讲述更新的一些进展。 </p>
<p>细分曲面（Subdivision Surface）造型<br>当用NURBS做造型的时候，曲面拼接是复杂的问题，在动画的时候，可能产生撕裂或者褶皱，Subdivision Surface用来解决这个问题。<br>Joe Warren的Subdivision Methods for Geometric Design: A Constructive Approach就是这方面的专著。 </p>
<p>从实际物体中得到造型，现在的技术可以用三维扫描仪得到物体表面的点，然后根据这些点把物体的表面计算出来，称为重建(Reconstruction)，因为这些技术之在文章中论述，所以我们省略对它的描述。<br>在你的几何模型做好之后，有一些问题需要对这个模型进一步处理，得到适合的模型，当面片很多的时候，或者模型很复杂的时候，需要对几何模型进行简化，才可以满足一些实时绘制的需要，这个技术叫做层次细节（LOD-Level of Detail）。下面的书就是讲这个的：<br>David Luebke编著的 Level of Detail for 3D Graphics<br>(2)<strong> 渲染<br></strong> 有了模型，怎么把这个几何模型画出来呢？这个步骤就是渲染。<br>如
果你看了上面的OpenGL的书，那么你就知道一些渲染的知识了，但是别高兴的太早，OpenGL使用的是局部光照模型（Local
Illumination Model）。Local illumination
Model指的是在做渲染的时候只考虑光源和物体之间的相互作用，不考虑物体和物体之间的影响，所以OpenGL不支持阴影，一个（半）透明物体的效果，
这些需要考虑物体之间的影响才可以实现。<br>（*OpenGL本身不支持，但是通过一些方法可以实现的，用Google搜索一下<br>Shadow Volume, OpenGL就找到答案。）<br>Global Illumination Model 这类模型考虑的就比较全。现在关于Global Illumination的技术有3大类，具体的技术就不在这里介绍了。 </p>
<p><strong> 光线追踪(Ray Tracing)<br></strong> 关于Ray Tracing的好书有2本：<br>Andrew Glassner 的An Introduction to Ray tracing <br>Glasser是图形界的名人，这本书也是Ray Tracing的经典 </p>
<p>R. Keith Morley, Peter Shirley 的Realistic Ray Tracing, Second Edition<br>这本书第一版是伪代码，第二版是C代码。它的结构不是很清楚，虎头蛇尾的感觉。 </p>
<p><strong> 辐射度(Radiosity)<br></strong> 关于Radiosity的好书有4本：<br>Michael Cohen 的Radiosity and Realistic Image Synthesis ， Cohen获得SIGGRAPH 1998计算机图形学成就奖，他把Radiosity变成实际可用。<br>Francois X. Sillion的Radiosity and Global Illumination ， Sillion是法国人，他的主要研究方向是Radiosity，这本书写的很不错的，非常清晰。 </p>
<p>Philip Dutre 的新书Advanced Global Illumination ，看起来还不错，刚拿到手，还没看，呵呵，所以不好评价。 </p>
<p>Ian Ashdown的Radiosity: A Programmer's Perspective <br>有源代码的书啊！<br><strong> Photon mapping<br></strong> 这个我也不知道怎么翻译，呵呵。这个技术出现的比较晚，一本好书！<br>Henrik Wann Jensen的Realistic Image Synthesis Using Photon Mapping<br>Henrik Wann Jensen是Photon mapping技术的发明者<br>【非真实性图形学】（Non-Photorealistic Graphics）<br>真实性不是计算机图形学的唯一要求，比如：你给我画一个卡通效果的图出来，或者我要用计算机画水彩画怎么办？或者：把图象用文字拼出来怎么做？，解决这些问题要用到非真实性图形学， 好书继续推荐！<br>Bruce Gooch, Amy Ashurst Gooch的 Non-Photorealistic Rendering  </p>
<p>【体图形学】(Volume Graphics)<br>用CT机做很多切片（比如头骨），那么能通过这些切片得到3D的头骨吗？Volume Graphics就是解决这样的问题的<br>Min Chen 编著的Volume Graphics  </p>
<p>上面的2个图形学技术就和图象的界限不明显了，实际上他们是图形图象的综合。 </p>
<p>【其他的书】<br>还有一些好书啊，呵呵，好书看不完的，继续放送： </p>
<p>Graphics Gems I ~ V，一大帮子人写的书，包括研究人员，程序员&#8230;有计算机图形学的各种数据结构，编程技巧。 </p>
<p>Tomas Akenine-Moller 等人编著的Real-Time Rendering (2nd Edition) <br>许多最新的计算机图形学进展。 </p>
<p>David Ebert等人的Texturing &amp; Modeling: A Procedural Approach, Third Edition <br>讲述如何通过程序实现纹理、山、地形等图形学要素。<br>关于图形学的特定对象，有特定的专题图书，<br>Evan Pipho Focus On 3D Models,对于图形学的常用模型格式，进行了讲解<br>Trent Polack的 Focus On 3D Terrain Programming ，讲地形的<br>Donald H. House 的Cloth Modeling and Animation ，讲布料的<br>Nik Lever的Real-time 3D Character Animation with Visual C++ ，讲角色动画的<br>Richard Parent的 Computer Animation: Algorithms and Techniques，当然是讲动画的啦，呵呵。<br>David H. Eberly的3D Game Engine Design : A Practical Approach to Real-Time Computer Graphics ，有代码的啊！呵呵：） </p>
<p>最后，没事情的时候，看看下面的书吧<br>Alan H. Watt， 3D Computer Graphics (3rd Edition)  </p>
<p>James D. Foley等人的 Computer Graphics: Principles and Practice in C (2nd Edition) ，这本圣经没事的时候再看吧，呵呵。</p>
<p><font size="3">累了:( 不说了，上面的书差不多了，还有一些shader的书，我不了解，以后会补上的:)<br>
<br>
</font><font size="5"><strong>4.&nbsp;&nbsp; 资源</strong></font>
</p>
<p>　</p>
<p><font size="3">从哪里找到这些书啊？还有什么资源啊？</font></p>
<p><font size="3"><br>
我保证，上面的书在www.amazon.com 都可以买到：） 别打我<br>
<br>
那好，大部分的书在国家图书馆可以复印到，北京的兄弟有福啦，3年前的书借出来复印，1角/页，但是新书要早图书馆里复印，5~6角/页，还是比Amazon便宜啊，呵呵。<br>
<br>
不行大家就到国外买，合买吧，还负担的起。<br>
我对DirectX不了解，所以没有涉及关于DirectX的内容：）</font></p>
<p>&#160;</p>
<br>  <img src ="http://www.cppblog.com/bneliao/aggbug/60210.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bneliao/" target="_blank">bneliao</a> 2008-08-28 04:57 <a href="http://www.cppblog.com/bneliao/articles/60210.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>zz一个图形爱好者的书架</title><link>http://www.cppblog.com/bneliao/articles/60209.html</link><dc:creator>bneliao</dc:creator><author>bneliao</author><pubDate>Wed, 27 Aug 2008 20:53:00 GMT</pubDate><guid>http://www.cppblog.com/bneliao/articles/60209.html</guid><wfw:comment>http://www.cppblog.com/bneliao/comments/60209.html</wfw:comment><comments>http://www.cppblog.com/bneliao/articles/60209.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bneliao/comments/commentRss/60209.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bneliao/services/trackbacks/60209.html</trackback:ping><description><![CDATA[http://blog.csdn.net/Nhsoft/archive/2004/06/23/22992.aspx
<br>
<p>一个图形爱好者的书架．－也来介绍一下我的藏书．</p>
<p>早几天看到有人把自己在大学四年的书列了出来．招来一顿怀疑．我是开发图形程序的．我现在也把我的书列出来．不怕大家怀疑吧．希望能有点启示作用．</p>
<p>绿色的是我看完了的。红色的是没怎么看的。黄色的是看了一半以上的。</p>
<p>首先是基础部分：<br><font size="5" face="幼圆">语言类：</font><br><font color="#006400"><strong> C++ Programming Language (Special Edition).</strong> </font>C++的圣经级别的书．我只看原文的。不看翻译的．对球教授的翻译表示一定的保留意见．<br><font color="#006400"><strong> Effictive/More Effictive C++．</strong> </font>工程实践的最佳经验书籍．<br><font color="#006400"><strong> Inside C++ Object Model</strong>  .</font>好书．看完了。你对C++的理解会变的很深刻的。<br><font color="#006400"><strong> 设计模式</strong> 　</font>．好书．买了看就是了。别问我为什么啊。　<br><font color="#ffa500"><strong> More Excpetion C++</strong> </font>　和Effective C++有同工之处．<br><font color="#ff0000"><strong> STL 源代码破析</strong> </font>。正在看的过程中。不过最近最Loki Boost的兴趣大点。<br><font color="#ff0000"><strong> STL 中文版</strong> </font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 一本参考手册。<br><font color="#ff0000"><strong> Moden C++ Design</strong> </font> 看完了这本书。我估计会吐血。但是还是要看。经典啊，书的例子Loki的代码<br><font color="#006400"><strong> C++自学通</strong> </font>，我入门的书 。不过现在已经找不到了。<br><font color="#006400"><strong> 潭浩强的C程序设计</strong> </font>。经典。C教材里这本最好。不许大家B4他。<br><strong> <font color="#ffa500">C++Template</font></strong>  : 有人说翻译的不好。我觉得还可以.<br></p>
<p><font color="#006400"><strong> Python 语言入门</strong> </font>。我拿来做游戏脚本用的。<br><font color="#ffa500"><strong> Unix Shell编程</strong> </font>。 </p>
<p><font size="5" face="幼圆">算法和基础类。</font><br><font color="#ffa500"><strong> 程序设计实践</strong> 　</font>　　给你一个很好的经验．很薄的，去买来看看。<br><font color="#006400"><strong> C++分形程序设计</strong> </font>。当年给一个JJ做毕业设计。花了半个月看完的。<br><font color="#ff0000"><strong> 数据结构（C++语言描述）</strong> </font>影印版。好书，但是没看完。教材来着的。<br><font color="#006400"><strong> 数据结构（用面向对象方法与C++描述）。</strong> </font>清华出的。看完了。<br><font color="#ffa500"><strong> 人工智能</strong> </font> Nilson的书。看不懂。呵呵。</p>
<p><font size="5" face="幼圆">开发工具和平台的书<br></font><strong> <font color="#ffa500">Unix 环境高级编程</font></strong>  : 学Unix编程.就从这里开始吧.现在在看X-Window编程.可惜没有介绍XLib的书.因为要用OpenGL.最好还是从XLib开始.痛苦.只能看Xlib.pdf<br><font color="#ffa500"><strong> Unix 高级编程</strong> </font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 我真不相信我能检到这么一本好书.想买.但是没钱.呵呵。检一本.不错.<br><font color="#006400"><strong> VC++技术内幕</strong> </font>，翻译的好烂啊。不过当时我不知道。最后还是看完了。<br><font color="#006400"><strong> Windows下的C语言编程</strong> </font>。我的 Win32入门书籍。<br><font color="#006400"><strong> Win32程序员指南</strong> </font>，我的Win32提高书籍。10块一本。呵呵。<br><font color="#006400"><strong> Windows 核心编程</strong> </font>。看完了这个。大家说我是个高手了。<br><font color="#ffa500"><strong> 深入浅出MFC</strong> </font>．　　　看了一半后，我自己去看MFC的代码了．<br><font color="#ff0000"><strong> ATL 开发人员指南</strong> </font>　　没怎么看．很实用的样子．<br><font color="#006400"><strong> COM 本质论</strong> </font>　．看完了大长见识，我就是看了他后，才知道接口的概念的．<br><font color="#ffa500"><strong> ATL 本质论</strong> </font>　，看了后让我模板水平有不少提高．<br><font color="#ffa500"><font color="#ff0000"><strong> Linux内核编程</strong> </font>　<font color="#000000">没什么好说的</font>。<br><font color="#ffa500"><strong> X86的体系结构和汇编</strong> </font>：</font><font color="#000000">忘记了具体名字了。大概　是这个名字．我的汇编知识都是从这里来的。只看了前面的部分<br><font style="background-color: #ffffff;" color="#006400"><strong> 汇编语言程序设</strong> 计</font>: 钱晓捷主编.有介绍SSE和MMX的。很不错哦。 也很便宜<br><font color="#ffa500"><strong> 应用程序调试技巧</strong> </font>: 很经典的调试书.Numega公司的工程师写的.(出品SoftICE的那个公司).有些技巧只能用神奇来形容.<br><br></font></p>
<p><font size="5" face="幼圆">专业的图形书</font> <br><font color="#ff0000"><strong> 图形开发人员指南</strong> </font>　著名的黑皮书．我是怀着崇拜的心情收藏这本书的。John Carmack做的序．Micheal Abrash的书．偶像啊。<br><font color="#006400"><strong> 计算机图形学</strong> </font> （清华大学）。烂书。不过也差不多看完了。现在在一个 MM手里。<br><font color="#ffa500"><strong> 图形学</strong> </font>（电子工业出版社）老外的书。不错。正在看。<br><font color="#ffa500"><strong> 计算机图形学算法基础</strong> </font>：经典。没看完。看了1/3了。翻了一遍。<br><font color="#ffa500"><strong> 计算机真实感图形的算法基础</strong> </font>。国内最好的图形学的书。刚拿到。正在看。<br><font color="#ffa500"><strong> 非真实感计算机图形学</strong> :</font> 刚买到的.不是太有用。太学术了。<br><font color="#ffa500"><strong> 游戏编程精粹 1/2/3. 中文版</strong> </font>。偶尔翻一两篇不错的。不过我要对着英文的看才看的懂。<br><font color="#006400"><strong> OpenGL Red Book</strong> </font> ．中文版还可以．非读不可．<br><font color="#006400"><strong> OpenGL&nbsp;超级宝典</strong> </font>　比较好．很实用，对初学者很好．<br><font color="#ffa500"><strong> 3D Games Vol1</strong> </font> . 就是介绍Fly 3D 的书。看了一半了。很不错。<br><font color="#ffa500"><strong> Real-Time Rendering 1</strong> </font>. 正在看。很好的书<br><font color="#ffa500"><strong> Real-Time Rendering 2</strong> : </font><font color="#000000">中文版和英文版都有</font>:<br><font color="#006400"><strong> CG 教程</strong> </font>:&nbsp; 推荐你学好图形学后再来看.<br><font color="#ffa500"><strong> OpenGL Shading Languge</strong>  :</font> 看了前面的大半了。 <br><font color="#ff0000"><strong> GPU Gems</strong> </font> :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 刚买到的.花了我350大元.不过好看.<br><font color="#006400"><strong> 3D Math Primer For Computer Graphics and 3D Games</strong> </font>. 数学书里就这本好一点了。<br><font color="#ffa500"><strong> 3D Game Engine Design</strong> </font> 　正在看。对着书写自己的物理引擎。<br><font color="#ff0000"><strong> ShaderX 2 Tricks</strong> </font> . 　　没看。刚拿到。经典到不用介绍的程度了。<br><font color="#ffa500">还有其他打印的资料无数 :-)</font> </p>
<br><font size="5" face="幼圆">数学物理类</font>.<br>计算机图形学几何工具和算法 ： 超级经典的书<br><font color="#006400"><strong> 微积分</strong> </font>: 高等教育出版社<br>实变函数和泛函分析 ，北京大学出版社<br>代数论&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 高等教书出版社<br>函数论和泛函分析 ， 莫斯科大学出版社.<br>流体力学&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 高等教育出版社<br>小波十讲&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 不需要用说十什么地方出的<br>复变函数<br>数字信号处理<br>数学物理方程和特殊函数<br>初等几何<br><font color="#ffa500"><strong> 数学分析</strong> </font>:上下册.<br><font color="#006400"><strong> 理论力学</strong> </font>: 上下册<br><font color="#a52a2a"><strong> 傅立叶变换与小波分析</strong> </font>: 没看明白<br><font color="#006400"><strong> 大学物理</strong> :</font> 1-3 册.<br><font color="#ffa500"><strong> 空气动力学</strong> </font>: 我的老本行.(偶学航空发动机滴)
<br><br>  <img src ="http://www.cppblog.com/bneliao/aggbug/60209.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bneliao/" target="_blank">bneliao</a> 2008-08-28 04:53 <a href="http://www.cppblog.com/bneliao/articles/60209.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>zz一个游戏程序员的学习资料</title><link>http://www.cppblog.com/bneliao/articles/60208.html</link><dc:creator>bneliao</dc:creator><author>bneliao</author><pubDate>Wed, 27 Aug 2008 20:46:00 GMT</pubDate><guid>http://www.cppblog.com/bneliao/articles/60208.html</guid><wfw:comment>http://www.cppblog.com/bneliao/comments/60208.html</wfw:comment><comments>http://www.cppblog.com/bneliao/articles/60208.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bneliao/comments/commentRss/60208.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bneliao/services/trackbacks/60208.html</trackback:ping><description><![CDATA[一个游戏程序员的学习资料<br><br> <br><br>想起写这篇文章是在看侯杰先生的《深入浅出MFC》时,突然觉得自己在大学这几年关于游戏编程方面还算是有些心得，因此写出这篇小文,介绍我眼中的游戏程序员的书单与源代码参考。一则是作为自己今后两年学习目标的备忘录,二来没准对别人也有点参考价值。我的原则是只写自己研究过或准备研究的资料，所以内容无疑会带上强烈的个人喜好色彩,比如对网络,数据库等重要方面完全没有涉及。因为自己主要对三维图形引擎,人工智能算法,脚本系统,反外挂(反反外挂? ^－^)等方面感兴趣。这学期电脑都没联网了,在岳麓山闭关修炼中(^－^),连这篇文章都得在学校图书馆电子阅览室（电影放映室？）上传,内容很多凭记忆写出,如有误差敬请订正。程序员应该在理论学习与实践编程中反复迭代，所以学习资料是一回事，须知尽信书不如无书。<br><br> <br><br>一、书籍：<br><br>算法与数据结构：<br><br>《数据结构（C语言版）》——严蔚敏、吴伟民 清华出版社-----------卖了<br><br>我觉得其配套习题集甚至比原书更有价值，每个较难的题都值得做一下。<br><br> <br><br>《Introduction to Algorithms》第二版 中文名《算法导论》--------英文影印版+算法设计（不过没看）<br><br>关于算法的标准学习教材与工程参考手册，在去年CSDN网站上其翻译版竟然评为年度二十大技术畅销书，同时《程序员》杂志上开设了&#8220;算法擂台&#8221;栏目，这些溯源固本的举动，不由得使人对中国现今浮躁不堪的所谓&#8220;IT&#8221;业又产生了一线希望。这本厚厚的书，幸亏打折我才买得起。虽然厚达千页，但其英文通俗晓畅，内容深入浅出，可见经典之作往往比一般水准的书还耐读。还能找到MIT的视频教程，第一节课那个老教授嘻皮笑脸的，后面就是一长发助教上课了。<br><br> <br><br>《C语言名题精选百则 技巧篇》——冼镜光 机械工业出版社<br><br>作者花费一年时间搜集了各种常见C程序段的极具技巧性的编程法，其内容都是大有来头的，而且给出了详细的参考资料。如一个普通的Fibonacci数就给出了非递归解、快速算法、扩充算法等，步步深入，直至几无油水可榨。对于视速度如生命，连一个普通的浮点数转化为整数都另辟蹊径以减少CPU cycle的游戏程序员，怎可不看？<br><br> <br><br>《计算机算法基础（第二版）》—— 佘祥宣等 华中科大出版社<br><br>我看到几个学校的研究生拿它作教材（研究生才开算法，太开玩笑了吧）。这本书薄是薄了点，用作者的话来说，倒也&#8220;精辟&#8221;。其实此书是《Fundamentals of Computer Algorithms》的缩写版，不过原书出版太久了，反正我是没找到。<br><br> <br><br>《The Art of Computer Programming》Volume 1-3-----------------葵花宝典<br><br>作者Donald E. Knuth是我心目中与冯.诺依曼、Dijkstra、Shannon并列的四位大师。这本书作者从读大学本科时开始写，一直写到博士时，十年磨一剑，足见其下足了功夫。可作为计算机技术的核心——算法与数据结构的终极参考手册。创新处也颇多，譬如常见的Shell排序他在书中提出可用(3i-1)/2的间隔，这使其稍快于O(n1. 5)。当然这套书描述高度数学化，为此恐怕一般的人（我？）最好还得先看一本数学预备书《Concrete Mathematics》（直译为混凝土数学？^－^）再说。可惜的是这套书才出到第三卷，并没有覆盖全部常见的算法内容。不过好在对于游戏程序员来说，越常见的算法用得越多，这也不算是什么要命的损失。<br><br> <br><br>《STL源码剖析》—— 侯捷 华中科大出版社-----------------------有必要看这书吗？<br><br>侯捷不用介绍了，华人技术作家中的旗舰，说其有世界级水准也不为过。这本书我以为是C++与数据结构的葵花宝典（欲练此功，必先自宫）。也就是说，不下几层地狱很难看懂，因为它要求的预备知识太多了，如STL、数据结构、泛型编程、内存管理都要很扎实（为此是不是还要看看有内存管理设计模式之称的《Small Memory Software》这本书呢？），但是一旦看懂，真会是所向披靡。<br><br> <br><br>《Data Structures for Game Programmers》<br><br>每个数据结构的例程都是一个小游戏，还用SDL库实现了一个算法演示系统。虽然内容失之于浅，但起码让人了解了数据结构在游戏中的作用。<br><br> <br><br>其实游戏程序并不比其它程序特殊，甚至要求基本功更加扎实，所以花时间做一些看似与实际应用不甚相干的习题，对今后的工作是大有裨益的。而且有些应用很广的算法，如常被人津津乐道的A*算法及其变种，牵涉到图的检索周游与分枝-限界法，恐怕还得读一些艰深的论文才能充分明白运用，如Donald E. Knuth的《An analysis of alpha-beta cutoffs》。其实还有不少此类的好书，如《Data Structures and Algorithms in C++》、《Programming Pearls》、《More Programming Pearls》（算法珠玑）等，我却以为要先看严谨一点的著作，再看内容随笔一点的书。<br><br> <br><br>汇编：<br><br>《IBM-PC 汇编语言程序设计》第二版　<br><br>国内经典教材。<br><br>《The Art of Assembly Language》<br><br>这本书足有1600页，噢！<br><br> <br><br>C语言：<br><br>《The C Programming Language》第二版<br><br>虽然篇幅短小，但每个例程都很经典。（我们老师开始拿它作教材，后面换为谭小强的C语言书，理由为：例子尽是些文本处理。我就纳了闷了，难道现代的计算机程序不是将大量时间消耗在字符串与文本的处理上吗？）<br><br> <br><br>C++：<br><br>学过C语言，再学C++，先看这本《C++ Primer》的缩写版：<br><br>《Essential C++》<br><br>对C++有个入门了解，再看<br><br>《C++ Common Knowledge: Essential Intermediate Programming》<br><br>就不会有什么重要的知识点完全不知所措了，接下来是<br><br>《The C++ Standard Library : A Tutorial and Reference》--------------看前面觉得太啰嗦了，<br><br>标准库，当然主要是标准模板库的标准学习参考手册，然后最好平时边写程序边参悟。<br><br>《Effective C++》等------------看过<br><br>我是说书名以形容词 + C++的那些书，计有七八本，慢慢看吧，罗马不是一日建成的。<br><br>(《Essential C++》、《Effective C++》、《More Effective C++》、《Accelerated C++》、《Effective STL》、《Exceptional C++》、《More Exceptional C++》、《Imperfect C++》，虽然书名格式相似，但每一本都绝非马虎之作。)<br><br> <br><br>谁说C++程序比C程序要慢？那就请看下面：<br><br>《The Design and Evolution of C++》<br><br>知其过去才能知其未来，才能应用。<br><br>《Inside the C++ Object Model》--------看过<br><br>揭露C++的编译器模型。<br><br>《Efficient C++ Performance Programming Techniques》<br><br>当算法优化已到极致，在运用汇编之前，最后还可看看此书，有时高级和低阶都能做成相同的事情。<br><br> <br><br>还有两本特别的书：<br><br>《Modern C++ Design : Generic Programming and Design Patterns Applied》<br><br>作者想把设计模式和泛型编程结合起来，并写了个尝试提供一切的Loki库来实作,不过其观点并未得到C++社区的普遍响应。尽管如此，本书仍称得上思想前沿性与技术实用性结合的典范。<br><br> <br><br>《C++ Template Metaprogramming》<br><br>把编译器当作计算器？本书介绍了Boost库的MPL模板元编程库。当然提到Boost库，对于游戏程序员不能不提到其中的Graph库，有《The Boost Graph Library》一书可看。还有其中Python库，号称国内首款商业三维图形引擎的起点引擎就用了Boost－Python库。说实话我觉得起点引擎还是蛮不错的，那个自制的三维编辑器虽然界面简陋，但功能还算蛮完善，给游戏学院用作教学内容也不错。另有一个号称中国首款自主研发的全套网游解决方案。我看到它那个三维编辑器，心想这不就是国外一个叫freeworld3D的编辑器吗？虽然有点偏门，但我以前还较劲尝试破解过呢。还把英文界面汉化了，大概用exescope这样的资源修改软件就能搞定吧。我又心想为什么要找freeworld3D这个功能并不太强大的编辑器呢？仅仅是因为它便宜到几十美金？它唯一特别一点的地方就是支持导出OGRE图形引擎的场景格式，这样一想不由得使人对它图形引擎的&#8220;自主&#8221;性也产生怀疑了。这样的&#8220;自主&#8221;研发真让人汗颜，只要中国还没封sourceforge这个网站（据说以前和freeBSD网站一起被封过？），国人就能&#8220;自主&#8221;研发。<br><br> <br><br>有人还会推荐《C++ Primer》《Thinking in C++》《The C++ Programming Language》等书吧，诚然这些书也很好，但我总觉得它们太大部头了。还不如多花点时间看看国外好的源代码。<br><br> <br><br>Windows编程<br><br>Operating System Concepts第五版----------第六版看过，第七版已出<br><br>国内有些操作系统的教程其实就是它的缩写版。<br><br> <br><br>《Windows 95 System Programming Secrets》---------？<br><br>深入剖析了Windows操作系统的种种种种，有人爱看《Linux内核完全注释》，有人爱看《自己动手写操作系统》这样煽情的书，但我想作为商业的操作系统，把Windows内核剖析到这地步也高山仰止了。<br><br> <br><br>《Programming Applications for Microsoft Windows》第四版<br><br>先进程线程，再虚存管理，再动态链接库，最多讲到消息机制。作者在序言中说：&#8220;我不讲什么ActiveX, COM等等，因为当你了解了这些基础后，那些东西很快就会明白！&#8221;可以作为《Programming Windows》的先修课。<br><br> <br><br>计算机体系：<br><br>《Computer Systems : A Programmer&#8217;s Perspective》---------在看<br><br>和《The Art of Computer Programming》在我心中是计算机史上两本称得上伟大的书，计算机组成原理，操作系统，汇编，编译原理，计算机网络等等课程汇成这本千页的大书，因为计算机在作者眼中就是一个整体。<br><br> <br><br>开源阅读：<br><br>《Code Reading : The Open Source Perspective》<br><br>张大千临摹了几百张明代石涛的山水，画出的画以假乱真，后来他去敦煌潜心临摹几年，回来画风大变，终成大家。程序员其实有40%的时间是在读别人的源代码，侯捷先生说：&#8220;源码面前，了无秘密&#8221;，又说&#8220;天下大事，必作于细&#8221;，可以与他的《上穷碧落下黄泉，源码追踪经验谈》参看。<br><br> <br><br>MFC:<br><br>《深入浅出MFC》<br><br>我实在以为没有看过侯捷先生的《深入浅出MFC》的人多半不会懂得MFC编程。其实我是打算用一年多的时间写一个给游戏美工用的三维编辑器，顺便作为毕业设计。图形库就用MFC吧，反正也没得选择。如果要用wxWidgets无非是猎奇而已，还不是MFC的翻版，当然它跨平台了。就象阻击手对自己枪械的零件了如指掌一样，要想用MFC写出非玩具程序的人一定要了解其内部构造。还有一本书叫《MFC深入浅出》，并不是同一本。<br><br> <br><br>IDE:<br><br>《Microsoft Visual Studio 2005 Unleashed》<br><br>工欲善其事，必先利其器。当然我认为与其用形如Source Insight、Slick Edit、Code Visualizer之类的代码阅读器、图形化工具，还不如用自己的大脑。但如果你嫌打源代码慢的话，可以用Visual AssistX。如果嫌老是写重复相似的代码的话，可以用Code Smith。单元测试可以用CppUnit，Boost库中的测试框架也不错。有心情可以吧Visual Studio外接Intel的Compiler，内嵌STLport，但不是大工程，性能分析没必要动不动就用下VTune吧。<br><br> <br><br>程序员之路：<br><br>《游戏之旅——我的编程感悟》-----------看一点<br><br>云风大哥。在我心目中游戏程序员国外首推卡马克，国内首推云风。也许过两年我会到网易当云风大哥的助理程序员吧。It&#8217;s my dream.（^-^）他写这本书的时候本着只有透彻理解的东西才写出来，因此内容不会很酷新，但是相信我，每读一遍都有新的收获，主要还不是知识上的，因为知识是学无止境的，授人以鱼不如授人以渔，精神上的启迪才是长久的。诚如经典游戏《仙剑奇侠传》的主力程序员兼美术指导姚壮宪（人称姚仙）在序言中所说的&#8220;云风得到的只是一些稿费，而整个中国民族游戏产业得到的将是一次知识的推动&#8221;，此言不虚矣。<br><br> <br><br>《编程高手箴言》<br><br>梁肇新是豪杰超级解霸的作者，本来每个合格的程序员（Programmer , 而非Coder）都应该掌握的东西，现在变成了编程高手的独家箴言。不知是作者的幸运还是中国IT业的悲哀。知识点还是讲得蛮多的，不过对MFC的地位颇有微词。我实在认为MFC的名声就是那些不懂得用它的人搞臭的。不过作者的牢骚也情有可原，每个具有创造力的程序员都应该不太喜欢framework。<br><br> <br><br>《Masters of DOOM: How Two Guys Created an Empire and Transformed Pop Culture》中文名《DOOM启世录》<br><br>卡马克，罗洛斯，这些游戏史上如雷贯耳的名字。（现在卡马克已专注于火箭制造上，罗洛斯则携妻回乡隐居）要不是没上过大学的卡马克和图形学大师亚伯拉罕的功勋，可能到现在游戏中还不知三维为何物。勿庸置疑，在计算机界历史是英雄们所推动的。这本书真实的记录了这些尘世英雄的所为所思。<br><br> <br><br>作为程序员的我对这几本策划与美工的书也产生了浓厚兴趣，以前搞过一两年的3DS MAX插件编程，觉得用maxscript还是好过MaxSDK，毕竟游戏开发中所多的是模型场景数据的导入导出，大可不必大动干戈。<br><br> <br><br>策划：<br><br>《Creating Emotion in Games : The Craft and Art of Emotioneering》<br><br>在壮丽煊目的宏伟三维世界背后，在残酷的杀戮，动人心魄的情节背后，我们还需要什么来抓住玩家的心？答对了，就是emotion.真正打动人心的，才是深入骨髓的。<br><br> <br><br>《Ultimate Game Design : Building Game Worlds》<br><br>从名字可以看出，写给关卡设计师的，特别是讲室外自然场景的构建颇有可取之处。<br><br> <br><br>《Developing Online Games : An Insider&#8217;s Guide》<br><br>就象名为反模式的书讲软件团队运营一样，这本书讲商业运作多过技术。一个历经艰难，现在盛大的游戏程序员，翻译了这本书。<br><br> <br><br>美工：<br><br>《Digital Cinematography &amp; Directing》<br><br>数字摄影导演术，每当你在3DS MAX或者Maya等三维创作软件中摆放摄影机，设计其运动轨迹时，你可曾想过你也站在导演的位置上了？<br><br> <br><br>《The Animator&#8217;s Survival Kit》<br><br>看着这本讲卡通角色运动规律的书，一边产生温习《猫和老鼠》的念头，一边继续对前不久新闻联播中关于中国产生了某计算机自动卡通动画生成软件报道的蔑视，这条报道称此举可大大加快中国卡通动画的产量。我且不从技术上探讨其是否是在放卫星（其实我知道得很清楚，前文已表，本人搞过一两年的卡通动画辅助软件编程），但计算机机械生成的动画怎可代替人类充满灵性的创作？<br><br> <br><br>《The Dark Side of Game Texturing》<br><br>用Photoshop制作材质贴图，还真有些学问。<br><br> <br><br>三维图形学：<br><br>搞三维图形学首先还是要扎扎实实的先看解析几何、线性代数、计算几何的教材，后面的习题一个都不能少。国内数学书还是蛮好的。苏步青大师的《计算几何》称得上具有世界级水准，可惜中国CAD的宏图被盗版给击垮了。现在是我们接过接力棒的时候了。It&#8217;s time!<br><br> <br><br> <br><br>《Computer Graphics Geometrical Tools》<br><br>《计算机图形学几何工具算法详解》算法很多，纰漏处也不少。<br><br> <br><br>《3D Math Primer for Graphics and Game Development》<br><br>浅易，可作为三维数学的&#8220;速食&#8220;。<br><br> <br><br>《Mathematics for 3D Game Programming &amp; Computer Graphics》第二版<br><br>比上面那本深入一些，证明推理的数学气也浓一些，可作为专业的数学书与编程实践一个过渡的桥梁吧。内容涉猎也广，射线追踪，光照计算，可视裁剪，碰撞检测，多边形技术，阴影算法，刚体物理，流体水波，数值方法，曲线曲面，还真够丰富。<br><br> <br><br>《Vector Game Math Processors》<br><br>想学MMX,SSE吗，那就看它吧，不过从基础讲起的，要耐心哦。<br><br> <br><br> DirectX:<br><br>《Introduction to 3D Game Programming with DirectX 9.0》---------入门看<br><br>DirectX入门的龙书，作者自己写的简单示例框架，后面我干脆用State模式，把所有例子绑到一块儿去了。<br><br> <br><br>《Beginning Direct3D Game Programming》<br><br>作者取得律师学位后变成了游戏程序员，真是怪也哉。本书虽定位为入门级书，内容颇有独特可取之处。它用到的示例框架是DXSDK Sample Framework，而不是现在通行的DXUT。要想编译有两种办法吧，一是自己改写成用DXUT的。二是找旧的Sample Framework。我又懒得为了一个示例框架下载整个早期版本的DirectX，后面在Nvidia SDK 9.5中发现了。<br><br> <br><br>《Advanced Animation with DirectX》<br><br>DirectX高级动画技术。骨骼系统，渐变关键帧动画，偶人技术，表情变形，粒子系统，布料柔体，动态材质，不一而足。我常常在想，从三维创作软件导出的种种效果，变成一堆text或binary，先加密压缩打包再解包解压解密，再用游戏程序重建一个Lite动画系统，游戏程序员也真是辛苦。<br><br> <br><br>OpenGL:<br><br>《NeHe OpenGL Tutorials》<br><br>虽是网络教程，不比正式的书逊，本来学OpenGL就不过是看百来条C函数文档的工夫吧,如果图形学基础知识扎实的话。<br><br> <br><br>《OpenGL Shading Language》<br><br>OpenGL支持最新显卡技术要靠修修补补的插件扩展，所以还要配合<br><br>《Nvidia OpenGL Extension Specifications》<br><br>来看为上。<br><br> <br><br>《Focus on 3D Models》<br><br>《Focus on 3D Terrain Programming》<br><br>《Focus on Curves and Surfaces》<br><br>顾名思义，三本专论，虽然都很不深，但要对未知三维模型格式作反向工程前，研读Geomipmapping地形算法论文前，CAD前，还是要看看它们为上，如果没从别处得过到基础的话。<br><br> <br><br>脚本：<br><br>先看<br><br>《Game Scripting Mastery》<br><br>等自己了解了虚拟机的构造，可以设计出简单的脚本解释执行系统了。<br><br>再去查Python , Lua ，Ruby的手册吧，会事半半功倍倍的。<br><br> <br><br>《Programming Role Playing Games with DirectX 8.0》<br><br>一边教学一边用DirectX写出了一个GameCore库，初具引擎稚形。<br><br> <br><br>《Isometric Game Programming with DirectX 7.0》<br><br>三维也是建立在二维的基础上，这就是这本书现在还值得看的原因。<br><br> <br><br>《Visual C++网络游戏建模与实现》<br><br>联众的程序员写的，功力很扎实，讲棋牌类游戏编程，特别讲了UML建模和Rotional Rose。<br><br> <br><br>《Object-Oriented Game Development》<br><br>套用某人的话：&#8220;I like this book.&#8221;<br><br> <br><br>Shader:<br><br>要入门可先看<br><br>《Shaders for Game Programmers and Artists》<br><br>讲在RenderMonkey中用HLSL高级着色语言写Shader.<br><br> <br><br>再看<br><br>《Direct3D ShaderX : Vertex and Pixel Shander Tips and Tricks》<br><br>用汇编着色语言，纯银赤金。<br><br> <br><br>三大宝库：<br><br>《Game Programming Gems》<br><br>我只见到1-6本，据说第7、8本也出来了？附带的源代码常有bug，不过瑕不掩瑜，这套世界顶级游戏程序员每年一度的技术文集，涉及游戏开发的各个方面，我觉得富有开发经验的人更能在其中找到共鸣。<br><br> <br><br>《Graphics Gems》全五本<br><br>图形学编程Bible，看了这套书你会明白计算机领域的科学家和工程师区别之所在。科学家总是说，这个东西在理论上可行。工程师会说，要使问题在logN的时限内解决我只能忍痛割爱，舍繁趋简。<br><br> <br><br>《GPU Gems》出了二本<br><br>Nvidia公司召集图形学Gurus写的，等到看懂的那一天，我也有心情跑去Siggraph国际图形学大会上投文章碰运气。<br><br> <br><br>游戏引擎编程：<br><br>《3D Game Engine Programming》<br><br>是ZFXEngine引擎的设计思路阐释，很平实，冇太多惊喜。<br><br> <br><br>《3D Game Engine Design》<br><br>数学物理的理论知识讲解较多，本来这样就够了，还能期待更多吗？<br><br> <br><br>人工智能：<br><br>《AI Techniques for Game Programming》<br><br>讲遗传算法，人工神经网络，主要用到位数组，图算法。书的原型是根据作者发表到GameDev.net论坛上的内容整理出来的，还比较切中实际。<br><br> <br><br>《AI Game Programming Wisdom》<br><br>相当于AI编程的Gems。<br><br> <br><br>《PC游戏编程(人机博弈)》<br><br>以象棋程序为蓝本，介绍了很多种搜索算法，除了常见的极大极小值算法及其改进--负极大值算法，还有深度优先搜索以外。更提供了多种改进算法，如：Alpha-Beta,Fail-soft alpha-beta,Aspiration Search, Minimal Window Search,Zobrist Hash,Iterative Deepening,History Heuristic,Killer Heuristic,SSS*,DUAL*,MFD and more.琳琅满目，实属难得。<br><br> <br><br>反外挂：<br><br>《加密与解密(第二版)》 看雪论坛站长 段钢<br><br>破解序列号与反外挂有关系么？不过，世上哪两件事情之间又没有关系呢？<br><br> <br><br>《UML Distilled》 Martin Fowler<br><br>很多人直到看了这本书才真正学懂UML。<br><br>Martin Fowler是真正的大师,从早期的分析模式,到这本UML精粹,革命性的重构都是他提出的,后来又写了企业模式一书。现在领导一个软件开发咨询公司，去年JavaOne中国大会他作为专家来华了吧。个人网站：MartinFowler.com<br><br> <br><br>设计模式三剑客：<br><br>《Design Patterns Elements of Reusable Object-Oriented Software》<br><br>《Design Patterns Explained》<br><br>《Head First Design Patterns》 <br><br> <br><br>重构三板斧：<br><br>《Refactoring : Improving the Design of Existing Code》<br><br>《Refactoring to Patterns》<br><br>《Refactoring Workbook》<br><br> <br><br>软件工程:<br><br>《Extreme Programming Explained : Embrace Change》第二版<br><br>其中Simplicity的Value真是振聋发聩，这就是我什么都喜欢轻量级的原因。<br><br> <br><br>《Agile Software Development Principles,Patterns,and Practices》<br><br>敏捷真是炒得够火的，连企业都有敏捷一说，不过大师是不会这么advertising的。<br><br> <br><br>《Code Complete》第二版<br><br>名著。<br><br> <br><br>数学：<br><br>《数学，确定性的丧失》M.克莱因<br><br>原来数学也只不过是人类的发明与臆造，用不着供入神殿，想起历史上那么多不食人间烟火的科学家（多半是数学家），自以为发现了宇宙运作的奥秘，是时候走下神坛了。<br><br> <br><br>物理：<br><br>《普通物理学》第一册 += 《Physics for Game Developers》<br><br>物理我想就到此为此吧，再复杂我可要用Newton Engine,ODE了，等待物理卡PPU普及的那天，就可充分发挥PhysX的功效了，看过最新的《细胞分裂》游戏Demo演示，成千上万个Box疯狂Collide，骨灰级玩家该一边摸钱包一边流口水了。<br><br> <br><br>二、开源代码：<br><br>Irrlicht<br><br>著名的鬼火引擎，从两年前第一眼看到它，这个轻量级的三维图形引擎，就喜欢上了它。源代码优雅，高效，且不故弄玄虚。值得每个C++程序员一读，并不限于图形编程者。它的周边中也有不少轻量级的东西。如Lightfeather扩展引擎，ICE、IrrlichtRPG、IrrWizard.还有IrrEdit、IrrKlang、IrrXML可用。（可能是为了效率原因，很多开源作者往往喜欢自己写XML解析库，如以上的IrrXML库,即使有现成的tinyXML库可用。这真会让tomcat里面塞Axis，Axis里面塞JUDDI，弄得像俄罗斯套娃玩具的Java Web Service Coder们汗颜。）<br><br> <br><br>OGRE<br><br>排名第一的开源图形引擎，当然规模是很大的，周边也很多。除了以C#写就的OgreStudio ，ofusion嵌入3DS MAX作为WYSWYG式的三维编辑器也是棒棒的，特别是其几个场景、地形插件值得研究。以至于《Pro OGRE 3D Programming》一书专论其用法。搜狐的《天龙八部》游戏就是以其作为图形引擎，当然还另外开发了引擎插块啦。我早知道OGRE开发组中有一个中国人谢程序员，他以前做了很多年的传统软件编程。有一次天龙八部游戏的图形模块的出错信息中包含了一串某程序员的工作目录，有一个文件夹名即是谢程序员的英文名，我据此推断谢程序员即是搜狐北京的主程。看来中国对开源事业还是有所贡献的嘛，王开源哥哥的努力看来不会白费！（^-^）不过我侦测的手法也有些像网站数据库爆库了，非君子之所为作。<br><br> <br><br>RakNet<br><br>基于UDI的网络库，竟还支持声音传输，以后和OpenVision结合起来做个视聊程序试试。<br><br> <br><br>Blender<br><br>声誉最盛的开源三维动画软件，竟还带一个游戏引擎。虽然操作以快捷键驱动，也就是说要背上百来个快捷键才能熟练使用。但是作为从商业代码变为开源之作，威胁三维商业巨头的轻骑兵，历经十年锤炼，代码达百万行，此代码只应天上有，人间哪得几回看，怎可不作为长期的源码参考？<br><br> <br><br>风魂<br><br>二维图形库。云风大哥的成名之作。虽然不代表其最高水平（最高水平作为商业代码保存在广州网易互动的SVN里呢），但是也可以一仰风采了。<br><br> <br><br>圣剑英雄传<br><br>二维RPG。几个作者已成为成都锦天的主力程序员。锦天的老总从一百万发家，三年时间身价过亿，也是一代枭雄了。这份代码作为几年前的学生作品也算可以了，因为一个工程讲究的是四平八稳，并不一定要哪个模块多么出彩。反正我是没有时间写这么一个东东，连个美工都找不到，只能整天想着破解别人的资源（^-^）。<br><br> <br><br>Boost<br><br>C++准标准库，我想更多的时候可以参考学习其源代码。<br><br> <br><br>Yake<br><br>我遇到的最好的轻量级游戏框架了。在以前把一个工程中的图形引擎从Irrlicht换成OGRE的尝试中，遇到了它。OGRE的周边工程在我看来都很庸肿，没有完善文档的情况下看起来和Linux内核差不多。不过这个Yake引擎倒是很喜欢。它以一个FSM有限状态机作为实时程序的调度核心，然后每个模块：物理、图形、网络、脚本、GUI、输入等等都提供一个接口，接口之下再提供到每种具体开源引擎的接口，然后再接具体引擎。通过这样层层抽象，此时你是接Newton Engine,ODE还是PysX都可以；是接OGRE,Crystal Space还是Irrlicht都可以；是接RakNet还是LibCurl都可以；是接Python，Lua还是Ruby都可以，是接CEGUI还是others，是接OIS还是others（呵呵,记不起来others）都可以。所以Yake本质上不是OGRE的周边。虽然用Neoengine的人都倒向了它，但是现在版本还很早。特别是我认为，学习研究时一定要有这种抽象之抽象，接口之接口的东西把思维从具体的绑定打开，而开发时抽象要有限度的，就像蔡学镛在《Java夜未眠》中讲的，面向对象用得过滥也会得OOOO症(面向对象过敏强迫症)。<br><br> <br><br>Quake Doom系列<br><br>据说很经典，卡马克这种开源的黑客精神就值得赞许。把商业源代码放出来，走自己的创新之路，让别人追去吧。不过Quake与Unreal引擎的三维编辑器是现在所有编辑器的鼻祖，看来要好好看看了。<br><br> <br><br>Nvidia SDK 9.X<br><br>三维图形编程的大宝库，这些Diret3D与OpenGL的示例程序都是用来展示其最新的显卡技术的。硬件厂商往往对软件产品不甚在意，源代码给你看,东西给你用去吧，学完了还得买我的硬件。Intel的编译器，PhysX物理引擎大概也都是这样。Havok会把它的Havok物理引擎免费给别人用吗？别说试用版，连个Demo都看不到。所以这套SDK的内容可比MS DirectX SDK里面那些入门级的示例酷多了，反正我是如获至宝，三月不知愁滋味。不过显卡要so-so哦。我的GeForce 6600有两三个跑不过去,差强人意。<br><br> <br><br>三、网站：<br><br>www.CSDN.net<br><br>程序员大本营吧，软文与&#8220;新技术秀&#8221;讨厌了点，blog和社区是精华之所在。<br><br> <br><br>www.GameRes.com<br><br>游戏程序员基地，文档库中还有点东西。投稿的接收者Seabug与圣剑英雄传的主程Seabug会是同一个人吗？一个在成都锦天担当技术重担的高手还有时间维护网站吗？我不得而知。<br><br> <br><br>&#8220;何苦做游戏&#8221;网站<br><br>名字很个性，站长也是历尽几年前产业发展初期的艰难才出此名字。<br><br> <br><br>www.66rpg.com<br><br>二维游戏图片资源很多，站长柳柳主推的RPGMaker 软件也可以玩一玩吧，但对于专业开发者来说不可当真。<br><br> <br><br>www.GameDev.net<br><br>论坛中有不少热心的国外高手在活动。<br><br> <br><br>www.SourceForge.net<br><br>不用说了，世界最大的开源代码库，入金山怎可空手而返？看到国外那些学生项目动不动就像模像样的。（DirectX的稚形就是英国的学生项目，在学校还被判为不合格。）<br><br> <br><br>www.koders.com<br><br>源代码搜索引擎,支持正则表达式,google Lab中也有。当你某种功能写不出来时,可以看一下开源代码怎么写的,当然不过是仅供参考,开源代码未必都有产品级的强度。说到google,可看《Google Power Tools Bible》一书，你会发现，google的众多产品原来也有这么多使用门道。<br><br> <br><br>这篇小文足足写了一天半的时间，不由得使我对侯捷一样的技术作家长期伏案辛勤劳作深深敬佩了。看来对于书籍或者软件，都应该尊重作者或者programmer的才智劳动。<br>  <img src ="http://www.cppblog.com/bneliao/aggbug/60208.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bneliao/" target="_blank">bneliao</a> 2008-08-28 04:46 <a href="http://www.cppblog.com/bneliao/articles/60208.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>