JP2720818B2 - 3D polygon drawing method - Google Patents

3D polygon drawing method

Info

Publication number
JP2720818B2
JP2720818B2 JP7093048A JP9304895A JP2720818B2 JP 2720818 B2 JP2720818 B2 JP 2720818B2 JP 7093048 A JP7093048 A JP 7093048A JP 9304895 A JP9304895 A JP 9304895A JP 2720818 B2 JP2720818 B2 JP 2720818B2
Authority
JP
Japan
Prior art keywords
pixel
value
polygon
pixels
representative
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP7093048A
Other languages
Japanese (ja)
Other versions
JPH08263693A (en
Inventor
阿津子 大羽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
Nippon Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP7093048A priority Critical patent/JP2720818B2/en
Publication of JPH08263693A publication Critical patent/JPH08263693A/en
Application granted granted Critical
Publication of JP2720818B2 publication Critical patent/JP2720818B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、二次元の表示領域に対
して三次元的な描画(表示)を行う三次元描画システム
において多角形を描画する三次元多角形描画方式に関
し、特に隠面消去処理を行う三次元多角形描画方式に関
する。なお、本願明細書では、三次元多角形描画方式に
おける描画対象の多角形は台形であることを前提として
説明を行う。ただし、台形以外の複雑な多角形について
も、台形分割処理や台形近似処理によって台形の集合と
して処理することができるので、本発明の三次元多角形
描画方式における描画対象の多角形が台形に限られるも
のでないことはいうまでもない。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a three-dimensional polygon drawing method for drawing a polygon in a three-dimensional drawing system for performing three-dimensional drawing (display) on a two-dimensional display area, and more particularly to a hidden surface. The present invention relates to a three-dimensional polygon drawing method for performing an erasing process. In the specification of the present application, description will be made on the assumption that the polygon to be drawn in the three-dimensional polygon drawing method is a trapezoid. However, a complex polygon other than a trapezoid can be processed as a set of trapezoids by trapezoidal division processing or trapezoidal approximation processing, so that the polygon to be drawn in the three-dimensional polygon drawing method of the present invention is limited to a trapezoid. It goes without saying that it is not something that can be done.

【0002】[0002]

【従来の技術】従来の三次元多角形描画方式において隠
面消去処理が行われる場合には、表示領域における全ピ
クセルの各々の深さ値(奥行き値。以下、「z値」とい
う)を格納するz値格納手段(zバッファ)が設けら
れ、以下のような処理が行われていた(図6参照)。
2. Description of the Related Art When a hidden surface erasing process is performed in a conventional three-dimensional polygon drawing method, depth values (depth values; hereinafter, referred to as "z values") of all pixels in a display area are stored. A z-value storage means (z-buffer) is provided to perform the following processing (see FIG. 6).

【0003】 現時点で描画対象となっている多角形
(以下、「カレント描画多角形」という)の左辺と各ス
キャンラインとの交点に位置するピクセル(以下、カレ
ント描画多角形についての当該各スキャンラインの「左
端点ピクセル」という)のz値(図6中のza)と、カ
レント描画多角形の右辺と各スキャンラインとの交点に
位置するピクセル(以下、カレント描画多角形について
の当該各スキャンラインの「右端点ピクセル」という)
のz値(図6中のzb)とが、カレント描画多角形が存
在する全スキャンラインについて求められる。
A pixel located at an intersection of each scan line with a left side of a polygon to be rendered at the present time (hereinafter, referred to as a “current rendering polygon”) (hereinafter, each scan line of the current rendering polygon) (Referred to as “left end pixel”) (za in FIG. 6) and a pixel located at the intersection of the right side of the current drawing polygon and each scan line (hereinafter, each scan line of the current drawing polygon) "Right end pixel")
(Zb in FIG. 6) is obtained for all scan lines where the current drawing polygon exists.

【0004】 カレント描画多角形に包含される各ピ
クセルのz値が、で求められたz値(図6中のzaお
よびzb)に基づいて、以下の式によって求められる。
なお、図6に示すように、算出対象のピクセルのx座標
値をxcとし、算出されるz値をzcとする。 zc=za+{(zb−za)/(xb−xa)}×
(xc−xa)
The z value of each pixel included in the current drawing polygon is obtained by the following equation based on the z values (za and zb in FIG. 6) obtained by:
Note that, as shown in FIG. 6, the x coordinate value of the pixel to be calculated is xc, and the calculated z value is zc. zc = za + {(zb−za) / (xb−xa)} ×
(Xc-xa)

【0005】 およびによって求められた各ピク
セルのz値と、z値格納手段内の当該各ピクセルのz値
(当該各ピクセルの座標位置と同じ座標位置におけるz
値格納手段内のz値)とが比較される。
And the z value of each pixel in the z value storage means (z at the same coordinate position as the coordinate position of each pixel)
(Z value in the value storage means).

【0006】 の比較結果と隠面条件とが照合され
て、その照合結果に基づいて隠面消去処理が行われる。
すなわち、カレント描画多角形の各ピクセルのz値がz
値格納手段内の当該各ピクセルのz値よりも深い位置を
示している場合には、そのピクセルに関してはカレント
描画多角形の描画は行われない(両方のz値が等しい場
合にカレント描画多角形の描画を行うか否かは隠面条件
による)。
The comparison result is compared with the hidden surface condition, and the hidden surface erasing process is performed based on the comparison result.
That is, the z value of each pixel of the current drawing polygon is z
In the case where the position is deeper than the z value of each pixel in the value storage means, the current drawing polygon is not drawn for that pixel (when both z values are equal, the current drawing polygon is not drawn). Whether or not to perform drawing depends on the hidden surface condition).

