Claims
- 1. A shading method for approximating a three-dimensional curved surface for computer graphics wherein shading of a two-dimensional surface is provided by varying pixel brightness values to indicate a depth dimension on the two-dimensional surface, comprising the steps of:
- approximating the three-dimensional curved surface by employing a plurality of polygons with each polygon approximating a portion of the curved surface, and wherein each polygon is defined as at least one or more trapezoids;
- providing a coordinate grid extending in horizontal and vertical directions with each grid point thereof representing a pixel whose brightness level is to be varied in accordance with said depth dimension and wherein scanning occurs across scan lines in a horizontal direction across the grid from grid point to grid point and parallel to parallel sides of the trapezoids;
- providing the trapezoids on the coordinate grid so that addresses of vertices of the trapezoids can be determined in the coordinate grid, said vertices lying at any point not necessarily lying directly on a grid point at a pixel, and providing brightness values at each of the vertices;
- determining brightness values of respective pixels at grid points of the coordinate grid lying inside each of the trapezoids by linear interpolation based on addresses and brightness values of the trapezoid vertices which may not necessarily be on a grid point; and
- where a distance in a vertical direction of the trapezoid is less than a predetermined value causing a side to be nearly horizontal, replacing the nearly horizontal side with a vertical side which starts with one of the end points of the side which is nearly horizontal.
- 2. A method according to claim 1 comprising the further steps of:
- conducting a first compensating computation in a vertical direction of the coordinate grid by employing each of the vertex brightness values and addresses of the trapezoids at opposite sides of the trapezoids running in a primarily vertical direction so as to compute brightness values at left and right end points of a scan line intersecting said primarily vertical left and right sides of the trapezoid; and
- conducting a second compensating computation in a horizontal direction of said scan line by use of the left and right end point brightness values so as to determine brightness values at each coordinate grid point pixel on said scan line intermediate the left and right points.
- 3. A method according to claim 2 wherein said vertical compensating includes finding left and right end points of additional scan lines by linear interpolation, and for each scan line using linear interpolation to determine pixel brightness values of pixels on the respective scan line based on the left and right end point brightness values.
- 4. A method according to claim 1 wherein at least one of said trapezoids is simplified as a triangle since only one vertex lies on a corresponding line parallel to the scan lines.
- 5. A shading system for approximating a three-dimensional curved surface for computer graphics wherein shading of a two-dimensional surface is provided by varying pixel brightness values to indicate a depth dimension on the two dimensional surface, comprising:
- means for approximating the three-dimensional curved surface by employing a plurality of polygons with each polygon being employed approximating a portion of the curved surface, and wherein each polygon is defined as at least one or more trapezoids;
- a coordinate grid extending in horizontal and vertical directions with each grid point thereof representing a pixel whose brightness level is to be varied in accordance with said depth dimension and wherein scanning occurs across scan lines in a horizontal direction across the grid from grid point to grid point and parallel to parallel sides of the trapezoids;
- means for providing the trapezoids on the coordinate grid so that addresses of vertices of the trapezoids can be determined in the coordinate grid, said vertices not necessarily lying directly on a grid point at a pixel, and providing brightness values at each of the vertices;
- means for determining brightness values of respective pixels at grid points of the coordinate grid lying inside each of the trapezoids by linear interpolation based on addresses and brightness values of the vertices which may not necessarily lie at a grid point; and
- where a distance in a vertical direction of the trapezoid is less than a predetermined value causing a side to be nearly horizontal, means for replacing the nearly horizontal side with a vertical side which starts with one of the end points of the side which is nearly horizontal.
- 6. A system according to claim 5 further comprising:
- means for conducting a first compensating computation in a vertical direction of the coordinate grid by employing each of the vertex brightness values and addresses of the trapezoids at opposite sides of the trapezoids running in a primarily vertical direction so as to compute brightness values at left and right end points of a scan line intersecting said primarily vertical left and right sides of the trapezoids; and
- means for conducting a second compensating computation in a horizontal direction of said scan line by use of the left and right end point brightness values so as to determine brightness values at each coordinate grid point pixel on said scan line intermediate the left and right end points.
- 7. A shading system according to claim 5 wherein at least one of said trapezoids is simplified as a triangle since only one vertex lies on a corresponding line parallel to the scan lines.
Priority Claims (5)
Number |
Date |
Country |
Kind |
1-332147 |
Dec 1989 |
JPX |
|
1-333632 |
Dec 1989 |
JPX |
|
1-333633 |
Dec 1989 |
JPX |
|
1-333634 |
Dec 1989 |
JPX |
|
1-333635 |
Dec 1989 |
JPX |
|
Parent Case Info
This is a continuation of application Ser. No. 07/921,430, filed Jul. 31, 1992, now abandoned, which is a continuation of application Ser. No. 630,893, filed Dec. 20, 1990, now abandoned.
US Referenced Citations (7)
Foreign Referenced Citations (1)
Number |
Date |
Country |
0319787 |
Jun 1989 |
EPX |
Continuations (2)
|
Number |
Date |
Country |
Parent |
921430 |
Jul 1992 |
|
Parent |
630893 |
Dec 1990 |
|