System for using barycentric coordinates as for polygon interpolation

Abstract: Barycentric coordinates are determined using data readily available in computer graphics systems and defining polygons in world space so as to interpolate such polygons with regard to pixels selected by scan conversion. The barycentric coordinates are employed to interpolate the polygons to accomplish smooth shading or texture mapping. The manipulations are illustrated as a process and a structural implemen­ tation.

Description: Perhaps video games are the most commonly known form of computer graphics apparatus. However, the field embraces many other forms of apparatus, as for training, design, modeling and so on. Typically, such apparatus give the viewer the impression of looking through a window at a picture somewhat like that of a television receiver. To generate the picture, the computer graphics system selects content from basic forms (primitives), orients the selected pieces with respect to the window and displays them on a viewing screen as a composite. According to one technique, picture content is developed from primitives as polygons, i.e. closed outlines bounded by straight edges. Such polygons define outlines of solid areas of gray or color and are joined to form an object or a part of an object in the desired display. Usually, the polygons are mathematically defined in three-dimensional, world space. Conventional basic practice involves orienting such polygons with respect to a viewpoint, scanning the polygons to define data for small, individual picture elements (pixels), eliminating hidden surface representations, then displaying the pixels in a perspective array on a two-dimensional screen. Essentially, the scan conversion of a polygon involves finding all the pixels that lie inside each polygon and accordingly setting the color and intensity for each pixel. In a typical display, a million pixels may compose a picture. In accordance with prior computer graphics techniques, the picture image is stored as a pattern of binary digital numbers that represent individual pixels in a rectangular array. The numerical data representative of individual pixels is supplied in sequence to a cathode ray tube apparatus as the tube screen is scanned to display the pixels in the rectangular array. Accordingly, the pixels are presented in a raster pattern as a succession of scan lines, each of which consists of a row of pixels. The raster pattern is most familiar in television displays. As mentioned above, computer graphics systems are capable of providing realistic images from primitives which may take the form of planar polygons. The generation of such images also involves subdividing polygons and selecting the portions of such polygons that are unobstructed to the viewer and accordingly appear in the display. In that regard, several hidden surface techniques are well known. In summary, the present state of the art in computer graphics allows the generation of dynamic realistic images by processors utilizing the techniques described above. When geometric primitives other than planar polygons are used for model definition, the primitives often are decomposed into planar polygons, which thereafter may be further decomposed into triangular polygons for processing, as to provide better simulation or remove hidden surfaces. For example, a curved or parametric surface of a display object may be decomposed by subdivision as well known in the prior art and as treated in U. S. Patent 4,646,251, issued February 24, 1987, to Hayes, Brown, Jensen and Madsen. While defining planar polygons to compose a picture is effective, the technique still provides an unrealistic picture. For example, it is desirable that the image of a cylinder appear as a cylinder, not as an array of discrete planar polygons joined together to approximate a cylinder. However, such shapes attain greater realism if they are smooth shaded over the surface of several polygons. The technique is illustrated and described in a book entitled "Principles of Interactive Computer Graphics", Second edition, Newman & Sproull, McGraw-Hill Book Company, 1979. Various specific shading techniques are well known in the art, and in that regard the referenced book describes both Gouraud and Phong shading techniques. The Gouraud technique of smooth shading involves computing normals at the vertices (corners) of each polygon then computing the precise shade at each of the vertices. An interpolation is then performed to determine the shade for each pixel dissecting the polygon. Traditionally, the interpolation is performed on each polygon as it exists in perspective or screen space. That is, shading is performed after polygons have been transformed from world space to perspective space. In that regard, see chapter 22 of the referenced book, "Principles of Interactive Computer Graphics", at page 339, a section captioned "Transformations in Viewing". A similar situation exists with respect to interpolation of polygons for Phong shading. Recapitulating to some extent, planar polygons as they exist (transformed to perspective or screen space) traditionally have been interpolated for shading or texturing. However, the transformation of polygons from world space to their two-dimensional equivalents in perspective space is a nonlinear projection, i.e. three dimensional to two dimensional. As a consequence, interpolating a polygon (for shading or texturing) after transformation to perspective space is quite different from interpolating the same polygon in world space. Although traditionally polygons have been interpolated in perspective space, such interpolation is erroneous and deters from the displayed image. In that regard, the present invention is based on a recognition that considerably improved displays result from the interpolation in world space, that is, space not subject to linear distortion. This improvement also may be obtained through interpolation of polygons in spaces other than world space which are not subject to the nonlinear distortion of perspective space. An example of another space not subject to nonlinear distortion is eye space. However, in the past, the data for such interpolation in spaces such as world space or eye space was not considered to be economically available. In general, the system of the present invention is embodied as an effective process or product for interpolating planar polygons, as to accomplish smooth shading (or texturing) for an object defined by the polygons. Interpolation in accordance with the present invention is performed on planar polygons defined in world space and thereby enables improved displays. Specifically in that regard, the system of the present invention facilitates world-space interpolations by utilizing data in unconventional combinations. Specifically, as disclosed in detail below, readily available vectors have been discovered susceptible to manipulation as dot products and cross products to accomplish the interpolation of a polygon in world space and accordingly to effectively shade or texture objects composed of such polygons. According to the present invention there is provided a process of interpolating a graphic object as set out in claim 1, a system for interpolating a graphic object as set out in claim 8 and a process for determining pixel data as set out in claim 9. Brief Description of the Drawings In the drawings, which constitute a part of this specification, exemplary embodiments exhibiting various objectives and features hereof are set forth, specifically: FIGURE 1 is a graphic representation of a curved surface illustrated with respect to polygon decomposition and vertex normalization as for shading in accordance herewith; FIGURE 2 is a graphic representation illustrating a view frustum radiating from an eyepoint with respect to perspective space and world space as treated herein; FIGURE 3 is a graphic representation illustrating barycentric coordinates with respect to a polygon as developed herein; FIGURE 4 is a graphic representation illustrating vectors for the computation of barycentric coordinates for a polygon in accordance with the present invention; FIGURE 5 is a graphic representation illustrating a pentagonal polygon containing a triangular polygon as discussed herein; FIGURE 6 is a graphic representation illustrating a triangular polygon in conjunction with a quadratic, Bezier surface as discussed herein; FIGURE 7 is a flow diagram illustrating a process in accordance with the present invention; and FIGURE 8 is a block diagram of a structure in accordance with the present invention. Description of the Illustrative Embodiment A detailed illustrative embodiment of the present invention is disclosed herein; however, it is merely representative, recognizing that a wide variety of specific embodiments of the disclosed system are possible. Nevertheless, the illustrative embodiment is deemed to afford the best embodiment for purposes of disclosure and to provide a basis for the claims herein which define the scope of the present invention. Initially, consideration of some graphic representations will be helpful as related to the present development, specifically with regard to the decomposition of conics into planar polygons. Referring to FIGURE 1, an external curved surface comprising a fragment 10 of a cylinder is illustrated in heavy lines. The cylindrical fragment 10 is crudely simulated by a pair of planar polygons 12 and 14 represented in light lines. To more closely simulate the shape of the cylinder fragment 10, an increased number of planar polygons could be used. However, for purposes of the present explanation, it can be seen that the two planar polygons 12 and 14 roughly simulate the cylindrical surface. Accordingly, some approximation is accomplished. The relatively large polygons 12 and 14 are convenient and useful for the following explanation. Note that each of the polygons has a uniform intensity or shade which approximates the shading for a half the curved fragment 10. With lower frontal illumination of the external surface, as illustrated, the polygon 12 is shaded darker than the polygon 14. Techniques of such shading are described in Chapter 25 of the above-referenced book, "Principles of Interactive Computer Graphics". While uniformly shading the individual polygons defining an object gives some realism, such displays tend to have a patchwork appearance. For greater realism, it has been proposed to smoothly shade the polygons over the entire surface of the simulated object. Techniques for accomplishing smooth shading are treated in the above-referenced book at Chapter 25 and may involve interpolating from the normals at the vertices of each polygon. Note that the surface normal vectors at the vertices of the polygons 12 and 14 are generally indicated by arrows 16 and 18. Note that the surface of the cylindrical fragment 10 coincides to the polygons 12 and 14 at the polygon vertices. Smooth shading may involve associating each polygon vertex with the corresponding surface normal vector as illustrated in FIGURE 1. A normal vector is interpolated at any point on the interior of the polygon using the surface normal vectors associated with the polygon vertices. As mentioned above, interpolation of normal vectors is called Phong shading. A simpler technique is called Gouraud shading wherein brightness is interpolated rather than normal vectors. In any event, these as well as other forms of shading involve the interpolation of polygon attributes. With such interpolation, the shade variation from the top edge 20 of the fragment 10 to the bottom edge 22 can be smooth, tending to impart a more realistic appearance for the curved surface. It is sometimes desirable to interpolate quantities other than normal vectors or brightness for polygons. For example, a surface might be covered with a texture which is to appear in the display. Generally, in computer graphics, the process of applying such patterns to surfaces is called "texture mapping" and is treated in the above-referenced book, "Principles of Interactive Computer Graphics", in Chapter 25. Texture mapping essentially involves locking texture to polygons and is performed by an interpolative process which is analogous to smooth shading. Again, recapitulating, smooth shading and texture mapping both involve interpolation of polygon attributes. Gouraud shading involves the interpolation of brightness (intensity), a one-dimensional quantity. Phong shading involves interpolation of normal vectors, three-dimensional quantities. Texture mapping involves interpolation of texture patterns which typically are two-dimensional quantities defined in an X,Y-coordinate system. Consequently, Gouraud shading, texture mapping and Phong shading respectively involve the interpolation of one, two and three-dimensional quantities. In accordance with the present invention, improved interpolation of polygons for display is performed in the three-dimensional world-space coordinate system defining the polygons. Such interpolation avoids the nonlinear properties of interpolating in the perspective projection. The operation of the present system is illustrated in FIGURE 2 and will now be considered in detail. A polygon 24 in the form of a triangle is illustrated in world space (FIGURE 2, upper left). In accordance with traditional techniques, the vertices of the polygon 24 are referenced to a point of origin (not shown) in world space. The world space origin is established with reference to an eyepoint O (FIGURE 2, lower right). Using conventional methods, the polygon 24 readily may be referenced to the eyepoint O in terms of three-dimensional coordinates; see the referenced book, "Principles of Interactive Computer Graphics", at page 339. As generally explained above, to view the polygon 24 (exemplifying one of many components of an image) from the eyepoint O, the polygon is transformed to a viewing plane or screen 28 in two-dimensional perspective space; see the referenced book, "Principles of Interactive Computer Graphics", at page 341. In accordance with convention, the screen 28 comprises the base of a pyramidal view frustum 30 with an apex 32 at the eyepoint O. In a sense, the viewing screen 28 (at the base of the frustum 30) may be analogized to the screen of a television display through which world-space objects (as the polygon 24) are viewed. In accordance with well known traditional practice, the two-dimensional perspective space of the screen 28 is dissected into small picture elements or pixels. For example, one million pixels may be organized in an array of one thousand rows, each of one thousand pixels. A representative pixel 34 is illustrated at a central location of the screen 28. Note that a ray 36 extends from the eyepoint O, passing through the center of pixel 34, to the point P. The ray 36 exemplifies thousands of such rays that dissect the image into pixels. Each view ray 36 is defined by a pixel at the screen 28, then continues beyond the screen 28 (pixel intersection) and may intersect polygons in world space comprising the primitives to form an object or the model. In the simplified example of FIGURE 2, after passing through the pixel 34 at the point C, the view ray 36 continues to intersect the polygon 24 at a point P. At this juncture it is noteworthy that the location of the polygon intersection point P is not known in terms of coordinates. If the point P were defined, the polygon in world space could be interpolated; however, such is not the case. However, in accordance herewith it has been discovered that data is available to perform the interpolation in an economical system. Such interpolation enables effective smooth shading and texture mapping. In accordance herewith, treating the point P, and accordingly interpolating the polygon 24 as a triangle involves the use of barycentric coordinates as well known in the computer graphics art. Specifically, barycentric coordinates are treated in a paper entitled, "Representation and Approximation of Surfaces", by Robert E. Barnhill, appearing in Mathematical Software III , published in 1977 by Academic Press, Inc. Some basic explanation of barycentric coordinates as utilized herein will now be given. FIGURE 3 shows the triangular polygon 24 in a planar view. Assume that the points P₁, P₂ and P₃ are defined in a world-space three-dimensional coordinate system. Note that, as described above, the point P lies in the plane of the polygon. Recognizing that the point P may be defined in terms of the points P₁, P₂ and P₃ using the equation, P = b₁P₁ + b₂P₂ + b₃P₃, where b₁, b₂ and b₃ are called the barycentric coordinates of the point P. Note that the point P is defined by a unique set of barycentric coordinates and further that the coordinates b₁ + b₂ + b₃ = 1. The equation means that by applying the barycentric coordinates, the point P can be calculated as a linear combination of the points P₁, P₂ and P₃. For example, if b₁=1, b₂=0 and b₃=0, the defined point lies at the vertex P₁. As another simple example, if: b₁=1/3, b₂=1/3 and b₃=1/3, the point P lies in the center of the triangular polygon 24. To further treat barycentric coordinates, consider the following definitions: As illustrated in FIGURE 3, A is the area of triangle P₁P₂P₃ (polygon 24), A₁ is the area of triangle PP₂P₃, A₂ is the area of triangle PP₃P₁, and A₃ is the area of triangle PP₁P₂. The barycentric coordinates for the triangle P₁P₂P₃ can be calculated as: b₁ = A₁/A b₂ = A₂/A b₃ = A₃/A As disclosed in the above-referenced Barnhill paper, since it is obvious from inspection of FIGURE 3 that: A = A₁ + A₂ + A₃, the barycentric coordinates may be expressed as: b₁ = A₁/(A₁ + A₂ + A₃) b₂ = A₂/(A₁ + A₂ + A₃) b₃ = A₃/(A₁ + A₂ + A₃) In the application of the above equations, it is noteworthy that although FIGURE 3 illustrates the point P within the triangle P₁P₂P₃ (polygon 24), the barycentric equations are relevant if the point P lies anywhere in the plane of the triangle, even if the point P lies outside the triangle. Thus, determination of the point P in barycentric coordinates to enable interpolation is general and may be applied to nontriangular polygons as well. For example, consider FIGURE 5 which shows a pentagon P₁P₂P₃P₄P₅. Any triangle within this pentagon (as illustrated), such as triangle P₁P₃P₄, may be used for computation of barycentric coordinates b₁, b₂ and b₃. These barycentric coordinates may then be used to interpolate the entire pentagon. Furthermore, with the ability to locate each of the pixel ray points, as the point P in the polygon 24, using barycentric coordinates, the polygon can be shaded or texture mapped. At this juncture, some conventions should be mentioned that will be used to pursue the explanation. A vector is designated by the components of the vector placed in parentheses and separated by commas. For example, if point P (FIGURE 3) were defined in a three-dimensional coordinate system, the vector from the origin to point P could be represented by (x,y,z) utilizing the x, y and z coordinates of point P. Somewhat analogously, the barycentric coordinates of the point P are represented by the vector (b₁,b₂,b₃). The calculation of the barycentric coordinates of the polygon 24 in accordance herewith will now be explained. Referring to FIGURE 4, the triangle P₁P₂P₃ (polygon 24) is shown in three-dimensional space with rays RA extending from the eyepoint 32 to vertices P, P₁, P₂ and P₃. In considering the figure, a form of vector notation will be employed wherein the starting point of a vector is followed by the endpoint, both points being in boldface type. Accordingly, the vector from point O (eyepoint 32) to point P is denoted OP. We normally think of points as determined by coordinates in a Cartesian coordinate system. However, if O is at (x o ,y o ,z o ) and P is at (x p ,y p ,z p ), then OP can be represented by: OP = [(x p - x o )(y p - y o )(z p - z o )]. Vector manipulation as related to computer graphics is treated in an Appendix I of the above-referenced book, "Principles of Interactive Computer Graphics". Specifically, operations are explained and described on three-dimensional vectors including dot products and cross-products as used below. In FIGURE 4, the vector OP (origin O or eyepoint 32 to point P) passes through the point C which is in the plane of the two-dimensional screen 28 (FIGURES 2 and 4). Specifically, the point C (FIGURE 4) is the center of the pixel 34. The continuation of the vector OC (beyond the point C) intersects the polygon 24 at the point P to define the vector OP. As the coordinates of the polygon 24 are known, the following definitions apply: V is the volume of tetrahedron OP₁P₂P₃ whose base is triangle P₁P₂P₃ having area A, V₁ is the volume of tetrahedron OPP₂P₃ whose base is triangle PP₂P₃ having area A₁, V₂ is the volume of tetrahedron OPP₃P₁ whose base is triangle PP₃P₁ having area A₂, V₃ is the volume of tetrahedron OPP₁P₂ whose base is triangle PP₁P₂ having area A₃. Further, make the following supplemental definitions: T is the triple product of vectors OP₁, OP₂ and OP₃, T₁ is the triple product of vectors OP, OP₂ and OP₃, T₂ is the triple product of vectors OP, OP₃ and OP₁, T₃ is the triple product of vectors OP, OP₁ and OP₂. Accordingly, from the above, the following relations hold: V = T/6 V₁ = T₁/6 V₂ = T₂/6 V₃ = T₃/6 These relationships are discussed in a book entitled, "Elements of Analytic Geometry", by Paul J. Kelly and Ernst G. Straus (pages 144-145), published by Scott, Foresman & Co., 1970. The book further states the truism that the volume of a tetrahedron is equal to one-third the product of its base area times its perpendicular height. Since the bases of the four tetrahedrons mentioned above are simply the triangles whose areas are A, A₁, A₂ and A₃, the following relations hold: V = hA/3 V₁ = hA₁/3 V₂ = hA₂/3 V₃ = hA₃/3 In the above equations, h is the perpendicular height from the plane of the triangle P₁P₂P₃ to the point O. Combining the above equations in terms of V, V₁, V₂ and V₃ yields: A = T/2h A₁ = T₁/2h A₂ = T₂/2h A₃ = T₃/2h Further, combining the barycentric equations with the above yields: b₁ = T₁/(T₁ + T₂ + T₃) b₂ = T₂/(T₁ + T₂ + T₃) b₃ = T₃/(T₁ + T₂ + T₃) At this point it is important to recognize that the above equations would be useful except for the fact that T₁, T₂ and T₃ were calculated using the vector OP, and the coordinates of point P (FIGURE 4) are not known. However, a discovery of the present invention overcomes the problem. It may be seen by inspection of FIGURE 4 that the vector OP is proportional to the vector OC. That is, OP = qOC, where q is a proportionality constant, or scalar, albeit an unknown. In view of the above and in the interests of proceeding, consider defining the following three triple products: K₁ is the triple product of vectors OC, OP₂ and OP₃, K₂ is the triple product of vectors OC, OP₃ and OP₁, K₃ is the triple product of vectors OC, OP₁ and OP₂. Accordingly, the following relations are true: T₁ = qK₁ T₂ = qK₂ T₃ = qK₃ The above equations are true because multiplying one of the vectors in a triple product by a scalar, such as q, results in multiplying the value of the triple product by the same scalar. Accordingly, combining equations for the barycentric coordinates with the above yields the following useful result in which the unknown scalar, q, has fallen out. b₁ = K₁/(K₁ + K₂ + K₃) b₂ = K₂/(K₁ + K₂ + K₃) b₃ = K₃/(K₁ + K₂ + K₃) The particular significance of the above equations is the fact that K₁, K₂ and K₃ are computed using known vectors OC, OP₁, OP₂ and OP₃ (FIGURE 4) all readily available in the graphics computations. That is, the vertices P₁, P₂ and P₃ are known along with the coordinates of the point O and the point C. While the location of the point P is not known, as developed mathematically above, the vector OC can be employed rather than the vector OP which is unknown. Thus, the barycentric coordinates for the point P are established by the above useful equations and, accordingly may be effectively employed to interpolate all ray points on the polygon 24 for pixels. Consider a specific example. Once the barycentric coordinates b₁, b₂ and b₃ are calculated in terms of K₁, K₂ and K₃, they may be used for interpolation and accordingly for smooth shading. Suppose, for example, that Gouraud shading is desired with the consequence that an intensity is associated with each of the points P₁, P₂ and P₃ (FIGURE 4). The three intensity values may be designated by the vector (i₁,i₂,i₃). Then the intensity i at the point P may be interpolated linearly as: i = b₁i₁ + b₂i₂ + b₃i₃. Alternatively, since the above equation is really just a dot product, and since the barycentric coordinates may themselves be represented as a vector (as suggested above), the equation may be rewritten as: i = (b₁,b₂,b₃)·(i₁,i₂,i₃). Accordingly, the polygon 24 can be smooth shaded by scan conversion to determine the pixel locations (for example pixel center C); see the referenced book, "Principles of Interactive Computer Graphics", at Chapter 16. The shade intensity for each pixel can then be developed by applying the equation: i = b₁i₁ + b₂i₂ + b₃i₃. Phong shading can be accomplished using a similar technique, except that instead of interpolating a single intensity value for each pixel, e.g. at the point P, the three components of the surface normal vector are interpolated for each pixel in accordance with the Phong shading technique. Barycentric coordinates also may be used for texture mapping. Specifically, assume the existence of a texture x,y-coordinate associated with each of the points P₁, P₂ and P₃ (FIGURE 4). These three texture x,y-coordinates may be designated by the vectors (tx₁,tx₂,tx₃) and (ty₁,ty₂,ty₃). The texture x,y-coordinates tx and ty at the point P may be interpolated linearly as: tx = (b₁,b₂,b₃)·(tx₁,tx₂,tx₃) ty = (b₁,b₂,b₃)·(ty₁,ty₂,ty₃) Applying the above equations for each pixel maps the texture onto the polygon for a consistent and effective display. Thus, the system of the present invention enables applications of polygon interpolation for improved computer graphics displays. It is possible to use barycentric coordinates to perform interpolation other than linear interpolation. For example, the above discussion of intensity interpolation described linear interpolation accomplished by means of a dot product. However, FIGURE 6 depicts intensity interpolation using quadratic interpolation. Referring to FIGURE 6, triangle P₁P₂P₃ (polygon 24) is shown superimposed on a quadratic, Bezier surface 26 defined by intensity values i₁ through i₆. Intensity values i₁, i₂ and i₃ lie on the surface while intensity values i₄, i₅ and i₆ lie near the surface, in accordance with the standard definition of a quadratic, Bezier surface. Bezier surfaces are well known in the prior art and are treated in U. S. Patent 4,646,251, issued February 24, 1987 to Hayes, Brown, Jensen and Madsen. Intensity surface 26 defines the manner in which quadratic interpolation of intensity is to be calculated on polygon 24. Specifically, the intensity i at point P on the polygon is given by the following equation: i = i₁b₁² + i₂b₂² + i₃b₃² + i₄b₂b₃ + i₅b₃b₁ + i₆b₁b₂ Bezier interpolation formulae are well known in the prior art and are described on page 38 of a paper entitled, "A survey of curve and surface methods in CAGD", by Wolfgang Bohm, Gerald Farin, and Jurgen Kahmann, appearing in Computer Aided Geometric Design , published in 1984 by Elsevier Science Publishers B.V. In a manner analogous to that shown for quadratic, Bezier interpolation, barycentric coordinates may be used to perform interpolation of any degree greater than or equal to one. Typically, in the computation of images that apply hidden surface algorithms, each polygon embraces several pixels. In the above equations defining b₁, b₂ and b₃ in terms of K₁, K₂ and K₃, three triple products per pixel are necessary for smooth shading and texture mapping each pixel. Since a triple product is the determinant of a three-by-three matrix, the calculation of three triple products requires the calculation of three such determinants; a considerable amount of computation. Alternatively, however, it is possible to express a triple product as a dot product and a cross product. In that regard, the quantities K₁, K₂ and K₃ may be expressed using cross products and dot products as follows: K₁ = OC . [OP₂ x OP₃] K₂ = OC . [OP₃ x OP₁] K₃ = OC . [OP₁ x OP₂] Cross products and dot products are treated in Appendix 1 of the above-referenced book, "Principles of Interactive Computer Graphics". For a particular image, it will be noted that the point O at the eyepoint is constant. Also for a particular image, the points P₁, P₂ and P₃ also are constant for each polygon. Therefore, for each polygon, vectors OP₁, OP₂ and OP₃ are constant and so are the cross products of these vectors shown in the above equations. Consequently, these products may be computed and stored once per polygon per image. Thereafter, to perform smooth shading and texture mapping, interpolation at a particular pixel, the vector OC must be created and combined as a dot product with the three precomputed cross-product values of OP₁, OP₂ and OP₃. In that manner, the barycentric coordinates are calculated. Note that this approach effectively reduces the computation required at each pixel by performing three dot products instead of three triple products. As another advantage, the system hereof for developing the barycentric coordinates requires the same type of computation as does the interpolation, i.e. dot products. Reducing the computation required at each pixel to some number of dot products helps to make the computation homogeneous and thereby simplify the computer hardware required for the computation. Often it is desirable to compute the distance from the eyepoint O (FIGURE 2) to the point P on the polygon 24. For example, the distance OP may be utilized to simulate fog as part of the smooth shading computation. One method for computing this distance is to utilize the equations for K₁, K₂ and K₃ to calculate the barycentric coordinates; then to use the above-mentioned equation P = b₁P₁+b₂P₂+b₃P₃ from which the x,y,z coordinates may be used to compute the point P after which the vector OP can be computed. The process for interpolating polygons in accordance herewith is illustrated in FIGURE 5. The hidden-surface process can be distinct or intimately involved with the interpolation process, both generally being considered a part of the required hardware in display processors. Typically, structure is utilized to scan solid areas dissecting them into individual pixels. Accordingly, with the present development, the data for smooth shading would be determined for the individual pixels and registered in a buffer. However, the process hereof is illustrated in FIGURE 5 independent of polygon priority or resolving hidden surface questions. Referring to FIGURE 7, the first block 50 indicates "fetch polygon data". Essentially, polygons may be treated in sequence and in that regard, the polygons may have been reduced to individual triangles in accordance with well known techniques of the prior art and, as indicated above, the hidden surface priorities may be independently treated. Assuming the polygon as a triangle, with available data the vertices P₁, P₂ and P₃ are determined as indicated by the block 52. As the next step, represented by the block 54, the vectors OP₁, OP₂ and OP₃ are computed and stored for use throughout the processing of the current triangle. As indicated by the block 56, the next step involves computing the vertex intensities from the polygon data. Specifically, the intensities i₁, i₂ and i₃ are computed as indicated. These values are registered for use throughout the processing of the current triangle. The next step involves a junction depending on whether the scanning of the polygon is complete. As indicated, the diamond 58 illustrates the operation to "scan select the next pixel", provided that untreated pixels remain in the polygon. If the polygon has been completely scanned, as indicated by the line 60, the system returns to the block 50 and the next polygon is fetched. Note that the scan operation as indicated by the diamond 58 is a well known technique in computer graphics. Specifically in that regard, the scan conversion of solid areas is treated specifically in Chapter 16 of the above-referenced book, "Principles of Interactive Computer Graphics". In the process as illustrated in FIGURE 7, if unprocessed pixels remain in the polygon, as indicated by the diamond 58, the next pixel is selected and the process continues as indicated by the line 62. Another query is posed by the diamond 64, specifically, "is the pixel in the polygon?" If not, as indicated by the line 66, the process returns to the diamond 58 and the scan process seeks the next pixel. Alternatively, if the pixel under consideration is in the polygon as (indicated by the line 68) the process proceeds to the step of block 70, compute the vector OC. The next step in the process is represented by the block 72 and involves the use of the vectors OC, OP₁, OP₂ and OP₃ to compute the values of K₁, K₂ and K₃. The details of these computations were treated above. With completion of the quantities K₁, K₂ and K₃, the barycentric coordinates b₁, b₂ and b₃ are computed for the pixel as indicated by the process block 74. Consequently, a basis exists for interpolating the polygon (triangle) to accomplish smooth shading or texture mapping as described above. Implementations of the system of the present invention may involve computing the barycentric coordinates in accordance herewith for any of a variety of functions. Recapitulating, that computation involves the computation of the triple products of the vectors OC, OP₁, OP₂ and OP₃ followed by the computation of the barycentric coordinates with a proportionality constant (equating the vector OC to the vector OP) which is eliminated. Of course, any of a variety of computing networks or facilities can be employed to accomplish such calculations in accordance with well known principles of the prior art. As illustrated in FIGURE 7 at block 76, the smooth shading operation is accomplished by using the vertex intensities i₁, i₂ and i₃ along with the barycentric coordinates b₁, b₂ and b₃ to compute a value of intensities i for the specific pixel. The operation produces a pixel intensity value. So also, texture mapping may be performed as explained above and as illustrated by block 77. The pixel values computed as indicated by the blocks 76 and 77 are stored as illustrated by the block 78. Normally, storage would be in a frame buffer preparatory to the display using well known techniques of the prior art. With the completion of the storage as represented by the block 78, the process returns to scan the next pixel as indicated by the line 80. The calculation of the barycentric coordinates in accordance herewith for application to computer graphics operations is illustrated in FIGURE 8 specifically with regard to texture mapping and smooth shading. These operations were described in detail above, accordingly the following explanation relates structure to the process. Referring to FIGURE 8, a polygon scan conversion structure 100 (upper left) receives polygon data as from transformation hardware in a display processor. Essentially, in accordance with the prior art, primitive data (representing polygons) is transformed preparatory to further processing. Essentially, the further processing may incorporate shading and texture mapping in accordance herewith. Such operations may be accomplished by the structure as illustrated in FIGURE 8. The texturing and shading of individual polygons is executed by the illustrative system in two phases, i.e. phase PH₁ and phase PH₂. Signals indicative of the two phases PH₁ and PH₂ are provided by a control 102. It is to be appreciated that the control 102, along with the polygon scan conversion structure 100, typically would be incorporated in a total computer graphics system of considerable complexity. However, for purposes of the present invention, which involves a specific system for generating barycentric coordinates for specific functions, the structure of FIGURE 8 is segregated so as to afford a manageable presentation. The control 102 provides the signals PH₁ and PH₂ in a manner to sequence the operation of the components as illustrated in the system of FIGURE 8. Generally in that regard, the initial phase PH₁, defined by the signal also termed PH₁, involves the preliminary processing of a fresh polygon. The second phase PH₂, defined by the signal PH₂, affords the computation of intensity and texture values for each individual pixel as the current polygon is scan converted. The polygon scan conversion structure 100 is coupled to a polygon storage 106 and to a computing network 112. The polygon storage 106 receives the polygon data during the initial phase PH₁ and in turn supplies specific components of the data to operating units during phases PH₁ and PH₂. Specifically, the storage 106 supplies the vertex data O, P₁, P₂ and P₃ to a computing network 108 during the initial phase PH₁. With such data, the network 108 computes the vectors OP₁, OP₂ and OP₃ utilizing available computing elements. The representations of the computed vectors are placed in a storage 110. During the second phase PH₂ of operation, the scan conversion structure 100 supplies values which are pertinent to each individual pixel to the computing network 112. Specifically, a value representative of the vector OC associated with a pixel lying within the polygon is supplied from the structure 100 to a computing network 112 that also is coupled to the storage 110. Additionally, the intensity signals i₁, i₂ and i₃ are provided from the polygon storage 106 to a shade computing network 114. The barycentric coordinates as represented by the signals b₁, b₂ and b₃ from the network 112 also are supplied to the shade computing network 114. Somewhat similarly, the barycentric coordinates are provided from the computing network 112 to a texture computing network 116 which also receives texture signals tx₁, tx₂, tx₃, ty₁, ty₂ and ty₃ from the polygon storage 106. Considering the operation of the system of FIGURE 8, the polygon data is received in the structure 100 for specific analysis and distribution. In that regard, the structure 100 is actuated by the control 102 which sequences the distinct phases and controls the operations. During the phase PH₁, the preliminary data of a polygon is received by the polygon scan conversion structure 100. Subsequently, during the phase PH₁, this data is transmitted to the polygon storage 106. Subsequently, during the phase PH₁, the polygon storage 106 transmits points P₁, P₂, P₃ and O to the computing network 108 which calculates the vectors OP₁, OP₂ and OP₃ and transmits them to the storage 110. Subsequently, during the phase PH₂, the polygon scan conversion structure 100 determines which pixels lie within the polygon utilizing scan conversion operations, and provides a unique vector OC for each such pixel to be used in shading and texture computations for that individual pixel in accordance herewith. Specifically, as each pixel lying within the polygon is encountered, a unique vector OC is transmitted to the computing network, and the computing networks 112, 114 and 116 are actuated to calculate shade and texture pixel data. During the processing for each pixel, the barycentric coordinates b₁, b₂ and b₃ are computed for the pixel and applied to the computing networks 114 and 116. The network 114 accomplishes the appropriate shade for the pixel applying the equation i = b₁i₁+b₂i₂+b₃i₃. As indicated above, the equation also might be represented as: i = (b₁,b₂,b₃)·(i₁,i₂,i₃). The determined values of i (one for each pixel) are registered in the frame buffer during the interval PH₂ in accordance with the particular display format. Concurrent with the above operations, the texture mapping operation is performed by the texture computing network 116. Specifically, the calculation involves the determination of values tx and ty by the network 116 executing the equations: tx = (b₁,b₂,b₃)·(tx₁,tx₂,tx₃) ty = (b₁,b₂,b₃)·(ty₁,ty₂,ty₃). Again, the texture mapping values for each pixel are registered in the frame buffer 120 in accordance with the display format of the system. From the above it may be seen that the system of the present invention enables the determination of barycentric coordinates for polygons in order to accomplish such specific operations as smooth shading and texture mapping. As indicated above, various other computer graphics operations can be accomplished to afford data signals for computer graphics displays by utilizing such barycentric coordinates. Accordingly, it will be readily appreciated from the above explanation that the system hereof is susceptible to a large number of modifications and deviations within the basic conceptual network. Accordingly, the scope hereof is deemed to be as set forth in the claims below.