【0007】[0007]

【発明が解決しようとする課題】上述した従来の三次元
多角形描画方式では、隠面消去処理のためのカレント描
画多角形に関するz値の作成(算出)がピクセル単位で
行われているので、複数の多角形が深さ方向に関して近
接する部分での誤った隠面消去処理の態様として、「表
示領域のスキャンライン方向において隣接するピクセル
群において一のピクセルについてはカレント描画多角形
が他の多角形の上/下に位置すると判断されて描画/消
去されるが、当該一のピクセルの両隣の他のピクセルに
ついてはカレント描画多角形が下/上に位置すると判断
されて消去/描画される」という現象が生じるおそれが
あった。
In the above-described conventional three-dimensional polygon drawing method, the creation (calculation) of the z value relating to the current drawing polygon for the hidden surface erasing process is performed in pixel units. As a mode of the erroneous hidden surface removal processing in a portion where a plurality of polygons are close to each other in the depth direction, the current drawing polygon may be set to another pixel in one pixel group adjacent in the scan line direction of the display area. It is determined that it is located above / below the polygon, and is drawn / erased. However, for the other pixels on both sides of the one pixel, it is determined that the current drawing polygon is located below / above, and is erased / drawn. " Phenomenon may occur.

【0008】これは、上述のz値(zc)の算出式等が
各ピクセルについて適用される場合の計算誤差に起因し
て生じるものであり、z値がほぼ同一の複数の多角形の
それぞれに関する計算誤差が隣接するピクセルの各々で
異なる影響を及ぼすことによって生じるものである。
This is caused by a calculation error when the above-described formula for calculating the z value (zc) is applied to each pixel, and relates to a plurality of polygons having substantially the same z value. This is caused by the calculation error having a different effect on each of the neighboring pixels.

【0009】従来の三次元多角形描画方式では、隠面消
去処理において生じる上述のような現象に起因して、複
数の多角形が深さ方向に関して近接する部分で掠れたよ
うな描画が生じるという問題点があった。
In the conventional three-dimensional polygon drawing method, a drawing in which a plurality of polygons are blurred in a portion close to the depth direction occurs due to the above-described phenomenon occurring in the hidden surface erasing process. There was a problem.

【0010】本発明の目的は、上述の点に鑑み、隠面消
去処理のためのz値の算出における計算誤差に起因して
生じていた描画上の掠れを低減させることができる三次
元多角形描画方式を提供することにある。
SUMMARY OF THE INVENTION In view of the foregoing, it is an object of the present invention to provide a three-dimensional polygon capable of reducing blurring in drawing caused by a calculation error in calculating a z value for hidden surface elimination processing. An object of the present invention is to provide a drawing method.

【0011】[0011]

【課題を解決するための手段】本発明の三次元多角形描
画方式は、三次元描画システムにおいて隠面消去処理を
行って多角形を描画する三次元多角形描画方式におい
て、表示領域に多角形を表示する表示手段と、カレント
描画多角形のx座標値,y座標値および色値を含む描画
データを作成する描画データ作成手段と、表示領域の全
ピクセルの各々のz値として、その時点において最も上
に位置する多角形に包含されるピクセルのz値を格納す
るz値格納手段と、カレント描画多角形に包含されるピ
クセルをスキャンライン方向に包括ピクセル数毎のピク
セル集合として統合し、各ピクセル集合の中の代表ピク
セルを設定するz値作成手段内のピクセル集合統合部
と、前記ピクセル集合統合部により設定された各ピクセ
ル集合の代表ピクセルのz値を求め、ピクセル集合に属
する全てのピクセルのz値を代表ピクセルのz値と同一
の値に設定するz値作成手段内のz値算出部と、前記z
値格納手段に格納されている各ピクセルのz値と前記z
値作成手段で作成されたカレント描画多角形に包含され
る各ピクセルのz値とをピクセル単位で比較してその比
較結果を作成するz値比較手段と、前記z値比較手段に
よって作成された比較結果と隠面条件とを照合してカレ
ント描画多角形に包含される各ピクセルに関してカレン
ト描画多角形を描画すべきか否かの判断を行い、描画す
べきと判断したピクセルについて前記描画データ作成手
段で作成された描画データの前記表示手段への出力,お
よび前記z値作成手段で作成されたz値の前記z値格納
手段への出力を行う描画制御手段とを有する。
According to a three-dimensional polygon drawing method of the present invention, a polygon is drawn in a display area in a three-dimensional polygon drawing method in which a hidden surface is erased in a three-dimensional drawing system to draw a polygon. , A drawing data generating means for generating drawing data including an x-coordinate value, a y-coordinate value and a color value of the current drawing polygon, and a z-value of each of all pixels in the display area at that time. Z-value storage means for storing the z-values of the pixels included in the uppermost polygon, and pixels included in the current drawing polygon are integrated as a pixel set for each number of inclusive pixels in the scan line direction. A pixel set integrating unit in the z-value creating means for setting a representative pixel in the pixel set, and a representative pixel of each pixel set set by the pixel set integrating unit Seeking z value, and the z value calculation section in the z value creation means for setting the z values of all pixels belonging to the pixel set to the same value as z value of the representative pixel, the z
The z value of each pixel stored in the value storage means and the z value
Z-value comparing means for comparing the z-value of each pixel included in the current drawing polygon created by the value creating means on a pixel-by-pixel basis and creating the comparison result, and the comparison created by the z-value comparing means By comparing the result with the hidden surface condition, it is determined whether or not to draw the current drawing polygon for each pixel included in the current drawing polygon. And drawing control means for outputting the created drawing data to the display means and outputting the z value created by the z value creation means to the z value storage means.

