交互式计算机图形学(第五版)1-7章课后题答案.doc_第1页
交互式计算机图形学(第五版)1-7章课后题答案.doc_第2页
交互式计算机图形学(第五版)1-7章课后题答案.doc_第3页
交互式计算机图形学(第五版)1-7章课后题答案.doc_第4页
交互式计算机图形学(第五版)1-7章课后题答案.doc_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Angel: Interactive Computer Graphics, Fifth EditionChapter 1 Solutions1.1 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 available. The main disadvantage is that we cannot handle mostglobal effects such as shadows, reflections, and blending in a physicallycorrect manner.1.3 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 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 two 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 the unit circle by scaling the values. We can continue thisprocess recursively on each of the triangles created by the bisection process.1.5 In Exercise 1.4, 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 process iteratively, each time shortening the line segmentif it intersects one side of the window.1.7 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 case of athreepoint perspective there are three vanishing points and none of theedges of the cube are parallel to the projection plane.1.9 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 the video display. Thus, it can take 18 times asmuch time to render each frame if there is a lot of pixel-level calculations.1.11 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 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 Solutions2.9 We can solve this problem separately in the x and y directions. Thetransformation is linear, that 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.2.11 Most practical tests work on a line by line basis. Usually we usescanlines, 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, the third reenters and so on.2.13 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 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 forming 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 filling 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 polygons share a given vertex.2.15 The Maxwell triangle corresponds to the triangle that connects thered, green, and blue vertices in the color cube.2.19 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. 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.2.23 There are eight vertices and thus 256 = 28 possible black/whitecolorings. 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 Solutions3.1 The general problem is how to describe a set of characters that mighthave thickness, 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 form (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.3.11 There are a couple of potential problems. One is that the applicationprogram can 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.3.19 Each scan is allocated 1/60 second. For a given scan we have to take10% of the time for the vertical 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).3.25 When the display is changing, primitives that move or are removedfrom the 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 Solutions4.1 If the scaling matrix is uniform 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)4.5 There are 12 degrees of 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 equation 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 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.4.7 It is easy to show by simply multiplying the matrices 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 rightcolumn 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 concatenation of the two rotations) and an altered translation.Inductively, we can see that any further concatenations with rotations andtranslations do not alter this form.4.9 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 angle 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.4.11 The most sensible place to put the shear is second so that the instancetransformation becomes I = TRHS. We 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 and place it wheredesired with a translation. Note that the order I = TRSH will work too.4.13R = Rz(z)Ry(y)Rx(x) =cos y cos z cos z sin x sin y cos x sin z cos x cos z sin y + sin x sin z 0cos y sin z cos x cos z + sin x sin y sin z cos z sin x + cos x sin y sin z 0sin y cos y sin x cos x cos y 00 0 0 14.17 One test is to use the first three vertices to find the equation of theplane ax + by + cz + d = 0. Although there are four coefficients in theequation only three are independent so we can select one arbitrarily ornormalize so that a2 + b2 + c2 = 1. Then we can successively evaluateax + bc + cz + d for the other vertices. A vertex will be on the plane if weevaluate to zero. An equivalent test is to form the matrix1 1 1 1x1 x2 x3 x4y1 y2 y3 y4z1 z2 z3 z4for each i = 4, . If the determinant of this matrix is zero the ith vertex isin the plane determined by the first three.4.19 Although we will have the same number of degrees of freedom in theobjects we produce, the class of objects will be very different. For exampleif we rotate a square before we apply a nonuniform scale, we will shear thesquare, something we cannot do if we scale then rotate.4.21 The vector a = u v is orthogonal to u and v. The vector b = u a isorthogonal to u and a. Hence, u, a and b form an orthogonal coordinatesystem.4.23 Using r = cos 2+ sin 2v, with = 90 and v = (1, 0, 0), we find forrotation about the x-axisr =22(1, 1, 0, 0).Likewise, for rotation about the y axisr =22(1, 0, 1, 0).4.27 Possible reasons include (1) object-oriented systems are slower, (2)users are often comfortable working in world coordinates with higher-levelobjects and do not need the flexibility offered by a coordinate-freeapproach, (3) even a system that provides scalars, vectors, and pointswould have to have an underlying frame to use for the implementation.Chapter 5 Solutions5.1 Eclipses (both solar and lunar) are good examples of the projection ofan object (the moon or the earth) onto a nonplanar surface. Any time ashadow is created on curved surface, there is a nonplanar projection. Allthe maps in an atlas are examples of the use of curved projectors. If theprojectors were not curved we could not project the entire surface of aspherical object (the Earth) onto a rectangle.5.3 Suppose that we want the view of the Earth rotating about the sun.Before we draw the earth, we must rotate the Earth which is a rotationabout the y axis. Next we translate the Earth away from the origin.Finally we do another rotation about the y axis to position the Earth in itsdesired location along its orbit. There are a number of interesting variantsof this problem such as the view from the Earth of the rest of the solarsystem.5.5 Yes. Any sequence of rotations is equivalent to a single rotation abouta suitably chosen axis. One way to compute this rotation matrix is to formthe matrix by sequence of simple rotations, such asR = RxRyRz.The desired axis is an eigenvector of this matrix.5.7 The result follows from the transformation being affine. We can alsotake a direct approach. Consider the line determined by the points(x1, y1, z1) and (x2, y2, z2). Any point along can be written parametricallyas (_x1 + (1 _)x2, _y1 + (1 _)y2, _z1 + (1 _)z2). Consider the simpleprojection of this point 1d(_z1+(1_)z2) (_x1 + (1 _)x2, _y1 + (1 _)y2)which is of the form f(_)(_x1 + (1 _)x2, _y1 + (1 _)y2). This formdescribes a line because the slope is constant. Note that the function f(_)implies that we trace out the line at a nonlinear rate as _ increases from 0to 1.5.9 The specification used in many graphics text is of the angles theprojector makes with x,z and y, z planes, i.e the angles defined by theprojection of a projector by a top view and a side view.Another approach is to specify the foreshortening of one or two sides of acube aligned with the axes.5.11 The CORE system used this approach. Retained objects were kept indistorted form. Any transformation to any object that was defined withother than an orthographic view transformed the distorted object and theorthographic projection of the transformed distorted object was incorrect.5.15 If we use _ = _ = 45, we obtain the projection matrixP =266641 0 1 00 1 1 00 0 0 00 0 0 1377755.17 All the points on the projection of the point (x.y, z) in the directiondx, dy, dz) are of the form (x + _dx, y + _dy, z + _dz). Thus the shadow ofthe point (x, y, z) is found by determining the _ for which the lineintersects the plane, that isaxs + bys + czs = dSubstituting and solving, we find_ =d ax by czadx + bdy + cdz.However, what we want is a projection matrix, Using this value of _ wefindxs = z + _dx =x(bdy + cdx) dx(d by cz)adx + bdy + cdzwith similar equations for ys and zs. These results can be computed bymultiplying the homogeneous coordinate point (x, y, z, 1) by the projectionmatrixM =26664bdy + cdz bdx cdx ddxady adx + cdz cdy ddyadz bdz adx + bdy ddz0 0 0 adx + bdy + cdz37775.5.21 Suppose that the average of the two eye positions is at (x, y, z) andthe viewer is looking at the origin. We could form the images using theLookAt function twice, that isgluLookAt(x-dx/2, y, z, 0, 0, 0, 0, 1, 0);/* draw scene here */* swap buffers and clear */gluLookAt(x+dx/2, y, z, 0, 0, 0, 0, 1, 0);/* draw scene again */* swap buffers and clear */Chapter 6 Solutions6.1 Point sources produce a very harsh lighting. Such images arecharacterized by abrupt transitions between light and dark. The ambientlight in a real scene is dependent on both the lights on the scene and thereflectivity properties of the objects in the scene, something that cannot becomputed correctly with OpenGL. The Phong reflection term is notphysically correct; the reflection term in the modified Phong model is evenfurther from being physically correct.6.3 If we were to take into account a light source being obscured by anobject, we would have to have all polygons available so as to test for thiscondition. Such a global calculation is incompatible with the pipelinemodel that assumes we can shade each polygon independently of all otherpolygons as it flows through the pipeline.6.5 Materials absorb light from sources. Thus, a surface that appears redunder white light appears so because the surface absorbs all wavelengths oflight except in the red rangea subtractive process. To be compatible withsuch a model, we should use surface absorbtion constants that define thematerials for cyan, magenta and yellow, rather than red, green and blue.6.7 Let be the angle between the normal and the halfway vector, bethe angle between the viewer and the reflection angle, and be the anglebetween the normal and the light source. If all the vectors lie in the sameplane, the angle between the light source and the viewer can be computereither as + 2 or as 2( + ). Setting the two equal, we find = 2. Ifthe vectors are not coplanar then 0 and a viewer at (x, y)where y 0. Light will travel in a straight line from the source to a point(t, 0) where it will leave the first material and enter the second. It willthen travel from this point in a straight line to (x, y). We must find the tthat minimizes the time tr

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论