1、交互式计算机图形学17章课后题答案Angel: Interactive Computer Graphics, Fifth EditionChapter 1 Solutions The main advantage of the pipeline is that each primitive can beprocessed independently. Not only does this architecture lead to fastperformance, it reduces memory requirements because we need not keep allobjects
2、 available. The main disadvantage is that we cannot handle mostglobal effects such as shadows, reflections, and blending in a physicallycorrect manner. We derive this algorithm later in Chapter 6. First, we can form thetetrahedron by finding four equally spaced points on a unit sphere centeredat the
3、 origin. One approach is to start with one point on the z axis(0, 0, 1). We then can place the other three points in a plane of constant z.One of these three points can be placed on the y axis. To satisfy therequirement that the points be equidistant, the point must be at(0, 2p2/3,1/3). The other tw
4、o can be found by symmetry to be at(p6/3,p2/3,1/3) and (p6/3,p2/3,1/3).We can subdivide each face of the tetrahedron into four equilateraltriangles by bisecting the sides and connecting the bisectors. However, thebisectors of the sides are not on the unit circle so we must push thesepoints out to th
5、e unit circle by scaling the values. We can continue thisprocess recursively on each of the triangles created by the bisection process. In Exercise , we saw that we could intersect the line of which theline segment is part independently against each of the sides of the window.We could do this proces
6、s iteratively, each time shortening the line segmentif it intersects one side of the window. In a onepoint perspective, two faces of the cube is parallel to theprojection plane, while in a twopoint perspective only the edges of thecube in one direction are parallel to the projection. In the general
7、case of athreepoint perspective there are three vanishing points and none of theedges of the cube are parallel to the projection plane. Each frame for a 480 x 640 pixel video display contains only about300k pixels whereas the 2000 x 3000 pixel movie frame has 6M pixels, orabout 18 times as many as t
8、he video display. Thus, it can take 18 times asmuch time to render each frame if there is a lot of pixel-level calculations. There are single beam CRTs. One scheme is to arrange the phosphorsin vertical stripes (red, green, blue, red, green, .). The major difficulty isthat the beam must change very
9、rapidly, approximately three times as fasta each beam in a three beam system. The electronics in such a system theelectronic components must also be much faster (and more expensive).Chapter 2 Solutions We can solve this problem separately in the x and y directions. Thetransformation is linear, that
10、is xs = ax + b, ys = cy + d. We mustmaintain proportions, so that xs in the same relative position in theviewport as x is in the window, hencex xminxmax xmin=xs uw,xs = u + wx xminxmax xmin.Likewiseys = v + hx xminymax ymin. Most practical tests work on a line by line basis. Usually we usescanlines,
11、 each of which corresponds to a row of pixels in the frame buffer.If we compute the intersections of the edges of the polygon with a linepassing through it, these intersections can be ordered. The firstintersection begins a set of points inside the polygon. The secondintersection leaves the polygon,
12、 the third reenters and so on. There are two fundamental approaches: vertex lists and edge lists.With vertex lists we store the vertex locations in an array. The mesh isrepresented as a list of interior polygons (those polygons with no otherpolygons inside them). Each interior polygon is represented
13、 as an array ofpointers into the vertex array. To draw the mesh, we traverse the list ofinterior polygons, drawing each polygon.One disadvantage of the vertex list is that if we wish to draw the edges inthe mesh, by rendering each polygon shared edges are drawn twice. Wecan avoid this problem by for
14、ming an edge list or edge array, each elementis a pair of pointers to vertices in the vertex array. Thus, we can draw eachedge once by simply traversing the edge list. However, the simple edge listhas no information on polygons and thus if we want to render the mesh insome other way such as by filli
15、ng interior polygons we must add somethingto this data structure that gives information as to which edges form eachpolygon.A flexible mesh representation would consist of an edge list, a vertex listand a polygon list with pointers so we could know which edges belong towhich polygons and which polygo
16、ns share a given vertex. The Maxwell triangle corresponds to the triangle that connects thered, green, and blue vertices in the color cube. Consider the lines defined by the sides of the polygon. We can assigna direction for each of these lines by traversing the vertices in acounter-clockwise order.
17、 One very simple test is obtained by noting thatany point inside the object is on the left of each of these lines. Thus, if wesubstitute the point into the equation for each of the lines (ax+by+c), weshould always get the same sign. There are eight vertices and thus 256 = 28 possible black/whitecolo
18、rings. If we remove symmetries (black/white and rotational) there are14 unique cases. See Angel, Interactive Computer Graphics (ThirdEdition) or the paper by Lorensen and Kline in the references.Chapter 3 Solutions The general problem is how to describe a set of characters that mighthave thickness,
19、curvature, and holes (such as in the letters a and q).Suppose that we consider a simple example where each character can beapproximated by a sequence of line segments. One possibility is to use amove/line system where 0 is a move and 1 a line. Then a character can bedescribed by a sequence of the fo
20、rm (x0, y0, b0), (x1, y1, b1), (x2, y2, b2), .where bi is a 0 or 1. This approach is used in the example in the OpenGLProgramming Guide. A more elaborate font can be developed by usingpolygons instead of line segments. There are a couple of potential problems. One is that the applicationprogram can
21、map different points in object coordinates to the same pointin screen coordinates. Second, a given position on the screen whentransformed back into object coordinates may lie outside the userswindow. Each scan is allocated 1/60 second. For a given scan we have to take10% of the time for the vertical
22、 retrace which means that we start to drawscan line n at .9n/(60*1024) seconds from the beginning of the refresh.But allocating 10% of this time for the horizontal retrace we are at pixel mon this line at time .81nm/(60*1024). When the display is changing, primitives that move or are removedfrom the
23、 display will leave a trace or motion blur on the display as thephosphors persist. Long persistence phosphors have been used in text onlydisplays where motion blur is less of a problem and the long persistencegives a very stable flicker-free image.Chapter 4 Solutions If the scaling matrix is uniform
24、 thenRS = RS(, , ) = R = SRConsider Rx(), if we multiply and use the standard trigonometricidentities for the sine and cosine of the sum of two angles, we findRx()Rx() = Rx( + )By simply multiplying the matrices we findT(x1, y1, z1)T(x2, y2, z2) = T(x1 + x2, y1 + y2, z1 + z2) There are 12 degrees of
25、 freedom in the threedimensional affinetransformation. Consider a point p = x, y, z, 1T that is transformed top_ = x_y_, z_, 1T by the matrix M. Hence we have the relationshipp_ = Mp where M has 12 unknown coefficients but p and p_ are known.Thus we have 3 equations in 12 unknowns (the fourth equati
26、on is simplythe identity 1=1). If we have 4 such pairs of points we will have 12equations in 12 unknowns which could be solved for the elements of M.Thus if we know how a quadrilateral is transformed we can determine theaffine transformation.In two dimensions, there are 6 degrees of freedom in M but
27、 p and p_ haveonly x and y components. Hence if we know 3 points both before and aftertransformation, we will have 6 equations in 6 unknowns and thus in twodimensions if we know how a triangle is transformed we can determine theaffine transformation. It is easy to show by simply multiplying the matr
28、ices that theconcatenation of two rotations yields a rotation and that the concatenationof two translations yields a translation. If we look at the product of arotation and a translation, we find that the left three columns of RT arethe left three columns of R and the right column of RT is the right
29、column of the translation matrix. If we now consider RTR_ where R_ is arotation matrix, the left three columns are exactly the same as the leftthree columns of RR_ and the and right column still has 1 as its bottomelement. Thus, the form is the same as RT with an altered rotation (whichis the concat
30、enation of the two rotations) and an altered translation.Inductively, we can see that any further concatenations with rotations andtranslations do not alter this form. If we do a translation by -h we convert the problem to reflection abouta line passing through the origin. From m we can find an angl
31、e by whichwe can rotate so the line is aligned with either the x or y axis. Now reflectabout the x or y axis. Finally we undo the rotation and translation so thesequence is of the form T1R1SRT. The most sensible place to put the shear is second so that the instancetransformation becomes I = TRHS. We
32、 can see that this order makessense if we consider a cube centered at the origin whose sides are alignedwith the axes. The scale gives us the desired size and proportions. Theshear then converts the right parallelepiped to a general parallelepiped.Finally we can orient this parallelepiped with a rotation an
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1