【0012】[0012]

【作用】本発明の三次元多角形描画方式では、表示手段
が表示領域に多角形を表示し、描画データ作成手段がカ
レント描画多角形のx座標値,y座標値および色値を含
む描画データを作成し、z値格納手段が表示領域の全ピ
クセルの各々のz値としてその時点において最も上に位
置する多角形に包含されるピクセルのz値を格納し、z
値作成手段内のピクセル集合統合部がカレント描画多角
形に包含されるピクセルをスキャンライン方向に包括ピ
クセル数毎のピクセル集合として統合し各ピクセル集合
の中の代表ピクセルを設定し、z値作成手段内のz値算
出部がピクセル集合統合部により設定された各ピクセル
集合の代表ピクセルのz値を求めピクセル集合に属する
全てのピクセルのz値を代表ピクセルのz値と同一の値
に設定し、z値比較手段がz値格納手段に格納されてい
る各ピクセルのz値とz値作成手段で作成されたカレン
ト描画多角形に包含される各ピクセルのz値とをピクセ
ル単位で比較してその比較結果を作成し、描画制御手段
がz値比較手段によって作成された比較結果と隠面条件
とを照合してカレント描画多角形に包含される各ピクセ
ルに関してカレント描画多角形を描画すべきか否かの判
断を行い描画すべきと判断したピクセルについて描画デ
ータ作成手段で作成された描画データの表示手段への出
力,およびz値作成手段で作成されたz値のz値格納手
段への出力を行う。
In the three-dimensional polygon drawing method of the present invention, the display means displays the polygon in the display area, and the drawing data creating means displays the drawing data including the x coordinate value, the y coordinate value, and the color value of the current drawing polygon. And the z-value storage means stores the z-value of the pixel contained in the polygon located at the top at that time as the z-value of each of all the pixels in the display area,
A pixel set integration unit in the value creation unit integrates the pixels included in the current drawing polygon in the scan line direction as a pixel set for each number of comprehensive pixels, sets a representative pixel in each pixel set, The z-value calculator within calculates the z-value of the representative pixel of each pixel set set by the pixel set integrating unit, sets the z-values of all the pixels belonging to the pixel set to the same value as the z-value of the representative pixel, The z value comparing means compares the z value of each pixel stored in the z value storing means with the z value of each pixel included in the current drawing polygon created by the z value creating means on a pixel-by-pixel basis. The comparison result is created, and the drawing control unit compares the comparison result created by the z-value comparison unit with the hidden surface condition, and calculates a calendar for each pixel included in the current drawing polygon. It is determined whether or not the drawing polygon should be drawn. For the pixel determined to be drawn, the drawing data created by the drawing data creation means is output to the display means, and the z-value created by the z-value creation means is output. Output to the z value storage means.

【0013】[0013]

【実施例】次に、本発明について図面を参照して詳細に
説明する。
Next, the present invention will be described in detail with reference to the drawings.

【0014】図1は、本発明の三次元多角形描画方式の
一実施例の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of an embodiment of a three-dimensional polygon drawing method according to the present invention.

【0015】本実施例の三次元多角形描画方式は、描画
データ作成手段1と、z値作成手段2と、z値比較手段
3と、描画制御手段4と、z値格納手段5と、表示手段
6とを含んで構成されている。なお、z値作成手段2
は、ピクセル集合統合部21と、z値算出部22とを含
んで構成されている。
The three-dimensional polygon drawing method according to the present embodiment includes a drawing data creating means 1, a z value creating means 2, a z value comparing means 3, a drawing controlling means 4, a z value storing means 5, And means 6. Note that the z-value creating means 2
Is configured to include a pixel set integration unit 21 and a z-value calculation unit 22.

【0016】図2は、本実施例の三次元多角形描画方式
の処理を示す流れ図である。この処理は、描画データ作
成ステップ201と、z値作成ステップ202と、z値
比較結果作成ステップ203と、隠面条件判断ステップ
204と、z値および色値出力ステップ205とからな
る。
FIG. 2 is a flowchart showing the processing of the three-dimensional polygon drawing method according to the present embodiment. This processing includes a drawing data creation step 201, a z value creation step 202, a z value comparison result creation step 203, a hidden surface condition determination step 204, and a z value and color value output step 205.

【0017】図3は、z値作成ステップ202の詳細な
処理を示す流れ図である。この処理は、全スキャンライ
ン終了判定ステップ300と、zaおよびzb算出ステ
ップ301と、ピクセル集合統合ステップ302と、代
表ピクセル設定ステップ303と、zc算出ステップ3
04と、全ピクセルz値設定ステップ305と、z値補
正ステップ306とからなる。
FIG. 3 is a flowchart showing the detailed processing of the z-value creation step 202. This processing includes an all scan line end determination step 300, a za and zb calculation step 301, a pixel set integration step 302, a representative pixel setting step 303, and a zc calculation step 3
04, an all-pixel z-value setting step 305, and a z-value correction step 306.

【0018】図4は、本実施例の三次元多角形描画方式
におけるz値作成手段2の処理を説明するための図であ
る。
FIG. 4 is a diagram for explaining the processing of the z-value creating means 2 in the three-dimensional polygon drawing method of the present embodiment.

【0019】図5(a)および(b)は、z値作成手段
2の処理のバリエーションを説明するための図である。
FIGS. 5A and 5B are diagrams for explaining variations of the processing of the z-value creating means 2. FIG.

【0020】次に、このように構成された本実施例の三
次元多角形描画方式の動作について説明する。
Next, the operation of the three-dimensional polygon drawing method of the embodiment constructed as described above will be described.

【0021】z値格納手段5は、表示手段6における表
示領域の全ピクセルの各々のz値を格納している。z値
格納手段5内の各ピクセルのz値としては、その時点に
おいて最も上に位置する多角形に包含されるピクセルの
z値が格納されている。なお、本実施例では、z値の値
は、大きいほど上の位置(浅い位置)を示しているもの
とする。
The z value storage means 5 stores the z value of each pixel in the display area of the display means 6. As the z value of each pixel in the z value storage means 5, the z value of the pixel included in the polygon located at the highest point at that time is stored. In this embodiment, it is assumed that the larger the z value, the higher the position (shallow position).

【0022】また、本実施例が適用される三次元描画シ
ステムでは、カレント描画多角形を構成するピクセルの
z値がその時点におけるz値格納手段5内の当該ピクセ
ルのz値よりも大きい場合には、当該ピクセルに関する
描画を行い、そのz値を新たなz値格納手段5内のz値
とするものとする。すなわち、「以前に描画した多角形
よりz値が小さいか等しい場合にカレント描画多角形を
描画しない」という隠面条件が設定されているものとす
る。
In the three-dimensional drawing system to which the present embodiment is applied, when the z value of a pixel constituting the current drawing polygon is larger than the z value of the pixel in the z value storage means 5 at that time. Performs drawing on the pixel, and uses the z value as the z value in the new z value storage means 5. That is, it is assumed that the hidden surface condition is set such that “the current drawing polygon is not drawn when the z value is smaller than or equal to the previously drawn polygon”.

【0023】描画データ作成手段1は、カレント描画多
角形に包含される各ピクセルのx座標値,y座標値およ
び色値を含む描画データを作成する(ステップ20
1)。このような描画データの作成処理は、従来技術に
おける処理と同様のものである。
The drawing data creating means 1 creates drawing data including the x coordinate value, the y coordinate value, and the color value of each pixel included in the current drawing polygon (step 20).
1). The processing for creating such drawing data is the same as the processing in the related art.

【0024】z値作成手段2は、以下の〜に示すよ
うにしてカレント描画多角形を構成する各ピクセルのz
値を作成する(図3および図4参照)。なお、以下の処
理は、カレント描画多角形が存在する各スキャンライン
について繰り返される処理である(ステップ300参
照)。
The z-value creating means 2 calculates the z value of each pixel constituting the current drawing polygon as shown in the following.
Create values (see FIGS. 3 and 4). The following processing is repeated for each scan line where the current drawing polygon exists (see step 300).

【0025】 z値算出部22は、カレント描画多角
形の左辺と処理対象のスキャンラインとの交点に位置す
るピクセル(左端点ピクセル)のz値(図4中のza)
と、カレント描画多角形の右辺と当該スキャンラインと
の交点に位置するピクセル(右端点ピクセル)のz値
(図4中のzb)とを求める(ステップ301)。な
お、このようなz値の算出処理は、従来技術における処
理と同様のものである。
The z-value calculator 22 calculates the z-value (za in FIG. 4) of a pixel (left-end pixel) located at the intersection of the left side of the current drawing polygon and the scan line to be processed.
And the z value (zb in FIG. 4) of a pixel (right end pixel) located at the intersection of the right side of the current drawing polygon and the scan line (step 301). Note that such z-value calculation processing is the same as the processing in the related art.

【0026】 ピクセル集合統合部21は、カレント
描画多角形が存在する領域に関し、当該スキャンライン
について、x座標値が0のピクセルから包括ピクセル数
(あらかじめ与えられている任意のピクセル数)毎にピ
クセル集合を抽出して統合する(ステップ302)。す
なわち、カレント描画多角形のスキャンライン方向の各
ピクセル集合を、表示領域の原点を基準として、包括ピ
クセル数毎に区切ることによって求める。ここで、左端
点ピクセルを含むピクセル集合を「左端ピクセル集合」
といい、右端点ピクセルを含むピクセル集合を「右端ピ
クセル集合」といい、左端ピクセル集合と右端ピクセル
集合との間に存在するピクセル集合を「中間ピクセル集
合」という。
The pixel set integration unit 21 determines, for a region where the current drawing polygon exists, a pixel of the scan line from the pixel having the x-coordinate value of 0 for every comprehensive pixel number (arbitrary pixel number given in advance). A set is extracted and integrated (step 302). That is, each pixel set in the scan line direction of the current drawing polygon is obtained by dividing the pixel set by the number of comprehensive pixels based on the origin of the display area. Here, a pixel set including the left end pixel is referred to as a “left end pixel set”.
The pixel set including the rightmost pixel is referred to as “rightmost pixel set”, and the pixel set existing between the leftmost pixel set and the rightmost pixel set is referred to as “intermediate pixel set”.

【0027】 また、ピクセル集合統合部21は、各
ピクセル集合の代表ピクセルを当該各ピクセル集合の左
端のピクセルに設定する(ステップ303)。
The pixel set integration unit 21 sets the representative pixel of each pixel set to the leftmost pixel of each pixel set (step 303).

【0028】 z値算出部22は、各中間ピクセル集
合の代表ピクセルのz値を以下に示す式(「中間ピクセ
ルz値算出式」という)に基づいて算出する(ステップ
304)。なお、算出対象の中間ピクセル集合の代表ピ
クセルのx座標値をxcとし、算出されるz値をzcと
し、左端ピクセル集合の代表ピクセルのx座標値をx
a′とし、右端ピクセル集合の代表ピクセルのx座標値
をxb′とする。 zc=za+{(zb−za)/(xb′−xa′)}
×(xc−xa′)
The z-value calculating unit 22 calculates the z-value of the representative pixel of each intermediate pixel set based on the following expression (referred to as “intermediate pixel z-value calculation expression”) (Step 304). Note that the x coordinate value of the representative pixel of the set of intermediate pixels to be calculated is xc, the calculated z value is zc, and the x coordinate value of the representative pixel of the leftmost pixel set is x
a ', and the x coordinate value of the representative pixel of the rightmost pixel set is xb'. zc = za + {(zb−za) / (xb′−xa ′)}
× (xc−xa ′)

【0029】 また、z値算出部22は、各ピクセル
集合に属する全てのピクセルのz値を当該各ピクセル集
合の代表ピクセルのz値と同一の値に設定する(ステッ
プ305)。ここで、左端ピクセル集合の代表ピクセル
のz値を左端点ピクセルのz値であるzaとみなし、右
端ピクセル集合の代表ピクセルのz値を右端点ピクセル
のz値であるzaとみなすものとする。これにより、左
端ピクセル集合に属する全てのピクセルのz値が左端点
ピクセルのz値と同一の値に設定され、右端ピクセル集
合に属する全てのピクセルのz値が右端点ピクセルのz
値と同一の値に設定され、中間ピクセル集合に属する全
てのピクセルのz値がステップ304で求められた当該
中間ピクセル集合の代表ピクセルのz値と同一の値に設
定される。
Further, the z-value calculator 22 sets the z-values of all the pixels belonging to each pixel set to the same values as the z-values of the representative pixels of each pixel set (step 305). Here, it is assumed that the z value of the representative pixel of the leftmost pixel set is regarded as za which is the z value of the leftmost pixel, and the z value of the representative pixel of the rightmost pixel set is regarded as za which is the z value of the rightmost pixel. As a result, the z-values of all the pixels belonging to the leftmost pixel set are set to the same value as the z-values of the leftmost pixel, and the z-values of all the pixels belonging to the rightmost pixel set are z values of the rightmost pixel.
The z value of all the pixels belonging to the intermediate pixel set is set to the same value as the z value of the representative pixel of the intermediate pixel set obtained in step 304.

【0030】 さらに、z値算出部22は、左端ピク
セル集合において左端点ピクセルよりも左側に存在する
ピクセルおよび右端ピクセル集合において右端点ピクセ
ルよりも右側に存在するピクセルのz値を「多角形が存
在しないことを示す情報」(ここでは、0)に補正する
(ステップ306)。
Further, the z-value calculating unit 22 determines the z-value of a pixel existing on the left side of the leftmost pixel in the leftmost pixel set and a pixel present on the right side of the rightmost pixel in the rightmost pixel set as “polygon exists. To "information indicating not to be performed" (here, 0) (step 306).

【0031】なお、包括ピクセル数の値は経験則的に、
例えば、図4に示すように、「5」という数値が考えら
れる。
Incidentally, the value of the number of comprehensive pixels is empirically determined as follows:
For example, as shown in FIG. 4, a numerical value "5" can be considered.

【0032】z値比較手段3は、z値作成手段2によっ
て上述のようにして作成されたカレント描画多角形に包
含される各ピクセルのz値(zsとする)とz値格納手
段5に格納されている当該各ピクセルのz値(zdとす
る)とを比較し、その比較結果(「zs>zd」,「z
s=zd」または「zs<zd」)を作成する(ステッ
プ203)。
The z-value comparing means 3 stores the z-value (referred to as zs) of each pixel included in the current drawing polygon created as described above by the z-value creating means 2 and the z-value storing means 5. Is compared with the z value (let it be zd) of the relevant pixel, and the comparison results (“zs> zd”, “z
s = zd ”or“ zs <zd ”) is created (step 203).

【0033】描画制御手段4は、z値比較手段3によっ
て作成された各ピクセルについての比較結果と隠面条件
とを照合し、当該各ピクセルに関してカレント描画多角
形を描画すべきか否かを判断する(ステップ204)。
The drawing control means 4 checks the comparison result of each pixel created by the z-value comparing means 3 with the hidden surface condition, and determines whether or not to draw a current drawing polygon for each pixel. (Step 204).

【0034】描画制御手段4は、ステップ204で「隠
面条件に照らしてカレント描画多角形を描画すべきであ
る」と判断したピクセル(比較結果が「zs>zd」で
あるピクセル)についてのみ、ステップ202で作成さ
れたz値をz値格納手段5に出力し、ステップ201で
作成された描画データ(色値)を表示手段6に出力する
(ステップ205)。
The drawing control means 4 determines only those pixels (the pixels whose comparison result is "zs>zd") that have determined in step 204 that the current drawing polygon should be drawn in light of the hidden surface condition. The z value created in step 202 is output to the z value storage means 5, and the drawing data (color value) created in step 201 is output to the display means 6 (step 205).

【0035】z値格納手段5は、ステップ205で受け
取ったz値を新たなz値として格納する。また、表示手
段6は、ステップ205で受け取った描画データに基づ
いて、表示領域へのカレント描画多角形の描画(表示)
を行う。
The z value storage means 5 stores the z value received in step 205 as a new z value. The display unit 6 draws (displays) the current drawing polygon in the display area based on the drawing data received in step 205.
I do.

【0036】なお、上述の動作説明においては、表示領
域の全ピクセルを単位として、z値の作成(図2中のス
テップ202および図3参照)やz値・色値の出力(図
2中のステップ205参照)等が行われるものとした。
しかし、本実施例、ひいては本発明の動作の態様がこの
ような態様に限られるものではなく、各ピクセルを単位
として(ピクセル毎に)、z値の作成やz値・色値の出
力(出力しないという認識も含む)等が行われるように
することも可能なことはいうまでもない。
In the above description of the operation, the creation of the z value (see step 202 and FIG. 3 in FIG. 2) and the output of the z value and the color value (in FIG. And the like (see step 205).
However, the operation of the present embodiment and the operation of the present invention are not limited to such an embodiment. For each pixel (for each pixel), creation of a z-value and output (output) of a z-value and a color value are performed. It is needless to say that it is also possible to carry out (including recognition of not performing).

【0037】以上のように、各ピクセルのz値をピクセ
ル集合単位で作成(算出)すると、ピクセル単位でz値
を作成する場合に比べて、z値の算出精度は落ちる可能
性があるが、誤った隠面消去処理の態様として「表示領
域のスキャンライン方向において隣接するピクセル群に
おいて一のピクセルについはカレント描画多角形が他の
多角形の上/下に位置すると判断されて描画/消去され
るが、当該一のピクセルの両隣の他のピクセルについて
はカレント描画多角形が下/上に位置すると判断されて
消去/描画される」という現象が生じにくくなる。した
がって、複数の多角形が深さ方向に関して近接する部分
で掠れたような描画が生じるおそれが少なくなる。
As described above, when the z value of each pixel is created (calculated) in a pixel set unit, the z value calculation accuracy may be lower than in the case of creating the z value in a pixel unit. As a mode of the erroneous hidden surface erasing process, “for one pixel in a pixel group adjacent in the scan line direction of the display area, it is determined that the current drawing polygon is positioned above / below another polygon, and is drawn / erased. However, with respect to other pixels on both sides of the one pixel, the current drawing polygon is determined to be positioned at the bottom / top, and is erased / drawn. " Therefore, there is less possibility that a drawing in which a plurality of polygons are blurred in a portion adjacent in the depth direction will occur.

【0038】なお、包括ピクセル数を、システム(本実
施例の三次元多角形描画方式が適用される三次元描画シ
ステム)の固有値としてあらかじめ設定しておくのでは
なく、ユーザ等によって外部からz値作成手段2に指定
できるようにすることも可能である。これにより、描画
対象に応じて適切な包括ピクセル数を設定することがで
き、例えばz値の算出精度の高さと掠れの低減との双方
を考量して適切な包括ピクセル数を設定することが可能
となる。
It is to be noted that the number of comprehensive pixels is not set in advance as an eigenvalue of the system (a three-dimensional rendering system to which the three-dimensional polygon rendering method of this embodiment is applied), but the z value is externally set by a user or the like. It is also possible to make it possible to designate it to the creation means 2. Accordingly, it is possible to set an appropriate number of comprehensive pixels according to a drawing target. For example, it is possible to set an appropriate number of comprehensive pixels in consideration of both high accuracy of z-value calculation and reduction of blur. Becomes

【0039】ところで、z値作成手段2の処理(ピクセ
ル集合の統合や代表ピクセルの設定の取扱い等)に関し
ては、以下のおよびに示すようなバリエーションが
考えられる(図5(a)および(b)参照)。
By the way, with respect to the processing of the z-value creating means 2 (integration of pixel sets, handling of setting of representative pixels, etc.), the following variations are conceivable (FIGS. 5A and 5B). reference).

【0040】 図5(a)に示すように、各ピクセル
集合において、左端以外のピクセル(右端のピクセルや
中央のピクセル)を代表ピクセルとする。
As shown in FIG. 5A, in each pixel set, pixels other than the left end (the right end pixel and the center pixel) are set as representative pixels.

【0041】 図5(b)に示すように、ピクセル集
合を左端点ピクセルから包括ピクセル数毎に区切って求
める。すなわち、左端点ピクセルを基準として各スキャ
ンラインにおける包括ピクセル数毎のピクセル集合の統
合を行う。なお、この場合には、各ピクセル集合の代表
ピクセルを当該各ピクセル集合における左端のピクセル
に設定する。また、左端ピクセル集合に関しては、図3
中のステップ306における補正が不要になる。
As shown in FIG. 5B, a pixel set is obtained by dividing the left end point pixel by the number of inclusive pixels. That is, a pixel set for each comprehensive pixel number in each scan line is integrated based on the left end pixel. In this case, the representative pixel of each pixel group is set to the leftmost pixel in each pixel group. Also, regarding the left end pixel set, FIG.
The correction in the middle step 306 becomes unnecessary.

【0042】[0042]

【発明の効果】以上説明したように本発明は、三次元描
画システムで多角形の描画を行う場合に、隠面消去処理
で使用されるz値の作成(算出)を任意のピクセル数
(包括ピクセル数)単位で行うことにより、z値の算出
における計算誤差に起因する描画上の掠れを低減させる
ことができるという効果を有する。
As described above, according to the present invention, when a polygon is drawn by the three-dimensional drawing system, the creation (calculation) of the z value used in the hidden surface removal processing can be performed by an arbitrary number of pixels (inclusive). Performing in units of (number of pixels) has the effect of reducing blurring in drawing due to a calculation error in calculating the z value.

