This invention relates to rendering a pencil-sketch image from three-dimensional (3D) data.
A pencil-sketch image approximates shading and depth by varying the placement and density of discrete line segments. Unlike traditional “smooth”, or Gouraud, shading where transitions between light and dark regions of an image are gradual, pencil-sketching uses hard edge boundaries between regions. That is, transitions between regions are created by terminating line segments in the regions, not by blending one neighboring region into another region.
Referring to
A unit normal vector (“normal”) 20a, 20b and 20c at each respective vertex 15a, 15b and 15c affects how the vertex is perceived relative to a predefined reference point (the “eyepoint”) 23 (
In pre-processing phase 29, process 27 obtains (51) a set of “pencil” markings. The pencil markings are bitmap images of line segments that may be scanned-in, read from a disk, retrieved from memory, or generated dynamically. The pencil markings may be straight, curved, or crooked. Also, the pencil markings may be of varying thickness and length, depending upon the type of textures that they are used to construct.
Process 27 constructs (52) a set of N (N≧1) 2D textures by selecting pencil markings and arranging them uniformly to create various texture maps/tiles. The pencil markings are arranged at different densities and are parallel and/or perpendicular to one another to create different textures.
In
However, this does not always alleviate the appearance of tiling; accordingly, the line segments may be created to ensure that the C1 continuity property holds, in which the first derivatives (slopes) of the segments at the start and end points of adjacent tiles are roughly equal. This can be difficult to achieve, but can be simulated by randomly selecting the starting point for a line segment and wrapping the line segment around the texture at the end of the tile.
Pre-processing phase 29 set forth above may be performed at any time prior to run-time phase 30. It is noted that a single pre-processing phase may be used to store textures for several different run-time phases.
In run-time phase 30, process 27 selects (53) a background onto which a pencil-sketch image is to be rendered. The background may be selected from a set of backgrounds stored in memory or it may be obtained from another source, such as a disk or a scanned image. The background is an orthographic projection of a relatively large quadrilateral texture mapped with a paper (or other) texture.
When rendering a pencil-sketch image from 3D polygon data, process 27 determines (54) which pencil-sketch texture to use for the polygon. Process 27 does this based on the way that the polygon is illuminated, i.e., based on the light that hits the polygon. To determine how light hits a polygon, process 27 obtains (55) a texture value using the vertex normals (see FIG. 3). For polygon 13 (FIG. 4), process 27 calculates the vector dot product of unit normal vector 20b (N) and unit light vector 25 (L).
Since N and L are both unit vectors the product of N·L is the cosine of the angle 18 formed between the two vectors. If the angle between N and L is small, then the diffuse component of smooth shading is high and N·L will have a value close to one. On the other hand, if the angle is large, then the amount of diffuse component in smooth shading is low and N·L has a value close to zero.
Process 27 takes the maximum of the resulting dot product (N·L) and zero, i.e., Max(N·L,0) and defines that value as the texture value for the vertex, in this case vertex 20b of polygon 13. The maximum is taken to discount polygons that are in the back of the 3D model relative to the light source and, thus, produce a negative N·L value.
For each vertex 20a, 20b and 20c of polygon 13, process 27 obtains (55) a texture value. Process 27 classifies (56) the polygon based on the obtained texture values. Process 27 uses the texture values to associate each vertex of polygon 13 with one of M (M≧1) bins in memory, each of which corresponds to a predetermined range of values. For example, a system might include three bins having intervals of [0,a], (a,b] and (b,1], where “a” and “b” are adjustable values with a<b, 0≦a and b≦1, and where square brackets indicate exclusion and parenthetic brackets indicate exclusion, e.g., “a” is included in the range [0,a] but excluded from the range (a,b]. So, in this example, if a texture value of vertex 20b is “a”, vertex 20b will be associated with bin [0,a]. Different numbers and/or ranges of bins may be used in process 27.
Process 27 associates (57) one of the N pencil sketch textures from
Once process 27 determines (54) the texture for polygon 13, process 27 projects (58) polygon 13 onto a 2D surface. Referring to the example shown in
Referring back to
Process 27 may be used to create animation cels for cartooning. For example, a 3D model, such as model 10, may be generated, and then positioned in a desired manner. Process 27 may be executed on the model to produce a pencil-sketch 2D image for that position. Then, the 3D model 10 can be repositioned (e.g., rotated), and process 27 executed on the repositioned model to produce a pencil-sketch 2D image for a different perspective of the model. This process may be repeated to produce pencil-sketch 2D images for any number of model positions. Thus, process can generate animation cels automatically, meaning without the use of hand-drawn sketches.
Process 27 runs in real-time, which facilitates the animation process. That is, in conventional hand-drawn animation, artists cannot interactively change the appearance/view of a character without re-drawing the character manually. Process 27 permits this because it renders frames of animation (i.e., 2D images) dynamically and automatically for a given viewpoint in real-time. In this regard, the viewpoint is not the only aspect of a frame that can be dynamically manipulated using process 27. Light moving relative to a character and model changes the locations of shadows on those objects, just as in a conventional 3D Gouraud-shaded scene.
Process 27 can be used for interactive technical illustrations and real-time video game play. For example, a pencil-sketch game may be constructed in which a user navigates throughout a virtual world that appears in 2D, e.g., a world that simulates a newspaper comic. So-called “How-To” manuals, particularly the online variety, often make use of pencil-sketch drawings to illustrate aspects of a model. Process 27 may be used to allow a reader to examine the model from different angles/perspectives.
Process 27 is not limited to use with the hardware and software of
Each such program may be implemented in a high level procedural or object-oriented programming language to communicate with a computer system. However, the programs can be implemented in assembly or machine language. The language may be a compiled or an interpreted language.
Each computer program may be stored on a storage medium or device (e.g., CD-ROM, hard disk, or magnetic diskette) that is readable by a general or special purpose programmable computer for configuring and operating the computer when the storage medium or device is read by the computer to perform process 27. Process 27 may also be implemented as a computer-readable storage medium, configured with a computer program, where, upon execution, instructions in the computer program cause the computer to operate in accordance with process 27.
Other embodiments not described herein are also within the scope of the following claims.
Number | Name | Date | Kind |
---|---|---|---|
4600919 | Stern | Jul 1986 | A |
4747052 | Hishinuma et al. | May 1988 | A |
4835712 | Drebin et al. | May 1989 | A |
4855934 | Robinson | Aug 1989 | A |
4901064 | Deering | Feb 1990 | A |
5124914 | Grangeat | Jun 1992 | A |
5163126 | Einkauf et al. | Nov 1992 | A |
5371778 | Yanof et al. | Dec 1994 | A |
5611030 | Stokes | Mar 1997 | A |
5731819 | Gagne et al. | Mar 1998 | A |
5757321 | Billyard | May 1998 | A |
5786822 | Sakaibara et al. | Jul 1998 | A |
5805782 | Foran | Sep 1998 | A |
5809219 | Pearce et al. | Sep 1998 | A |
5812141 | Kamen et al. | Sep 1998 | A |
5847712 | Salesin et al. | Dec 1998 | A |
5894308 | Isaacs | Apr 1999 | A |
5929860 | Hoppe | Jul 1999 | A |
5933148 | Oka et al. | Aug 1999 | A |
5949969 | Suzuoki et al. | Sep 1999 | A |
5966133 | Hoppe | Oct 1999 | A |
5966134 | Arias | Oct 1999 | A |
5974423 | Margolin | Oct 1999 | A |
6054999 | Strandberg | Apr 2000 | A |
6057859 | Handelman et al. | May 2000 | A |
6078331 | Pulli et al. | Jun 2000 | A |
6115050 | Landau et al. | Sep 2000 | A |
6175655 | George, III et al. | Jan 2001 | B1 |
6191787 | Lu et al. | Feb 2001 | B1 |
6191796 | Tarr | Feb 2001 | B1 |
6198486 | Junkins et al. | Mar 2001 | B1 |
6201549 | Bronskill | Mar 2001 | B1 |
6208347 | Migdal et al. | Mar 2001 | B1 |
6219070 | Baker et al. | Apr 2001 | B1 |
6239808 | Kirk et al. | May 2001 | B1 |
6252608 | Snyder et al. | Jun 2001 | B1 |
6262737 | Li et al. | Jul 2001 | B1 |
6262739 | Migdal et al. | Jul 2001 | B1 |
6292192 | Moreton | Sep 2001 | B1 |
6317125 | Persson | Nov 2001 | B1 |
6337880 | Cornog et al. | Jan 2002 | B1 |
6388670 | Naka et al. | May 2002 | B1 |
6405071 | Analoui | Jun 2002 | B1 |
6437782 | Pieragostini et al. | Aug 2002 | B1 |
6478680 | Yoshioka et al. | Nov 2002 | B1 |
6559848 | O'Rourke | May 2003 | B1 |
6593924 | Lake et al. | Jul 2003 | B1 |
6593927 | Horowitz et al. | Jul 2003 | B1 |
6608627 | Marshall et al. | Aug 2003 | B1 |
6608628 | Ross et al. | Aug 2003 | B1 |
20010026278 | Arai et al. | Oct 2001 | A1 |
20020101421 | Pallister | Aug 2002 | A1 |