Claims: A process of interpolating a graphic object (10) as for shading or texturing for determining pixel data in a computer graphics system, comprising the steps of: defining, in a space not subject to linear distortion, at least a part of said object as a planar polygon having at least three vertices; selecting the vertices of a triangular polygon (24) lying within said planar polygon, said vertices of said triangular polygon designated P₁, P₂ and P₃ ; characterised in that the process comprises the steps of: defining an eyepoint O in relation to said planar polygon to resolve vectors OP₁, OP₂, OP₃ from said eyepoint to said vertices; defining a perspective plane (28) in relation to said eyepoint and specifying a pixel location (34) in said plane whereby a ray extending from said eyepoint to said pixel defines a vector OC from said eyepoint to said pixel; defining a space point (P) where a scalar multiple of said vector OC intersects the plane of said planar polygon; generating the multiple products of the vectors OC, OP₁, OP₂, OP₃ defined as K₁, K₂, K₃; computing barycentric coordinates for said planar polygon as, b₁ = K₁/(K₁ + K₂ + K₃) b₂ = K₂/(K₁ + K₂ + K₃) b₃ = K₃/(K₁ + K₂ + K₃); and interpolating to accomplish said shading or texturing or to calculate said point for said pixel in accordance with said barycentric coordinates. A process according to claim 1 wherein said step of generating multiple products of the vectors comprises applying equations as a dot product and a cross-product, as K₁ = OC . [OP₂ x OP₃] K₂ = OC . [OP₃ x OP₁] K₃= OC . [OP₁ x OP₂]. A process according to claim 1 or claim 2 wherein said interpolating step comprises interpolation of the intensity of said pixel (34) in accordance with said barycentric coordinates. A process according to claim 3 wherein said interpolation of intensity i is accomplished by a form of the equation, i = b₁i₁ + b₂i₂ + b₃i 3. A process according to any preceding claim wherein said interpolating step comprises interpolation of multiple components of a surface normal vector at the space point (P). A process according to any preceding claim wherein said interpolating step comprises interpolation of texture for said pixel (34). A process according to claim 6 wherein texture coordinates for said vertices are designated as vectors (tx₁,tx₂,tx₃) and (ty₁,ty₂,ty₃); and the texture of said space point (P) is interpolated as: tx = (b₁,b₂,b₃) . (tx₁,tx₂,tx₃) ty = (b₁,b₂,b₃) . (ty₁,ty₂,ty₃). A system for interpolating a graphic object (10) as for shading or texturing pixels, wherein said object is represented, in a space not subject to linear distortion, at least in part by a planar polygon (24) with defined vertices P₁, P₂, P₃ and further, wherein an eyepoint O is specified along with a perspective plane (28) to resolve vectors OP₁, OP₂, OP₃ from said eyepoint O to said vertices and a vector OC from said eyepoint to a pixel (34) on said perspective plane, said system comprising: means for generating multiple products of the vectors OC, OP₁, OP₂, OP₃ to provide representations of K₁, K₂, K₃; means (112) for computing barycentric coordinates for said planar polygon using a form of the equation, b₁ = K₁/(K₁ + K₂ + K₃) b₂ = K₂/(K₁ + K₂ + K₃) b₃ = K₃/(K₁ + K₂ + K₃) to provide barycentric signals; and means (114, 116) for interpolating said polygon for said pixel in accordance with said barycentric coordinates to provide pixel signals. A process for determining pixel data for use in computer graphics systems to provide a display and wherein triangular, planar areas are scan converted to individual pixel data for said display comprising: defining the vertices P₁, P₂ and P₃ of one of said triangular, planar areas (24) as represented computer graphics elements; characterised in that the process comprises the steps of: defining an eyepoint O in relation to one of said triangular, planar areas and computing vectors OP₁, OP₂ and OP₃ as represented computer graphics elements; defining a perspective plane (28) in relation to said eyepoint and specifying a pixel location (34) in said plane whereby a ray extending from said eyepoint extends to said pixel and accordingly defines a vector OC from said eyepoint to said pixel; defining a space point (P) where a scalar multiple of said vector OC intersects the plane of said triangular, planar area; generating the multiple products of the vectors OC, OP₁, OP₂, OP₃ defined as K₁, K₂, K₃; computing barycentric coordinates for said planar polygon as, b₁ = K₁/(K₁ + K₂ + K₃) b₂ = K₂/(K₁ + K₂ + K₃) b₃ = K₃/(K₁ + K₂ + K₃); and applying representations of said barycentric coordinates to accomplish data for said display.

Inventors: BROWN RUSSELL A, JENSEN THOMAS W, ROBINSON JOHN A, BROWN, RUSSELL A., JENSEN, THOMAS W., ROBINSON, JOHN A.
Applicants: EVANS & SUTHERLAND COMPUTER CO, EVANS & SUTHERLAND COMPUTER CORPORATION
Application year: 1988
Main classification: G06T11
IPC codes: G06T15