【0043】なお、包括ピクセル数をユーザ等が外部か
ら指定できるようにすることにより、描画対象に応じて
上記効果を適切に達成できるようにすることが可能とな
る。例えば、z値の算出精度の高さと掠れの低減との双
方を考量して、適切な包括ピクセル数を設定することが
可能となる。
By making it possible for a user or the like to specify the number of comprehensive pixels from the outside, it is possible to appropriately achieve the above-described effects in accordance with the drawing object. For example, it is possible to set an appropriate number of comprehensive pixels by considering both the high calculation accuracy of the z value and the reduction in blur.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の三次元多角形描画方式の一実施例の構
成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of an embodiment of a three-dimensional polygon drawing method according to the present invention.

【図2】図1に示す三次元多角形描画方式の処理を示す
流れ図である。
FIG. 2 is a flowchart showing processing of the three-dimensional polygon drawing method shown in FIG.

【図3】図2中のz値作成ステップの詳細な処理を示す
流れ図である。
FIG. 3 is a flowchart showing a detailed process of a z-value creating step in FIG. 2;

【図4】図1中のz値作成手段の処理を説明するための
図である。
FIG. 4 is a diagram for explaining processing of a z-value creating unit in FIG. 1;

【図5】図1中のz値作成手段の処理のバリエーション
を説明するための図である。
FIG. 5 is a diagram for explaining a variation of processing of a z-value creating unit in FIG. 1;

【図6】従来の三次元多角形描画方式におけるz値作成
処理を説明するための図である。
FIG. 6 is a diagram for explaining z-value creation processing in a conventional three-dimensional polygon drawing method.

【符号の説明】[Explanation of symbols]

1 描画データ作成手段 2 z値作成手段 3 z値比較手段 4 描画制御手段 5 z値格納手段 6 表示手段 21 ピクセル集合統合部 22 z値算出部 DESCRIPTION OF SYMBOLS 1 Drawing data creation means 2 z value creation means 3 z value comparison means 4 drawing control means 5 z value storage means 6 display means 21 pixel set integration part 22 z value calculation part

Claims (6)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 三次元描画システムにおいて隠面消去処
理を行って多角形を描画する三次元多角形描画方式にお
いて、 表示領域に多角形を表示する表示手段と、 カレント描画多角形のx座標値,y座標値および色値を
含む描画データを作成する描画データ作成手段と、 表示領域の全ピクセルの各々のz値として、その時点に
おいて最も上に位置する多角形に包含されるピクセルの
z値を格納するz値格納手段と、 カレント描画多角形に包含されるピクセルをスキャンラ
イン方向に包括ピクセル数毎のピクセル集合として統合
し、各ピクセル集合の中の代表ピクセルを設定するz値
作成手段内のピクセル集合統合部と、 前記ピクセル集合統合部により設定された各ピクセル集
合の代表ピクセルのz値を求め、ピクセル集合に属する
全てのピクセルのz値を代表ピクセルのz値と同一の値
に設定するz値作成手段内のz値算出部と、 前記z値格納手段に格納されている各ピクセルのz値と
前記z値作成手段で作成されたカレント描画多角形に包
含される各ピクセルのz値とをピクセル単位で比較して
その比較結果を作成するz値比較手段と、 前記z値比較手段によって作成された比較結果と隠面条
件とを照合してカレント描画多角形に包含される各ピク
セルに関してカレント描画多角形を描画すべきか否かの
判断を行い、描画すべきと判断したピクセルについて前
記描画データ作成手段で作成された描画データの前記表
示手段への出力,および前記z値作成手段で作成された
z値の前記z値格納手段への出力を行う描画制御手段と
を有することを特徴とする三次元多角形描画方式。
1. A three-dimensional polygon drawing method for drawing a polygon by performing hidden surface elimination processing in a three-dimensional drawing system, a display means for displaying a polygon in a display area, and an x-coordinate value of a current drawing polygon , Drawing data creation means for creating drawing data including y-coordinate values and color values, and z-values of pixels contained in the uppermost polygon at that time as z-values of all pixels in the display area And z-value storage means for integrating pixels included in the current drawing polygon as a pixel set for each number of pixels in the scan line direction and setting a representative pixel in each pixel set. And a z-value of a representative pixel of each pixel set set by the pixel-set integrating unit. A z-value calculator within the z-value generator for setting the z-value of the pixel to the same value as the z-value of the representative pixel; and a z-value of each pixel stored in the z-value storage and the z-value generator. A z-value comparing means for comparing the z-value of each pixel included in the current drawing polygon created in step 2 with a pixel unit to create a comparison result, and comparing the comparison result created by the z-value comparing means with the z-value It is determined whether or not the current drawing polygon should be drawn for each pixel included in the current drawing polygon by checking the surface condition, and the drawing data generating means generates the pixel determined to be drawn. A three-dimensional polygon drawing method, comprising: drawing control means for outputting drawing data to the display means and outputting the z value created by the z value creation means to the z value storage means. .
【請求項2】 表示領域の原点を基準として各スキャン
ラインにおける包括ピクセル数毎のピクセル集合の統合
を行い、代表ピクセルをピクセル集合の左端のピクセル
に設定するピクセル集合統合部と、 各中間ピクセル集合の代表ピクセルのz値を中間ピクセ
ル集合z値算出式に基づいて算出し、左端ピクセル集合
において左端点ピクセルよりも左側に存在するピクセル
のz値および右端ピクセル集合において右端点ピクセル
よりも右側に存在するピクセルのz値を多角形が存在し
ないことを示す情報に補正するz値算出部とを備えるz
値作成手段を有することを特徴とする請求項1記載の三
次元多角形描画方式。
2. A pixel set integration unit that integrates pixel sets for each number of comprehensive pixels in each scan line with reference to the origin of the display area, and sets a representative pixel to the leftmost pixel of the pixel set. Is calculated based on the intermediate pixel set z value calculation formula, and the z value of the pixel existing on the left side of the left end pixel in the left end pixel set and the z value of the representative pixel on the right side of the right end pixel in the right end pixel set And a z-value calculator for correcting the z-value of the pixel to be converted into information indicating that no polygon exists.
2. The three-dimensional polygon drawing method according to claim 1, further comprising a value creating unit.
【請求項3】 代表ピクセルをピクセル集合の左端のピ
クセルの代わりに右端のピクセルおよび中央のピクセル
のいずれかに設定するピクセル集合統合部を有すること
を特徴とする請求項2記載の三次元多角形描画方式。
3. The three-dimensional polygon according to claim 2, further comprising a pixel set integration unit that sets the representative pixel to one of a right end pixel and a center pixel instead of the left end pixel of the pixel set. Drawing method.
【請求項4】 左端点ピクセルを基準として各スキャン
ラインにおける包括ピクセル数毎のピクセル集合の統合
を行い、代表ピクセルをピクセル集合の左端のピクセル
に設定するピクセル集合統合部と、 各中間ピクセル集合の代表ピクセルのz値を中間ピクセ
ル集合z値算出式に基づいて算出し、右端ピクセル集合
において右端点ピクセルよりも右側に存在するピクセル
のz値を多角形が存在しないことを示す情報に補正する
z値算出部とを備えるz値作成手段を有することを特徴
とする請求項1記載の三次元多角形描画方式。
4. A pixel set integration unit that integrates pixel sets for each of the number of comprehensive pixels in each scan line with reference to the left end pixel, and sets a representative pixel to the left end pixel of the pixel set. The z value of the representative pixel is calculated based on the intermediate pixel set z value calculation formula, and the z value of the pixel located on the right side of the right end pixel in the right end pixel set is corrected to information indicating that there is no polygon. 2. The three-dimensional polygon drawing method according to claim 1, further comprising a z-value creating unit including a value calculating unit.
【請求項5】 包括ピクセル数が5であることを特徴と
する請求項1,請求項2,請求項3または請求項4記載
の三次元多角形描画方式。
5. The three-dimensional polygon drawing method according to claim 1, wherein the number of comprehensive pixels is five.
【請求項6】 包括ピクセル数を外部から指定できるこ
とを特徴とする請求項1,請求項2,請求項3または請
求項4記載の三次元多角形描画方式。
6. The three-dimensional polygon drawing method according to claim 1, wherein the number of comprehensive pixels can be designated from outside.
JP7093048A 1995-03-27 1995-03-27 3D polygon drawing method Expired - Lifetime JP2720818B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7093048A JP2720818B2 (en) 1995-03-27 1995-03-27 3D polygon drawing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7093048A JP2720818B2 (en) 1995-03-27 1995-03-27 3D polygon drawing method

Publications (2)

Publication Number Publication Date
JPH08263693A JPH08263693A (en) 1996-10-11
JP2720818B2 true JP2720818B2 (en) 1998-03-04

Family

ID=14071633

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7093048A Expired - Lifetime JP2720818B2 (en) 1995-03-27 1995-03-27 3D polygon drawing method

Country Status (1)

Country Link
JP (1) JP2720818B2 (en)

Also Published As

Publication number Publication date
JPH08263693A (en) 1996-10-11

Similar Documents

Publication Publication Date Title
US7145565B2 (en) Depth bounds testing
EP1918878B1 (en) Hierarchical tile-based rasterization algorithm
US9153068B2 (en) Clipless time and lens bounds for improved sample test efficiency in image rendering
KR20030074601A (en) Image creating method and device
US7508390B1 (en) Method and system for implementing real time soft shadows using penumbra maps and occluder maps
US6988059B1 (en) Rendering method and device, game device, and computer-readable recording medium for storing program to render stereo model
US7050066B2 (en) Image processing apparatus and image processing program
KR100723421B1 (en) Method for rendering by point interpolation, apparatus for rendering by point interpolation and readable medium
JP3349871B2 (en) Image processing device
JP2006235839A (en) Image processor and image processing method
Malan Edge Antialiasing by Post-Processing
JP3502796B2 (en) 3D model display method and apparatus in video game, game apparatus, and computer-readable recording medium storing 3D model display program for video game
US20020063705A1 (en) Apparatus and method for drawing three dimensional graphics by controlling alpha value based on Z coordinate value
US7015930B2 (en) Method and apparatus for interpolating pixel parameters based on a plurality of vertex values
JP3231029B2 (en) Rendering method and device, game device, and computer-readable recording medium storing program for rendering three-dimensional model
CN116630523A (en) Improved real-time shadow rendering method based on shadow mapping algorithm
JP2720818B2 (en) 3D polygon drawing method
EP1139294B1 (en) Graphical image system and apparatus
JP3367506B2 (en) Image processing apparatus and image processing method
JP4009289B2 (en) Method for determining a weighting factor for color-calculating a texel color value associated with a footprint
JP3587105B2 (en) Graphic data processing device
JP2006113909A (en) Image processor, image processing method and image processing program
KR100269118B1 (en) Rasterization using quadrangle
JPH05128274A (en) Graphic display device
JP4554834B2 (en) Image processing apparatus and method, and program thereof