⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appendixg.html

📁 OpenGl红宝书
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.07 [en] (Win98; I) [Netscape]">
   <META NAME="Author" CONTENT="Goran UnreaL Krajnovic">
   <TITLE>Appendix G - OpenGL Programming Guide (Addison-Wesley Publishing Company)</TITLE>
</HEAD>
<BODY BGCOLOR="#EFEFEF" LINK="#0000FF" VLINK="#551A8B" ALINK="#FF0000">

<DIV ALIGN=right><IMG SRC="figures/SGI_ID.gif" ALT="Silicon Graphics" NOSAVE HEIGHT=43 WIDTH=151 ALIGN=TEXTTOP></DIV>

<HR>
<H1>
Appendix G<BR>
Homogeneous Coordinates and Transformation Matrices</H1>
This appendix presents a brief discussion of homogeneous coordinates. It
also lists the form of the transformation matrices used for rotation, scaling,
translation, perspective projection, and orthographic projection. These
topics are introduced and discussed in Chapter 3 . For a more detailed
discussion of these subjects, see almost any book on three-dimensional
computer graphics - for example, <I>Computer Graphics: Principles and Practice,</I>
by Foley, Van Dam, Feiner, and Hughes (Reading, Mass.: Addison-Wesley)
- or a text on projective geometry - for example, <I>The Real Projective
Plane</I>, by H. S. M. Coxeter, 2nd ed. (Cambridge: Cambridge University
Press, 1961). In the discussion that follows, the term homogeneous coordinates
always means three-dimensional homogeneous coordinates, although projective
geometries exist for all dimensions.
<P>This appendix has the following major sections:
<UL>"Homogeneous Coordinates"
<BR>&nbsp;
<P>"Transformation Matrices"</UL>

<HR>
<H2>
<A NAME="X"></A>Homogeneous Coordinates</H2>
OpenGL commands usually deal with two- and three-dimensional vertices,
but in fact all are treated internally as three-dimensional homogeneous
vertices comprising four coordinates. Every column vector (<I>x, y, z,
w</I>)T represents a homogeneous vertex if at least one of its elements
is nonzero. If the real number <B>a</B> is nonzero, then (<I>x, y, z, w</I>)T
and (<B>a</B>x,<B> a</B>y,<B> a</B>z,<B> a</B>w)T represent the same homogeneous
vertex. (This is just like fractions: <I>x</I>/<I>y</I> = (<B>a</B>x)/(<B>a</B>y).)
A three-dimensional euclidean space point (<I>x, y, z</I>)T becomes the
homogeneous vertex with coordinates (<I>x, y, z</I>, 1.0)T, and the two-dimensional
euclidean point (<I>x, y</I>)T becomes (<I>x, y</I>, 0.0, 1.0)T.
<P>As long as <I>w</I> is nonzero, the homogeneous vertex (<I>x, y, z,
w</I>)T corresponds to the three-dimensional point (<I>x/w, y/w, z/w</I>)T.
If <I>w</I> = 0.0, it corresponds to no euclidean point, but rather to
some idealized "point at infinity." To understand this point at infinity,
consider the point (1, 2, 0, 0), and note that the sequence of points (1,
2, 0, 1), (1, 2, 0, 0.01), and (1, 2.0, 0.0, 0.0001), corresponds to the
euclidean points (1, 2), (100, 200), and (10000, 20000). This sequence
represents points rapidly moving toward infinity along the line 2<I>x</I>
= <I>y</I>. Thus, you can think of (1, 2, 0, 0) as the point at infinity
in the direction of that line.
<P>OpenGL might not handle homogeneous clip coordinates with <I>w</I> &lt;
0 correctly. To be sure that your code is portable to all OpenGL systems,
use only nonnegative <I>w</I> values.
<H3>
Transforming Vertices</H3>
Vertex transformations (such as rotations, translations, scaling, and shearing)
and projections (such as perspective and orthographic) can all be represented
by applying an appropriate 4 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -