JPH0535883A - Three-dimensional image generating method - Google Patents

Three-dimensional image generating method

Info

Publication number
JPH0535883A
JPH0535883A JP3189795A JP18979591A JPH0535883A JP H0535883 A JPH0535883 A JP H0535883A JP 3189795 A JP3189795 A JP 3189795A JP 18979591 A JP18979591 A JP 18979591A JP H0535883 A JPH0535883 A JP H0535883A
Authority
JP
Japan
Prior art keywords
value
calculated
pixel
coordinate
brightness
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.)
Pending
Application number
JP3189795A
Other languages
Japanese (ja)
Inventor
Jiro Minehisa
次郎 峰久
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP3189795A priority Critical patent/JPH0535883A/en
Publication of JPH0535883A publication Critical patent/JPH0535883A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To obtain the three-dimensional image generating method which can eliminate processing having no direct contribution to image generation. CONSTITUTION:A processor 1 compares a depth coordinate value (z) among screen coordinates with the value in a Z buffer memory 3 in an implicit surface erasure processing step based upon Z buffer algorithm to decide the front-rear relation of a figure in picture element units and select graphic data which are closer to a point of vision, and stores the identification number of the figure in a frame buffer 2. Further, the processor 1 calculates brightness I on a screen in the picture element units in a brightness calculation step by using the identification number in the frame buffer 2 at the end of the implicit surface erasure processing step for all graphic data and stores the brightness in the frame buffer memory 2. Then the processor 1 displays a three-dimensional image on a display device 4 according to the contents of the frame buffer memory 2.

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 image generation method for stereoscopically displaying an image using graphic data stored in a storage device of an electronic computer system.

【0002】[0002]

【従来の技術】近年、設計やシミュレーションなどをは
じめとして広く三次元画像生成技術が応用されるに従
い、より大量の形状データを取扱え、より高画質の三次
元画像を効率よく生成できる三次元画像生成方法開発す
ることが望まれている。図9は従来の三次元画像生成方
法を実現する三次元画像生成装置のブロック図で、この
三次元画像生成装置は、プロセッサ31と、フレーム・
バッファ・メモリ32と、Zバッファ・メモリ33と、
例えばCRTからなる表示装置34とにより構成されて
いる。プロセッサ31は、図外の記憶装置から図形デー
タを読み出し、奥行き座標値Zや輝度Iの算出などの演
算処理を行う。フレーム・バッファ・メモリ32は、画
素の輝度を格納する。Zバッファ・メモリ33は、画素
の奥行き座標値Zを格納する。表示装置34は、フレー
ム・バッファ・メモリ32に格納された内容を表示す
る。
2. Description of the Related Art In recent years, with the widespread application of three-dimensional image generation technology such as design and simulation, a larger amount of shape data can be handled and a three-dimensional image with higher image quality can be efficiently generated. It is desired to develop a generation method. FIG. 9 is a block diagram of a three-dimensional image generation apparatus that realizes a conventional three-dimensional image generation method. This three-dimensional image generation apparatus includes a processor 31, a frame
A buffer memory 32, a Z buffer memory 33,
For example, the display device 34 is a CRT. The processor 31 reads the graphic data from a storage device (not shown) and performs arithmetic processing such as calculation of the depth coordinate value Z and the brightness I. The frame buffer memory 32 stores the brightness of pixels. The Z buffer memory 33 stores the depth coordinate value Z of the pixel. The display device 34 displays the contents stored in the frame buffer memory 32.

【0003】図10はZバッファ・アルゴリズムと呼ば
れる隠面消去を行う従来の三次元画像生成方法の手順を
説明するフローチャートで、この三次元画像生成方法は
図9の三次元画像生成装置により実行される。このZバ
ッファ・アルゴリズムは、例えば日経コンピュータ・グ
ラフィックス、1987年12月号、126ページ、あ
るいは「基礎グラフィックス」川合慧著、昭晃堂、19
85年、186ページなどに記載されている。まずフレ
ーム・バッファ・メモリ32およびZバッファ・メモリ
33を初期化する(ステップS101)。すなわち、フ
レーム・バッファ・メモリ32には背景色の輝度を、Z
バッファ・メモリ33には奥行き座標値Zの最大値(最
も視点から離れた位置の座標値)を設定する。次にポリ
ゴンを任意の順序でスキャン変換する(ステップS10
2)。次にスキャン変換したポリゴン内の各画素に対し
て奥行き座標値Zを計算する(ステップS103)。次
に算出した奥行き座標値ZとZバッファ・メモリ33に
格納されている奥行き座標値ZBとを比較し(ステップ
S104)、算出した奥行き座標値Zがフレーム・バッ
ファ・メモリ32に格納されている奥行き座標値ZBよ
りも小さい場合、すなわち視点により近い位置にある場
合、Zバッファ・メモリ33の値を算出した奥行き座標
値Zに置き換え(ステップS105)、シェーディング
計算(ステップS106)から当該画素の輝度を求めて
フレーム・バッファ・メモリ32に格納する(ステップ
S107)。ステップS104において、ステップS1
03で算出した奥行き座標値ZがZバッファ・メモリ3
3に格納されている奥行き座標値ZB以上であると判断
した場合、すなわち視点から遠い位置にある場合、ある
いはステップS107の処理を実行した後、ポリゴンに
含まれるすべての画素に対してステップS103〜S1
07の処理が終了したか否かを判断し(ステップS10
8)、終了していなければステップS103に戻る。終
了していれば、全てのポリゴンに対してステップS10
2〜S108の処理が終了したか否かを判断し(ステッ
プS109)、終了していなければステップS102に
戻る。終了していればこのルーチンを終了する。
FIG. 10 is a flow chart for explaining the procedure of a conventional three-dimensional image generating method for performing hidden surface removal called a Z-buffer algorithm. This three-dimensional image generating method is executed by the three-dimensional image generating apparatus shown in FIG. It This Z-buffer algorithm is, for example, Nikkei Computer Graphics, December 1987 issue, p. 126, or "Basic Graphics" by Kei Kawai, Shokoido, 19
1985, p.186, etc. First, the frame buffer memory 32 and the Z buffer memory 33 are initialized (step S101). That is, the background color brightness is stored in the frame buffer memory 32 as Z
The maximum value of the depth coordinate value Z (the coordinate value of the position farthest from the viewpoint) is set in the buffer memory 33. Next, the polygons are scan-converted in an arbitrary order (step S10).
2). Next, the depth coordinate value Z is calculated for each pixel in the scan-converted polygon (step S103). Next, the calculated depth coordinate value Z is compared with the depth coordinate value ZB stored in the Z buffer memory 33 (step S104), and the calculated depth coordinate value Z is stored in the frame buffer memory 32. When it is smaller than the depth coordinate value ZB, that is, at a position closer to the viewpoint, the value of the Z buffer memory 33 is replaced with the calculated depth coordinate value Z (step S105), and the brightness of the pixel is calculated from the shading calculation (step S106). Is stored in the frame buffer memory 32 (step S107). In step S104, step S1
The depth coordinate value Z calculated in 03 is the Z buffer memory 3
When it is determined that the depth coordinate value is equal to or larger than the depth coordinate value ZB stored in 3, that is, the position is far from the viewpoint, or after the process of step S107 is performed, all pixels included in the polygon are processed in steps S103 to S1
It is determined whether or not the process of 07 is completed (step S10).
8) If not completed, return to step S103. If finished, step S10 for all polygons.
It is determined whether or not the processes of 2 to S108 are completed (step S109), and if not completed, the process returns to step S102. If finished, this routine is finished.

【0004】以上の処理が終了した時点では、フレーム
・バッファ・メモリ32にはスクリーン上の各画素につ
いて視線に最も近いポリゴンの輝度だけが格納されてお
り、求める三次元画像が生成されている。特に、滑らか
な陰影付け(シェーディング)を行うスムーズ・シェー
ディングの1つのアルゴリズムであるグーロー・シェー
ディング・アルゴリズムに基づく計算においては、奥行
き座標値Zと同様にして輝度Iを逐次算出することがで
き、より高速に三次元画像を生成できる。
At the end of the above processing, only the brightness of the polygon closest to the line of sight is stored in the frame buffer memory 32 for each pixel on the screen, and the desired three-dimensional image is generated. In particular, in the calculation based on the Gouraud shading algorithm, which is one of the smooth shading algorithms for performing smooth shading, the luminance I can be sequentially calculated in the same manner as the depth coordinate value Z. It can generate a three-dimensional image at high speed.

【0005】[0005]

【発明が解決しようとする課題】しかしながら上記従来
の方法では、隠面消去が終了する前にシェーディング計
算(輝度算出)が行われるので、より視点に近いポリゴ
ンが後から処理された場合にはシェーディング計算をや
り直す必要があり、最終結果の画像生成に寄与しない処
理の時間が増加するという問題を有していた。特に、グ
ーロー・シェーディングよりも高画質の三次元画像を生
成するためには、より複雑なシェーディング計算を行う
必要があり、取り扱う形状データの量が増加する。すな
わち、より高画質の三次元画像を追求するほど、無効に
なるシェーディング計算が増加し、最終結果の画像生成
に寄与しない処理の時間が増加してしまう。
However, in the above-mentioned conventional method, since the shading calculation (luminance calculation) is performed before the hidden surface removal is completed, when the polygon closer to the viewpoint is processed later, the shading is performed. There is a problem that the calculation needs to be redone and the processing time that does not contribute to the image generation of the final result increases. In particular, in order to generate a three-dimensional image having higher image quality than Gouraud shading, more complicated shading calculation needs to be performed, and the amount of shape data to be handled increases. That is, the pursuit of a higher quality three-dimensional image increases the number of shading calculations that become invalid, and increases the processing time that does not contribute to image generation of the final result.

【0006】本発明はかかる事情に鑑みて成されたもの
であり、画像生成に直接的に寄与しない処理を削減でき
る三次元画像生成方法を提供することを目的とする。
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a three-dimensional image generation method capable of reducing the processing that does not directly contribute to image generation.

【0007】[0007]

【課題を解決するための手段】請求項1の発明は、スク
リーン座標のうちの奥行き座標値zを用いて各画素毎に
図形の前後を判定して視点により近い図形データを選択
するZバッファ・アルゴリズムに基づいた隠面消去処理
ステップと、全ての図形データに対する前記隠面消去処
理ステップの終了後にスクリーン上の各画素毎に輝度I
を算出する輝度算出ステップとを実行することを特徴と
している。
According to a first aspect of the present invention, there is provided a Z buffer for selecting graphic data closer to a viewpoint by determining the front and back of a graphic for each pixel by using a depth coordinate value z of screen coordinates. After the hidden surface removal processing step based on the algorithm and the hidden surface removal processing step for all the graphic data, the brightness I is calculated for each pixel on the screen.
And a brightness calculation step for calculating.

【0008】請求項2の発明は、請求項1の発明におい
て、図形の輝度Iが、スクリーン座標のうちの(x,
y)座標値により一意に決定できる、すなわち関数gを
用いてI=g(x,y)として定義できる場合に、輝度
算出ステップにおいて、輝度Iを画素の位置すなわち
(x,y)座標値より式I=g(x,y)を用いて直接
的に算出することを特徴としている。
According to a second aspect of the present invention, in the first aspect of the invention, the brightness I of the graphic is (x,
y) When it can be uniquely determined by the coordinate value, that is, can be defined as I = g (x, y) using the function g, the luminance I is calculated from the pixel position, that is, the (x, y) coordinate value in the luminance calculation step. It is characterized in that it is directly calculated using the formula I = g (x, y).

【0009】請求項3の発明は、請求項1の発明におい
て、図形の輝度Iが、スクリーン座標のうちの(x,
y)座標値により一意に決定できる、すなわち関数gを
用いてI=g(x,y)として定義でき、かつ直前に輝
度値を算出した画素における輝度I’と関数gのx座標
またはy座標に対する偏微分成分g’(x,y)とを用
いてI=I’+g’(x,y)と算出できる場合に、輝
度算出ステップにおいて、輝度Iを算出すべき画素の図
形が直前に輝度I’を算出した画素の図形と同じときに
は輝度Iを前記式I=I’+g’(x,y)を用いて算
出し、輝度Iを算出すべき画素の図形が直前に輝度値を
算出した画素の図形と異なるときには輝度Iを前記式I
=g(x,y)を用いて直接的に算出することを特徴と
している。
According to a third aspect of the present invention, in the first aspect of the invention, the brightness I of the graphic is (x,
y) It can be uniquely determined by the coordinate value, that is, it can be defined as I = g (x, y) using the function g, and the luminance I ′ in the pixel whose luminance value was calculated immediately before and the x coordinate or the y coordinate of the function g When I = I ′ + g ′ (x, y) can be calculated using the partial differential component g ′ (x, y) with respect to When I'is the same as the figure of the pixel for which the pixel is calculated, the brightness I is calculated using the above formula I = I '+ g' (x, y), and the figure of the pixel for which the brightness I is to be calculated has the brightness value immediately before. When it is different from the figure of the pixel, the brightness I
It is characterized in that it is calculated directly by using = g (x, y).

【0010】請求項4の発明は、二次元のスクリーン平
面上の座標(x,y)と前記スクリーン平面からの奥行
きを表わす座標zとからなるスクリーン座標(x,y,
z)により定義される三次元の図形データと、色や輝度
や法線ベクトルなどの図形特有の性質を決定する属性デ
ータの組からなる属性ベクトル(t1,t2,…,t
n)(nは2以上の整数)とを用いて立体的な画像を生
成する三次元画像生成方法において、前記スクリーン座
標のうちの奥行き座標値zを用いて各画素毎に図形の前
後を判定して視点により近い図形データを選択するZバ
ッファ・アルゴリズムに基づいた隠面消去処理ステップ
と、全ての図形データに対する前記隠面消去処理ステッ
プの終了後にスクリーン上の各画素毎に属性ベクトルの
要素である属性要素ti(iは1からnまでの整数)の
値を算出する属性値算出ステップとを実行することを特
徴としている。
According to a fourth aspect of the present invention, screen coordinates (x, y, consisting of coordinates (x, y) on the two-dimensional screen plane and coordinates z representing the depth from the screen plane.
z), the attribute vector (t1, t2, ..., T) including a set of three-dimensional graphic data defined by z) and attribute data that determines the characteristics peculiar to the graphic such as color, brightness, and normal vector.
n) (n is an integer of 2 or more), a three-dimensional image generating method is used to determine the front and back of a figure for each pixel using the depth coordinate value z of the screen coordinates. Then, the hidden surface erasing processing step based on the Z-buffer algorithm for selecting the graphic data closer to the viewpoint, and after the hidden surface erasing processing step for all the graphic data is completed, the element of the attribute vector is set for each pixel on the screen. An attribute value calculation step of calculating a value of a certain attribute element ti (i is an integer from 1 to n) is performed.

【0011】請求項5の発明は、請求項4の発明におい
て、属性要素tiが、スクリーン座標のうちの(x,
y)座標値により一意に決定できる、すなわち関数gi
を用いてti=gi(x,y)として定義できる場合
に、属性値算出ステップにおいて、属性要素tiを当該
画素の位置すなわち(x,y)座標値より式ti=gi
(x,y)を用いて直接的に算出することを特徴として
いる。
According to the invention of claim 5, in the invention of claim 4, the attribute element ti is (x,
y) Can be uniquely determined by the coordinate values, that is, the function gi
When it is possible to define as ti = gi (x, y) using, the attribute value ti is calculated from the position of the pixel, that is, the (x, y) coordinate value, into the equation ti = gi in the attribute value calculation step.
The feature is that it is calculated directly using (x, y).

【0012】請求項6の発明は、請求項4の発明におい
て、属性要素tiの値が、スクリーン座標のうちの
(x,y)座標値により一意に決定できる、すなわち関
数giを用いてti=gi(x,y)として定義でき、
かつ直前に算出した属性要素t’iの値と関数giのx
座標またはy座標に対する偏微分成分g’i(x,y)
とを用いてti=t’i+g’i(x,y)と算出でき
る場合に、特性値算出ステップにおいて、値を算出すべ
き属性要素tiの画素の図形が直前に値を算出した属性
要素ti’の画素の図形と同じときには属性要素tiの
値を前記式ti=t’i+g’i(x,y)を用いて算
出し、値を算出すべき属性要素tiの画素の図形が直前
に値を算出した属性要素ti’の画素の図形と異なると
きには前記式ti=gi(x,y)を用いて直接的に算
出することを特徴としている。
According to a sixth aspect of the invention, in the fourth aspect of the invention, the value of the attribute element ti can be uniquely determined by the (x, y) coordinate value of the screen coordinates, that is, using the function gi, ti = can be defined as gi (x, y),
And the value of the attribute element t'i calculated immediately before and x of the function gi
Partial differential component g'i (x, y) with respect to coordinates or y coordinates
When it is possible to calculate ti = t′i + g′i (x, y) by using, in the characteristic value calculation step, the figure of the pixel of the attribute element ti whose value is to be calculated is the attribute element ti whose value was calculated immediately before. When it is the same as the figure of the pixel of ', the value of the attribute element ti is calculated using the above expression ti = t'i + g'i (x, y), and the figure of the pixel of the attribute element ti whose value is to be calculated Is different from the calculated figure of the pixel of the attribute element ti ′, it is directly calculated using the equation ti = gi (x, y).

【0013】[0013]

【作用】請求項1の発明においては、Zバッファ・アル
ゴリズムに基づいた隠面消去処理ステップで、スクリー
ン座標のうちの奥行き座標値zを用いて各画素毎に図形
の前後を判定して視点により近い図形データを選択し、
輝度算出ステップで、全ての図形データに対する隠面消
去処理ステップの終了後にスクリーン上の各画素毎に輝
度Iを算出する。
According to the invention of claim 1, in the hidden surface elimination processing step based on the Z-buffer algorithm, the depth coordinate value z of the screen coordinates is used to determine the front and back of the figure for each pixel and the viewpoint is determined. Select close figure data,
In the brightness calculation step, the brightness I is calculated for each pixel on the screen after the hidden surface removal processing step for all graphic data is completed.

【0014】請求項2の発明においては、図形の輝度I
が、スクリーン座標のうちの(x,y)座標値により一
意に決定できる、すなわち関数gを用いてI=g(x,
y)として定義できる場合に、輝度算出ステップにおい
て、輝度Iを画素の位置すなわち(x,y)座標値より
式I=g(x,y)を用いて直接的に算出する。請求項
3の発明においては、図形の輝度Iが、スクリーン座標
のうちの(x,y)座標値により一意に決定できる、す
なわち関数gを用いてI=g(x,y)として定義で
き、かつ直前に輝度値を算出した画素における輝度I’
と関数gのx座標またはy座標に対する偏微分成分g’
(x,y)とを用いてI=I’+g’(x,y)と算出
できる場合に、輝度算出ステップにおいて、輝度Iを算
出すべき画素の図形が直前に輝度I’を算出した画素の
図形と同じときには輝度Iを式I=I’+g’(x,
y)を用いて算出し、輝度Iを算出すべき画素の図形が
直前に輝度値を算出した画素の図形と異なるときには輝
度Iを式I=g(x,y)を用いて直接的に算出する。
According to the second aspect of the invention, the luminance I of the figure is I.
Can be uniquely determined by the (x, y) coordinate value of the screen coordinates, that is, I = g (x,
If it can be defined as y), the brightness I is directly calculated in the brightness calculation step from the position of the pixel, that is, the (x, y) coordinate value using the formula I = g (x, y). In the invention of claim 3, the brightness I of the figure can be uniquely determined by the (x, y) coordinate value of the screen coordinates, that is, can be defined as I = g (x, y) using the function g, And the luminance I ′ in the pixel for which the luminance value was calculated immediately before
And the partial differential component g'of the function g with respect to the x coordinate or the y coordinate
When I = I ′ + g ′ (x, y) can be calculated using (x, y), the figure of the pixel for which the brightness I should be calculated is the pixel whose brightness I ′ was calculated immediately before in the brightness calculation step. When it is the same as the figure, the brightness I is expressed by the formula I = I '+ g' (x,
y), and when the figure of the pixel for which the brightness I is to be calculated is different from the figure of the pixel for which the brightness value was calculated immediately before, the brightness I is directly calculated using the formula I = g (x, y). To do.

【0015】請求項4の発明においては、Zバッファ・
アルゴリズムに基づいた隠面消去処理ステップで、スク
リーン座標のうちの奥行き座標値zを用いて各画素毎に
図形の前後を判定して視点により近い図形データを選択
し、属性値算出ステップで、全ての図形データに対する
隠面消去処理ステップの終了後にスクリーン上の各画素
毎に属性ベクトルの要素である属性要素ti(iは1か
らnまでの整数)の値を算出する。
According to the invention of claim 4, the Z buffer
In the hidden surface removal processing step based on the algorithm, the depth coordinate value z of the screen coordinates is used to determine the front and back of the figure for each pixel and select figure data closer to the viewpoint. After the hidden surface erasing processing step for the figure data of (3) is finished, the value of the attribute element ti (i is an integer from 1 to n) which is an element of the attribute vector is calculated for each pixel on the screen.

【0016】請求項5の発明においては、属性要素ti
が、スクリーン座標のうちの(x,y)座標値により一
意に決定できる、すなわち関数giを用いてti=gi
(x,y)として定義できる場合に、属性値算出ステッ
プにおいて、属性要素tiを当該画素の位置すなわち
(x,y)座標値より式ti=gi(x,y)を用いて
直接的に算出する。
In the invention of claim 5, the attribute element ti
Can be uniquely determined by the (x, y) coordinate value of the screen coordinates, that is, ti = gi using the function gi.
If it can be defined as (x, y), in the attribute value calculation step, the attribute element ti is directly calculated from the position of the pixel, that is, the (x, y) coordinate value using the formula ti = gi (x, y). To do.

【0017】請求項6の発明においては、属性要素ti
の値が、スクリーン座標のうちの(x,y)座標値によ
り一意に決定できる、すなわち関数giを用いてti=
gi(x,y)として定義でき、かつ直前に算出した属
性要素t’iの値と関数giのx座標またはy座標に対
する偏微分成分g’i(x,y)とを用いてti=t’
i+g’i(x,y)と算出できる場合に、特性値算出
ステップにおいて、値を算出すべき属性要素tiの画素
の図形が直前に値を算出した属性要素ti’の画素の図
形と同じときには属性要素tiの値を式ti=t’i+
g’i(x,y)を用いて算出し、値を算出すべき属性
要素tiの画素の図形が直前に値を算出した属性要素t
i’の画素の図形と異なるときには式ti=gi(x,
y)を用いて直接的に算出する。
In the invention of claim 6, the attribute element ti
Can be uniquely determined by the (x, y) coordinate value of the screen coordinates, that is, ti =
can be defined as gi (x, y) and can be defined as ti = t using the value of the attribute element t'i calculated immediately before and the partial differential component g'i (x, y) with respect to the x coordinate or the y coordinate of the function gi. '
When it is possible to calculate i + g′i (x, y), when the figure of the pixel of the attribute element ti whose value is to be calculated is the same as the figure of the pixel of the attribute element ti ′ whose value was calculated immediately before in the characteristic value calculation step. The value of the attribute element ti is expressed by the expression ti = t'i +
g'i (x, y) is used to calculate the value, and the attribute element t for which the value of the pixel of the attribute element ti is calculated immediately before
When it is different from the figure of the pixel of i ′, the expression ti = gi (x,
Calculate directly using y).

【0018】[0018]

【実施例】以下、本発明の実施例を図面を用いて詳細に
説明する。 (実施例1)図1は本発明の実施例1における三次元画
像生成方法を実現する三次元画像生成装置のブロック図
で、この三次元画像生成装置は、プロセッサ1と、フレ
ーム・バッファ・メモリ2と、Zバッファ・メモリ3
と、例えばCRTからなる表示装置4とにより構成され
ている。プロセッサ1は、図外の記憶装置から図形デー
タを読み出して、奥行き座標値Zや輝度Iの算出などの
演算処理を行う。フレーム・バッファ・メモリ2は、画
素の輝度を格納する。Zバッファ・メモリ3は、画素の
奥行き座標値Zを格納する。表示装置4は、フレーム・
バッファ・メモリ2に格納された内容を表示する。
Embodiments of the present invention will now be described in detail with reference to the drawings. (Embodiment 1) FIG. 1 is a block diagram of a three-dimensional image generating apparatus which realizes a three-dimensional image generating method according to a first embodiment of the present invention. This three-dimensional image generating apparatus includes a processor 1, a frame buffer memory. 2 and Z buffer memory 3
And a display device 4 including, for example, a CRT. The processor 1 reads graphic data from a storage device (not shown) and performs arithmetic processing such as calculation of the depth coordinate value Z and the brightness I. The frame buffer memory 2 stores the luminance of pixels. The Z buffer memory 3 stores the depth coordinate value Z of the pixel. The display device 4 is a frame
The contents stored in the buffer memory 2 are displayed.

【0019】図2は本発明の実施例1における三次元画
像生成方法の手順を説明するフローチャートで、この三
次元画像生成方法は図1の三次元画像生成装置により実
行される。なお、三角形や四角形などの基本図形のこと
をポリゴンと呼び、各ポリゴンには識別番号として1以
上の正の正数が与えられているものとする。まずフレー
ム・バッファ・メモリ2とZバッファ・メモリ3とを初
期化する(ステップS1)。すなわち、フレーム・バッ
ファ・メモリ2にはポリゴンの識別番号(以下「ポリゴ
ンid」と記す)として0を、Zバッファ・メモリ3に
は奥行き座標値Zの最大値(最も視点から離れた位置の
座標値)を設定する。次にポリゴンidの順序でポリゴ
ンをスキャン変換する(ステップS2)。次にポリゴン
内の各画素に対して奥行き座標値Zを計算する(ステッ
プS3)。次に算出した奥行き座標値ZとZバッファ・
メモリ3に格納されている奥行き座標値ZBとを比較し
(ステップS4)、算出した奥行き座標値ZがZバッフ
ァ・メモリ3に格納されている奥行き座標値ZBよりも
小さい場合、すなわち視点により近い位置にある場合、
Zバッファ・メモリ3の値を算出した奥行き座標値Zに
置き換え(ステップS5)、フレーム・バッファ・メモ
リ2に当該ポリゴンのポリゴンidを格納する(ステッ
プS6)。ステップS4において、ステップS3で算出
した奥行き座標値ZがZバッファ・メモリ3に格納され
ている奥行き座標値ZB以上であると判断した場合、す
なわち視点から遠い位置にある場合、あるいはステップ
S6の処理の終了後、ポリゴンに含まれるすべての画素
に対してステップS3〜S6の処理が終了したか否かを
判断し(ステップS7)、終了していなければステップ
S3に戻る。終了していれば、全てのポリゴンに対して
ステップS2〜S7の隠面消去処理が処理が終了したか
否かを判断し(ステップS8)、終了していなければス
テップS2に戻る。終了していれば、各画素毎にシェー
ディング計算(輝度算出)を行ってフレーム・バッファ
・メモリ2に格納し(ステップS9)、このルーチンを
終了する。
FIG. 2 is a flow chart for explaining the procedure of the three-dimensional image generating method according to the first embodiment of the present invention. This three-dimensional image generating method is executed by the three-dimensional image generating apparatus shown in FIG. A basic figure such as a triangle or a quadrangle is called a polygon, and each polygon is given a positive positive number of 1 or more as an identification number. First, the frame buffer memory 2 and the Z buffer memory 3 are initialized (step S1). That is, 0 is set as the polygon identification number (hereinafter referred to as "polygon id") in the frame buffer memory 2, and the maximum value of the depth coordinate value Z (the coordinate at the position farthest from the viewpoint is set in the Z buffer memory 3). Value). Next, the polygons are scan-converted in the order of polygon id (step S2). Next, the depth coordinate value Z is calculated for each pixel in the polygon (step S3). Next, the calculated depth coordinate value Z and Z buffer
The depth coordinate value ZB stored in the memory 3 is compared (step S4), and when the calculated depth coordinate value Z is smaller than the depth coordinate value ZB stored in the Z buffer memory 3, that is, closer to the viewpoint. If in position,
The value in the Z buffer memory 3 is replaced with the calculated depth coordinate value Z (step S5), and the polygon id of the polygon is stored in the frame buffer memory 2 (step S6). When it is determined in step S4 that the depth coordinate value Z calculated in step S3 is equal to or larger than the depth coordinate value ZB stored in the Z buffer memory 3, that is, when the position is far from the viewpoint, or the process of step S6. After completion of the above step, it is judged whether or not the steps S3 to S6 have been completed for all the pixels included in the polygon (step S7), and if not completed, the procedure returns to step S3. If it is completed, it is determined whether or not the hidden surface removal processing of steps S2 to S7 is completed for all polygons (step S8). If not completed, the processing returns to step S2. If completed, shading calculation (luminance calculation) is performed for each pixel and stored in the frame buffer memory 2 (step S9), and this routine is completed.

【0020】図3はシェーディング計算(輝度算出)の
手順を説明するフローチャートで、これは図2のステッ
プS9に相当する。なお、スクリーン上の座標(x,
y)は、x,y共に正の整数値のみで表されるものとす
る。まず処理対象とする画素の位置を示すスクリーン上
の座標(x,y)のうちのy座標を1に初期化する(ス
テップS11)。次に同じくスクリーン上の座標(x,
y)のうちのx座標を1に初期化する(ステップS1
2)。次にスクリーン上の座標(x,y)でのポリゴン
idをフレーム・バッファ・メモリ2から読み出す(ス
テップS13)。次にポリゴンidで指定される輝度算
出のための関数gを選択する(ステップS14)。次に
関数gとスクリーン上の座標(x,y)とを用いて輝度
Iを式I=g(x,y)で算出する(ステップS1
5)。すなわちシェーディング計算(輝度算出)を行
う。次に算出した輝度Iをフレーム・バッファ・メモリ
2の(x,y)の位置に格納する(ステップS16)。
次にx座標を1だけ増加させる(ステップS17)。次
に新しいx座標の値とスクリーン上でのx座標の最大値
Xmaxとを比較し(ステップS18)、新しいx座標
がXmax以下ならばステップS13へ戻る。新しいx
座標がXmaxよりも大きいならば、y座標を1だけ増
加させる(ステップS19)。次に新しいy座標の値と
スクリーン上でのy座標の最大値Ymaxとを比較し
(ステップS20)、新しいy座標がYmax以下なら
ばステップS12へ戻る。新しいy座標がYmaxより
も大きいならばこのルーチンを終了する。
FIG. 3 is a flow chart for explaining the procedure of shading calculation (luminance calculation), which corresponds to step S9 of FIG. The coordinates (x,
In y), both x and y are represented by positive integer values only. First, the y coordinate of the coordinates (x, y) on the screen indicating the position of the pixel to be processed is initialized to 1 (step S11). Next, the coordinates (x,
The x coordinate of y) is initialized to 1 (step S1)
2). Next, the polygon id at the coordinate (x, y) on the screen is read from the frame buffer memory 2 (step S13). Next, the function g for brightness calculation designated by the polygon id is selected (step S14). Next, the brightness I is calculated by the formula I = g (x, y) using the function g and the coordinates (x, y) on the screen (step S1).
5). That is, shading calculation (luminance calculation) is performed. Next, the calculated brightness I is stored in the position (x, y) of the frame buffer memory 2 (step S16).
Next, the x coordinate is incremented by 1 (step S17). Next, the new x coordinate value is compared with the maximum x coordinate value Xmax on the screen (step S18). If the new x coordinate is less than or equal to Xmax, the process returns to step S13. New x
If the coordinate is larger than Xmax, the y coordinate is incremented by 1 (step S19). Next, the new y-coordinate value is compared with the maximum y-coordinate value Ymax on the screen (step S20). If the new y-coordinate is less than Ymax, the process returns to step S12. If the new y coordinate is larger than Ymax, this routine ends.

【0021】このように、隠面消去処理後の最終画像に
対応する画素のみに対してシェーディング計算を行うの
で、無効となるシェーディング計算を排除することがで
きる。例えばg(x,y)として(x,y)に関する1
次式を用いると、グーロー・シェーディング・アルゴリ
ズムに基づいた輝度を求めることができ、従来の方法と
同画質の画像を短時間で得ることができる。取り扱うポ
リゴンデータが増加するに従い、本発明による処理数の
低減効果がより顕著になることは明かである。 (実施例2)実施例1では図3の手順によりシェーディ
ング計算(輝度算出)を行ったが、図4のような手順で
シェーディング計算(輝度算出)を行ってもよい。すな
わち、まず処理対象とする画素の位置を示すスクリーン
上の座標(x,y)のうちのy座標を1に初期化する
(ステップS21)。次に同じくスクリーン上の座標
(x,y)のうちのx座標を1に初期化する(ステップ
S22)。次にスクリーン上の座標(x,y)のポリゴ
ンidをフレーム・バッファ・メモリ2から読み出す
(ステップS23)。次に読み出したポリゴンidと隣
接した画素のポリゴンidとを比較し(ステップS2
4)、読み出したポリゴンidと隣接画素のポリゴンi
dとが等しい場合、輝度Iを算出する関数g(x,y)
のx方向の偏微分成分の画素(x,y)での値g’
(x,y)を算出する(ステップS25)。次に画素
(x,y)の隣接画素(x−1,y)における輝度I’
とg’(x,y)とを用いて、画素(x,y)の輝度I
を式I=I’+g’(x,y)で算出する(ステップS
26)。ステップS24において、ステップS23で読
み出したポリゴンidと隣接画素のポリゴンidとが等
しくないと判断した場合、読み出したポリゴンidで指
定される輝度算出のための関数gを選択する(ステップ
S27)。次に関数gとスクリーン上の座標(x,y)
とを用いて輝度Iを式I=g(x,y)で算出する(ス
テップS28)。次にステップS26あるいはステップ
S28で算出した輝度Iをフレーム・バッファ・メモリ
2の(x,y)の位置に格納する(ステップS29)。
次にx座標を1だけ増加させる(ステップS30)。次
に新しいx座標の値とスクリーン上でのx座標の最大値
Xmaxとを比較し(ステップS31)、新しいx座標
がXmax以下ならばステップS23へ戻る。新しいx
座標がXmaxよりも大きいならば、y座標を1だけ増
加させる(ステップS32)。次に新しいy座標の値と
スクリーン上でのy座標の最大値Ymaxとを比較し
(ステップS33)、新しいy座標がYmax以下なら
ばステップS22へ戻る。新しいy座標がYmaxより
も大きいならばこのルーチンを終了する。
As described above, since the shading calculation is performed only on the pixels corresponding to the final image after the hidden surface removal processing, the invalid shading calculation can be eliminated. For example, for g (x, y), 1 for (x, y)
By using the following equation, it is possible to obtain the brightness based on the Gouraud shading algorithm, and it is possible to obtain an image of the same image quality as the conventional method in a short time. It is obvious that the effect of reducing the number of processes according to the present invention becomes more remarkable as the number of polygon data to be handled increases. Second Embodiment In the first embodiment, the shading calculation (luminance calculation) is performed according to the procedure of FIG. 3, but the shading calculation (luminance calculation) may be performed according to the procedure of FIG. That is, first, the y coordinate of the coordinates (x, y) on the screen indicating the position of the pixel to be processed is initialized to 1 (step S21). Next, similarly, the x coordinate of the coordinates (x, y) on the screen is initialized to 1 (step S22). Next, the polygon id of the coordinate (x, y) on the screen is read from the frame buffer memory 2 (step S23). Next, the read polygon id is compared with the polygon id of the adjacent pixel (step S2
4), the read polygon id and the polygon i of the adjacent pixel
A function g (x, y) for calculating the brightness I when d is equal to
Value g'at the pixel (x, y) of the partial differential component in the x direction of
(X, y) is calculated (step S25). Next, the luminance I ′ at the pixel (x−1, y) adjacent to the pixel (x, y)
And g ′ (x, y), the luminance I of the pixel (x, y)
Is calculated by the formula I = I ′ + g ′ (x, y) (step S
26). When it is determined in step S24 that the polygon id read in step S23 is not equal to the polygon id of the adjacent pixel, the function g for brightness calculation designated by the read polygon id is selected (step S27). Next, the function g and the coordinates (x, y) on the screen
The luminance I is calculated by the equation I = g (x, y) using and (step S28). Next, the brightness I calculated in step S26 or step S28 is stored in the position (x, y) of the frame buffer memory 2 (step S29).
Next, the x coordinate is incremented by 1 (step S30). Next, the new x coordinate value is compared with the maximum x coordinate value Xmax on the screen (step S31). If the new x coordinate is less than or equal to Xmax, the process returns to step S23. New x
If the coordinate is larger than Xmax, the y coordinate is incremented by 1 (step S32). Next, the new y-coordinate value is compared with the maximum y-coordinate value Ymax on the screen (step S33). If the new y-coordinate is less than Ymax, the process returns to step S22. If the new y coordinate is larger than Ymax, this routine ends.

【0022】このように、関数g(x,y)のx方向の
偏微分成分g’(x,y)を用いれば、演算が容易にな
り、処理速度を高速化できる。なお関数g(x,y)の
y方向の偏微分成分を用いてもよい。 (実施例3)図5は本発明の実施例3における三次元画
像生成方法を実現する三次元画像生成装置のブロック図
で、この三次元画像生成装置は、プロセッサ11と、フ
レーム・バッファ・メモリ12と、Zバッファ・メモリ
13と、例えばCRTからなる表示装置14と、属性バ
ッファ・メモリ15とにより構成されている。プロセッ
サ11は、図外の記憶装置から図形データを読み出し、
奥行き座標値Zや属性要素tiの算出などの演算処理を
行う。フレーム・バッファ・メモリ12は、画素の輝度
を格納する。Zバッファ・メモリ13は、画素の奥行き
座標値Zを格納する。表示装置14は、フレーム・バッ
ファ・メモリ12に格納された内容を表示する。属性バ
ッファ・メモリ15は、属性ベクトルを格納する図6は
本発明の実施例3における三次元画像生成方法の手順を
説明するフローチャートで、この三次元画像生成方法は
図5の三次元画像生成装置により実行される。なお、実
施例1と同様に各ポリゴンには識別番号として1以上の
正の正数が与えられているものとする。まずフレーム・
バッファ・メモリ12およびZバッファ・メモリ13を
初期化する(ステップS41)。すなわち、フレーム・
バッファ・メモリ12にはポリゴンidとして0を、Z
バッファ・メモリ13には奥行き座標値Zの最大値(最
も視点から離れた位置の座標値)を設定する。次にポリ
ゴンidの順序でポリゴンをスキャン変換する(ステッ
プS42)。次にポリゴン内の各画素に対して奥行き座
標値Zを計算する(ステップS43)。次に算出した奥
行き座標値ZとZバッファ・メモリ13に格納されてい
る奥行き座標値ZBとを比較し(ステップS44)、算
出した奥行き座標値ZがZバッファ・メモリ13に格納
されている奥行き座標値ZB以上である場合、すなわち
視点から遠い位置にある場合、ステップS47へ進む。
算出した奥行き座標値ZがZバッファ・メモリ13に格
納されている奥行き座標値ZBよりも小さい場合、すな
わち視点により近い位置にある場合、Zバッファ・メモ
リ13の値を算出した奥行き座標値Zに置き換える(ス
テップS45)。次にフレーム・バッファ・メモリ12
に当該ポリゴンのポリゴンidを格納する(ステップS
46)。次にポリゴンに含まれるすべての画素に対して
ステップS43〜S46の処理が終了したか否かを判断
し(ステップS47)、終了していなければステップS
43に戻る。終了していれば、すべてのポリゴンに対し
てステップS42〜S47の処理が終了したか否かを判
断し(ステップS48)、終了していなければステップ
S42に戻る。終了していれば、隠面消去処理が終了し
たということであるので、各画素毎に属性ベクトルの要
素を算出し、それに基づいて色・輝度を算出して(ステ
ップS49)、このルーチンを終了する。
As described above, if the partial differential component g '(x, y) of the function g (x, y) in the x direction is used, the calculation becomes easy and the processing speed can be increased. The partial differential component of the function g (x, y) in the y direction may be used. (Third Embodiment) FIG. 5 is a block diagram of a three-dimensional image generating apparatus which realizes a three-dimensional image generating method according to a third embodiment of the present invention. This three-dimensional image generating apparatus includes a processor 11 and a frame buffer memory. 12, a Z buffer memory 13, a display device 14 such as a CRT, and an attribute buffer memory 15. The processor 11 reads graphic data from a storage device (not shown),
Calculation processing such as calculation of the depth coordinate value Z and the attribute element ti is performed. The frame buffer memory 12 stores the brightness of pixels. The Z buffer memory 13 stores the depth coordinate value Z of the pixel. The display device 14 displays the contents stored in the frame buffer memory 12. The attribute buffer memory 15 stores the attribute vector. FIG. 6 is a flow chart for explaining the procedure of the three-dimensional image generation method in the third embodiment of the present invention. This three-dimensional image generation method is the three-dimensional image generation apparatus of FIG. Executed by. As in the first embodiment, it is assumed that each polygon is given a positive positive number of 1 or more as an identification number. First the frame
The buffer memory 12 and the Z buffer memory 13 are initialized (step S41). That is, the frame
In the buffer memory 12, 0 is set as the polygon id and Z
The maximum value of the depth coordinate value Z (the coordinate value of the position farthest from the viewpoint) is set in the buffer memory 13. Next, the polygons are scan-converted in the order of the polygon id (step S42). Next, the depth coordinate value Z is calculated for each pixel in the polygon (step S43). Next, the calculated depth coordinate value Z is compared with the depth coordinate value ZB stored in the Z buffer memory 13 (step S44), and the calculated depth coordinate value Z is stored in the Z buffer memory 13. If the coordinate value is ZB or more, that is, if the position is far from the viewpoint, the process proceeds to step S47.
When the calculated depth coordinate value Z is smaller than the depth coordinate value ZB stored in the Z buffer memory 13, that is, when the position is closer to the viewpoint, the value of the Z buffer memory 13 is set to the calculated depth coordinate value Z. Replace (step S45). Next, the frame buffer memory 12
The polygon id of the polygon is stored in (step S
46). Next, it is determined whether or not the processes of steps S43 to S46 have been completed for all the pixels included in the polygon (step S47).
Return to 43. If the processing has been completed, it is determined whether or not the processing of steps S42 to S47 has been completed for all polygons (step S48), and if not completed, the processing returns to step S42. If it is completed, it means that the hidden surface removal process is completed. Therefore, the element of the attribute vector is calculated for each pixel, and the color / luminance is calculated based on the calculated element (step S49), and this routine is completed. To do.

【0023】図7は属性値算出の手順を説明するフロー
チャートで、これは図6のステップS49に相当する。
まず処理対象とする画素の位置を示すスクリーン上の座
標(x,y)のうちのy座標を1に初期化する(ステッ
プS51)。次に同じくスクリーン上の座標(x,y)
のうちのx座標を1に初期化する(ステップS52)。
次にスクリーン上の座標(x,y)のポリゴンidをフ
レーム・バッファ・メモリ12から読み出す(ステップ
S53)。次にポリゴンidで指定される属性要素ti
算出のための関数giを選択する(ステップS54)。
次に関数giとスクリーン上の座標(x,y)とを用い
て属性要素tiを式ti=gi(x,y)で算出する
(ステップS55)。次に算出した属性要素tiを属性
バッファ・メモリ15の(x,y)の位置に格納する
(ステップS56)。これらステップS54〜S56は
必要な属性要素すべてに対して実行する。次にx座標を
1だけ増加させる(ステップS57)。次に新しいx座
標の値とスクリーン上でのx座標の最大値Xmaxとを
比較し(ステップS58)、新しいx座標がXmax以
下ならばステップS53へ戻る。新しいx座標がXma
xよりも大きいならば、y座標を1だけ増加させる(ス
テップS59)。次に新しいy座標の値とスクリーン上
でのy座標の最大値Ymaxとを比較し(ステップS6
0)、新しいy座標がYmax以下ならばステップS5
2へ戻る。新しいy座標がYmaxよりも大きいならば
このルーチンを終了する。なおフレーム・バッファ・メ
モリ12には、属性要素に基づいて算出された色・輝度
が格納される。
FIG. 7 is a flow chart for explaining the procedure of attribute value calculation, which corresponds to step S49 of FIG.
First, the y coordinate of the coordinates (x, y) on the screen indicating the position of the pixel to be processed is initialized to 1 (step S51). Next, the coordinates (x, y) on the screen
The x coordinate of the above is initialized to 1 (step S52).
Next, the polygon id of the coordinate (x, y) on the screen is read from the frame buffer memory 12 (step S53). Next, the attribute element ti specified by the polygon id
The function gi for calculation is selected (step S54).
Next, using the function gi and the coordinates (x, y) on the screen, the attribute element ti is calculated by the expression ti = gi (x, y) (step S55). Next, the calculated attribute element ti is stored in the position (x, y) of the attribute buffer memory 15 (step S56). These steps S54 to S56 are executed for all necessary attribute elements. Next, the x coordinate is incremented by 1 (step S57). Next, the value of the new x coordinate is compared with the maximum value xmax of the x coordinate on the screen (step S58). If the new x coordinate is less than or equal to Xmax, the process returns to step S53. The new x coordinate is Xma
If it is larger than x, the y coordinate is incremented by 1 (step S59). Next, the new y coordinate value is compared with the maximum y coordinate value Ymax on the screen (step S6).
0), if the new y coordinate is Ymax or less, step S5
Return to 2. If the new y coordinate is larger than Ymax, this routine ends. The frame buffer memory 12 stores the color / luminance calculated based on the attribute element.

【0024】このように、隠面消去処理後の画像に対応
する画素のみに対して属性値の算出を行うので、無効と
なる処理を排除することができる。また取り扱う属性要
素が複数であるので、実施例1よりも高画質画像に対し
て顕著な効果が得られる。例えば属性要素として各画素
での法線ベクトルの要素(Nx,Ny,Nz)を選び、
gi(x,y)を(x,y)に関する1次式と仮定し、
光源の位置と方向および算出した法線ベクトルから当該
画素の輝度を求めることにより、グーロー・シェーディ
ング・アルゴリズムよりも高画質な(従ってより写実的
な)フォーン・シェーディング・アルゴリズム(例えば
「基礎グラフィックス」川合慧著、昭晃堂、1985
年、174〜179ページ)による三次元画像を生成で
きる。 (実施例4)実施例3では図7の手順により属性値算出
を行ったが、図8のような手順で属性値算出を行っても
よい。すなわち、まず処理対象とする画素の位置を示す
スクリーン上の座標(x,y)のうちのy座標を1に初
期化する(ステップS61)。次に同じくスクリーン上
の座標(x,y)のうちのx座標を1に初期化する(ス
テップS62)。次にスクリーン上の座標(x,y)の
ポリゴンidをフレーム・バッファ・メモリ12から読
み出す(ステップS63)。次に読み出したポリゴンi
dと隣接する画素のポリゴンidとを比較し(ステップ
S64)、読み出したポリゴンidと隣接画素のポリゴ
ンidとが等しい場合、属性要素tiを算出する関数g
i(x,y)のx方向の偏微分成分の画素(x,y)で
の値g’(x,y)を算出する(ステップS65)。次
に画素(x,y)の隣接画素(x−1,y)における属
性要素の値t’iとg’i(x,y)とを用いて、画素
(x,y)の属性要素tiを式ti=t’i+g’i
(x,y)で算出する(ステップS66)。ステップS
64において、ステップS63で読み出したポリゴンi
dと隣接画素のポリゴンidとが等しくないと判断した
場合、読み出したポリゴンidで指定される属性要素の
値算出のための関数giを選択する(ステップS6
7)。次に関数giとスクリーン上の座標(x,y)と
を用いて、属性要素tiを式ti=gi(x,y)で算
出する(ステップS68)。ステップS66あるいはス
テップS68の処理を実行した後、算出した属性要素t
iを属性バッファ・メモリ15の(x,y)の位置に格
納する(ステップS69)。ステップS65〜S69の
処理は必要な属性要素すべてに対して行う。次にx座標
を1だけ増加させる(ステップS70)。次に新しいx
座標の値とスクリーン上でのx座標の最大値Xmaxと
を比較し(ステップS71)、新しいx座標がXmax
以下ならばステップS63へ戻る。新しいx座標がXm
axよりも大きいならば、y座標を1だけ増加させる
(ステップS72)。次に新しいy座標の値とスクリー
ン上でのy座標の最大値Ymaxとを比較し(ステップ
S73)、新しいy座標がYmax以下ならばステップ
S62へ戻る。新しいy座標がYmaxよりも大きいな
らばこのルーチンを終了する。
As described above, since the attribute value is calculated only for the pixels corresponding to the image after the hidden surface removal processing, the invalid processing can be eliminated. Moreover, since a plurality of attribute elements are handled, a remarkable effect can be obtained for a high quality image as compared with the first embodiment. For example, the element (Nx, Ny, Nz) of the normal vector at each pixel is selected as the attribute element,
Suppose gi (x, y) is a linear expression for (x, y),
By obtaining the brightness of the pixel from the position and direction of the light source and the calculated normal vector, a higher quality (and therefore more realistic) phone shading algorithm (for example, "basic graphics") than the Gouraud shading algorithm is obtained. Satoshi Kawai, Shokodo, 1985
Year, pages 174-179). (Fourth Embodiment) In the third embodiment, the attribute value is calculated according to the procedure shown in FIG. 7, but the attribute value may be calculated according to the procedure shown in FIG. That is, first, the y coordinate of the coordinates (x, y) on the screen indicating the position of the pixel to be processed is initialized to 1 (step S61). Next, similarly, the x coordinate of the coordinates (x, y) on the screen is initialized to 1 (step S62). Next, the polygon id of the coordinate (x, y) on the screen is read from the frame buffer memory 12 (step S63). Next read polygon i
d is compared with the polygon id of the adjacent pixel (step S64), and when the read polygon id is equal to the polygon id of the adjacent pixel, a function g for calculating the attribute element ti
A value g ′ (x, y) of the partial differential component of i (x, y) in the x direction at pixel (x, y) is calculated (step S65). Next, using the attribute element values t′i and g′i (x, y) in the pixel (x−1, y) adjacent to the pixel (x, y), the attribute element ti of the pixel (x, y) is used. The expression ti = t'i + g'i
It is calculated by (x, y) (step S66). Step S
In 64, the polygon i read in step S63
If it is determined that d is not equal to the polygon id of the adjacent pixel, the function gi for calculating the value of the attribute element designated by the read polygon id is selected (step S6).
7). Next, using the function gi and the coordinates (x, y) on the screen, the attribute element ti is calculated by the expression ti = gi (x, y) (step S68). After performing the process of step S66 or step S68, the calculated attribute element t
i is stored in the position (x, y) of the attribute buffer memory 15 (step S69). The processes of steps S65 to S69 are performed for all necessary attribute elements. Then, the x coordinate is incremented by 1 (step S70). Next new x
The value of the coordinate is compared with the maximum value Xmax of the x coordinate on the screen (step S71), and the new x coordinate is Xmax.
If the following is true, the process returns to step S63. The new x coordinate is Xm
If it is larger than ax, the y coordinate is incremented by 1 (step S72). Next, the new y-coordinate value is compared with the maximum y-coordinate value Ymax on the screen (step S73). If the new y-coordinate is less than Ymax, the process returns to step S62. If the new y coordinate is larger than Ymax, this routine ends.

【0025】このように、関数g(x,y)のx方向の
偏微分成分g’(x,y)を用いれば、演算が容易にな
り、処理速度を高速化できる。なお関数g(x,y)の
y方向の偏微分成分を用いてもよい。
As described above, if the partial differential component g '(x, y) of the function g (x, y) in the x direction is used, the calculation becomes easy and the processing speed can be increased. The partial differential component of the function g (x, y) in the y direction may be used.

【0026】[0026]

【発明の効果】以上説明したように本発明によれば、全
ての図形データに対する隠面消去処理を行った後に、ス
クリーン上の各画素毎に直接的に輝度Iもしくは属性要
素tiの値を算出するので、最終結果の画像生成に寄与
しない部分に対する処理を削除し、より高画質な画像を
効率よく生成することができるという優れた効果を奏す
る。
As described above, according to the present invention, the value of the brightness I or the attribute element ti is directly calculated for each pixel on the screen after the hidden surface removal processing is performed on all the graphic data. Therefore, there is an excellent effect that the process for the part that does not contribute to the image generation of the final result is deleted and a higher quality image can be efficiently generated.

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

【図1】本発明の実施例1における三次元画像生成方法
を実現する三次元画像生成装置のブロック図である。
FIG. 1 is a block diagram of a three-dimensional image generation device that realizes a three-dimensional image generation method according to a first embodiment of the present invention.

【図2】本発明の実施例1における三次元画像生成方法
の手順を説明するフローチャートである。
FIG. 2 is a flowchart illustrating a procedure of a three-dimensional image generation method according to the first embodiment of the present invention.

【図3】本発明の実施例1における三次元画像生成方法
で採用した輝度算出手順を説明するフローチャートであ
る。
FIG. 3 is a flowchart illustrating a brightness calculation procedure adopted in the three-dimensional image generation method according to the first embodiment of the present invention.

【図4】本発明の実施例2における三次元画像生成方法
で採用した輝度算出手順を説明するフローチャートであ
る。
FIG. 4 is a flowchart illustrating a brightness calculation procedure adopted in the three-dimensional image generation method according to the second embodiment of the present invention.

【図5】本発明の実施例3における三次元画像生成方法
を実現する三次元画像生成装置のブロック図である。
FIG. 5 is a block diagram of a three-dimensional image generation device that realizes a three-dimensional image generation method according to a third embodiment of the present invention.

【図6】本発明の実施例3における三次元画像生成方法
の手順を説明するフローチャートである。
FIG. 6 is a flowchart illustrating a procedure of a three-dimensional image generation method according to the third embodiment of the present invention.

【図7】本発明の実施例3における三次元画像生成方法
で採用した属性値算出手順を説明するフローチャートで
ある。
FIG. 7 is a flowchart illustrating an attribute value calculation procedure adopted in the three-dimensional image generation method according to the third embodiment of the present invention.

【図8】本発明の実施例4における三次元画像生成方法
で採用した属性値算出手順を説明するフローチャートで
ある。
FIG. 8 is a flowchart illustrating an attribute value calculation procedure adopted in the three-dimensional image generation method according to the fourth embodiment of the present invention.

【図9】従来の三次元画像生成方法を実現する三次元画
像生成装置のブロック図である。
FIG. 9 is a block diagram of a three-dimensional image generation device that realizes a conventional three-dimensional image generation method.

【図10】従来の三次元画像生成方法の手順を説明する
フローチャートである。
FIG. 10 is a flowchart illustrating a procedure of a conventional three-dimensional image generation method.

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

1 プロセッサ 2 フレーム・バッファ・メモリ 3 Zバッファ・メモリ 4 表示装置 11 プロセッサ 12 フレーム・バッファ・メモリ 13 Zバッファ・メモリ 14 表示装置 15 属性バッファ・メモリ 1 processor 2 frame buffer memory 3 Z buffer memory 4 display device 11 processors 12 frame buffer memory 13 Z buffer memory 14 Display 15 attribute buffer memory

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 二次元のスクリーン平面上の座標(x,
y)と前記スクリーン平面からの奥行きを表わす座標z
とからなるスクリーン座標(x,y,z)により定義さ
れる三次元の図形データと、明るさを表わす輝度Iとを
用いて立体的な画像を生成する三次元画像生成方法にお
いて、前記スクリーン座標のうちの奥行き座標値zを用
いて各画素毎に図形の前後を判定して視点により近い図
形データを選択するZバッファ・アルゴリズムに基づい
た隠面消去処理ステップと、全ての図形データに対する
前記隠面消去処理ステップの終了後にスクリーン上の各
画素毎に輝度Iを算出する輝度算出ステップとを実行す
ることを特徴とする三次元画像生成方法。
1. A coordinate (x,
y) and the coordinate z representing the depth from the screen plane
In the three-dimensional image generation method for generating a three-dimensional image using three-dimensional graphic data defined by screen coordinates (x, y, z) consisting of and luminance I representing brightness, the screen coordinates A hidden surface erasing processing step based on a Z-buffer algorithm that determines the front and back of a figure for each pixel using the depth coordinate value z of the above, and selects the figure data closer to the viewpoint; And a luminance calculation step of calculating the luminance I for each pixel on the screen after the surface erasing processing step is completed.
【請求項2】 図形の輝度Iが、スクリーン座標のうち
の(x,y)座標値により一意に決定できる、すなわち
関数gを用いてI=g(x,y)として定義できる場合
に、輝度算出ステップにおいて、輝度Iを画素の位置す
なわち(x,y)座標値より前記式I=g(x,y)を
用いて直接的に算出することを特徴とする請求項1に記
載の三次元画像生成方法。
2. The brightness I of a graphic can be uniquely determined by the (x, y) coordinate value of the screen coordinates, that is, can be defined as I = g (x, y) using a function g. 3. The three-dimensional structure according to claim 1, wherein in the calculating step, the brightness I is directly calculated from the position of the pixel, that is, the (x, y) coordinate value by using the formula I = g (x, y). Image generation method.
【請求項3】 図形の輝度Iが、スクリーン座標のうち
の(x,y)座標値により一意に決定できる、すなわち
関数gを用いてI=g(x,y)として定義でき、かつ
直前に輝度値を算出した画素における輝度I’と関数g
のx座標またはy座標に対する偏微分成分g’(x,
y)とを用いてI=I’+g’(x,y)と算出できる
場合に、輝度算出ステップにおいて、輝度Iを算出すべ
き画素の図形が直前に輝度I’を算出した画素の図形と
同じときには輝度Iを前記式I=I’+g’(x,y)
を用いて算出し、輝度Iを算出すべき画素の図形が直前
に輝度値を算出した画素の図形と異なるときには輝度I
を前記式I=g(x,y)を用いて直接的に算出するこ
とを特徴とする請求項1に記載の三次元画像生成方法。
3. The brightness I of the graphic can be uniquely determined by the (x, y) coordinate value of the screen coordinates, that is, can be defined as I = g (x, y) using the function g, and immediately before. The luminance I ′ and the function g in the pixel for which the luminance value is calculated
Partial differential component g '(x,
y) and I = I ′ + g ′ (x, y) can be calculated, in the luminance calculation step, the figure of the pixel for which the luminance I should be calculated is the figure of the pixel for which the luminance I ′ was calculated immediately before. When the same, the brightness I is calculated by the above formula I = I '+ g' (x, y)
If the figure of the pixel for which the brightness I is to be calculated is different from the figure of the pixel for which the brightness value was calculated immediately before, the brightness I
The three-dimensional image generation method according to claim 1, wherein is calculated directly using the formula I = g (x, y).
【請求項4】 二次元のスクリーン平面上の座標(x,
y)と前記スクリーン平面からの奥行きを表わす座標z
とからなるスクリーン座標(x,y,z)により定義さ
れる三次元の図形データと、色や輝度や法線ベクトルな
どの図形特有の性質を決定する属性データの組からなる
属性ベクトル(t1,t2,…,tn)(nは2以上の
整数)とを用いて立体的な画像を生成する三次元画像生
成方法において、前記スクリーン座標のうちの奥行き座
標値zを用いて各画素毎に図形の前後を判定して視点に
より近い図形データを選択するZバッファ・アルゴリズ
ムに基づいた隠面消去処理ステップと、全ての図形デー
タに対する前記隠面消去処理ステップの終了後にスクリ
ーン上の各画素毎に属性ベクトルの要素である属性要素
ti(iは1からnまでの整数)の値を算出する属性値
算出ステップとを実行することを特徴とする三次元画像
生成方法。
4. Coordinates (x,
y) and the coordinate z representing the depth from the screen plane
An attribute vector (t1, consisting of a set of three-dimensional graphic data defined by screen coordinates (x, y, z) consisting of and attribute data for determining characteristics unique to the graphic such as color, brightness, and normal vector. In the three-dimensional image generation method for generating a stereoscopic image by using t2, ..., Tn) (n is an integer of 2 or more), a figure for each pixel using the depth coordinate value z of the screen coordinates. Before and after the hidden surface removal processing step based on the Z-buffer algorithm for selecting graphic data closer to the viewpoint, and after completion of the hidden surface removal processing step for all graphic data, attributes for each pixel on the screen A three-dimensional image generation method comprising: performing an attribute value calculation step of calculating a value of an attribute element ti (i is an integer from 1 to n) that is an element of a vector.
【請求項5】 属性要素tiの値が、スクリーン座標の
うちの(x,y)座標値により一意に決定できる、すな
わち関数giを用いてti=gi(x,y)として定義
できる場合に、属性値算出ステップにおいて、属性要素
tiの値を当該画素の位置すなわち(x,y)座標値よ
り前記式ti=gi(x,y)を用いて直接的に算出す
ることを特徴とする請求項4に記載の三次元画像生成方
法。
5. When the value of the attribute element ti can be uniquely determined by the (x, y) coordinate value of the screen coordinates, that is, when the function gi can be defined as ti = gi (x, y), In the attribute value calculation step, the value of the attribute element ti is directly calculated from the position of the pixel, that is, the (x, y) coordinate value, using the equation ti = gi (x, y). The three-dimensional image generation method according to item 4.
【請求項6】 属性要素tiの値が、スクリーン座標の
うちの(x,y)座標値により一意に決定できる、すな
わち関数giを用いてti=gi(x,y)として定義
でき、かつ直前に算出した属性要素t’iの値と関数g
iのx座標またはy座標に対する偏微分成分g’i
(x,y)とを用いてti=t’i+g’i(x,y)
と算出できる場合に、特性値算出ステップにおいて、値
を算出すべき属性要素tiの画素の図形が直前に値を算
出した属性要素ti’の画素の図形と同じときには属性
要素tiの値を前記式ti=t’i+g’i(x,y)
を用いて算出し、値を算出すべき属性要素tiの画素の
図形が直前に値を算出した属性要素ti’の画素の図形
と異なるときには前記式ti=gi(x,y)を用いて
直接的に算出することを特徴とする請求項4に記載の三
次元画像生成方法。
6. The value of the attribute element ti can be uniquely determined by the (x, y) coordinate value of the screen coordinates, that is, can be defined as ti = gi (x, y) using the function gi, and immediately before. The value of the attribute element t'i calculated in the above and the function g
Partial differential component g'i with respect to the x coordinate or the y coordinate of i
Using (x, y) and ti = t'i + g'i (x, y)
If the figure of the pixel of the attribute element ti whose value is to be calculated is the same as the figure of the pixel of the attribute element ti ′ whose value was calculated immediately before, the value of the attribute element ti is calculated by ti = t'i + g'i (x, y)
When the figure of the pixel of the attribute element ti whose value is to be calculated is different from the figure of the pixel of the attribute element ti ′ whose value was calculated immediately before, directly using the equation ti = gi (x, y) The three-dimensional image generation method according to claim 4, wherein the three-dimensional image generation method is performed as follows.
JP3189795A 1991-07-30 1991-07-30 Three-dimensional image generating method Pending JPH0535883A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3189795A JPH0535883A (en) 1991-07-30 1991-07-30 Three-dimensional image generating method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3189795A JPH0535883A (en) 1991-07-30 1991-07-30 Three-dimensional image generating method

Publications (1)

Publication Number Publication Date
JPH0535883A true JPH0535883A (en) 1993-02-12

Family

ID=16247337

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3189795A Pending JPH0535883A (en) 1991-07-30 1991-07-30 Three-dimensional image generating method

Country Status (1)

Country Link
JP (1) JPH0535883A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07141526A (en) * 1993-01-15 1995-06-02 Internatl Business Mach Corp <Ibm> Computer graphic system
JPH08161532A (en) * 1994-12-07 1996-06-21 Nec Corp Device and method for three-dimensional drawing
US6603474B1 (en) 1999-05-27 2003-08-05 International Business Machines Corporation Method and apparatus for occlusion culling of objects in a data processing system
US7142207B2 (en) 2001-10-15 2006-11-28 Fujitsu Limited Hierarchical sorting of linked objects in virtual three-dimensional space

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07141526A (en) * 1993-01-15 1995-06-02 Internatl Business Mach Corp <Ibm> Computer graphic system
JP2769427B2 (en) * 1993-01-15 1998-06-25 インターナショナル・ビジネス・マシーンズ・コーポレイション Method for processing data for a set of graphic primitives
JPH08161532A (en) * 1994-12-07 1996-06-21 Nec Corp Device and method for three-dimensional drawing
US6603474B1 (en) 1999-05-27 2003-08-05 International Business Machines Corporation Method and apparatus for occlusion culling of objects in a data processing system
US7142207B2 (en) 2001-10-15 2006-11-28 Fujitsu Limited Hierarchical sorting of linked objects in virtual three-dimensional space

Similar Documents

Publication Publication Date Title
US6654020B2 (en) Method of rendering motion blur image and apparatus therefor
JP3021368B2 (en) Bump mapping rendering method using pixel normal vector and rendering apparatus embodying the same
US8803879B1 (en) Omnidirectional shadow texture mapping
JP2000227966A (en) 3d computer graphics processor and processing method
KR19990045321A (en) Image processing in which polygons are divided
JPH1166340A (en) Device and method for processing image and recording medium recording image processing program
KR100277803B1 (en) 3D graphic display
JPH07254072A (en) Texture mapping method and device therefor
KR100381817B1 (en) Generating method of stereographic image using Z-buffer
JP3629243B2 (en) Image processing apparatus and method for rendering shading process using distance component in modeling
JPH0535883A (en) Three-dimensional image generating method
KR100429092B1 (en) Graphic image processing method and apparatus
US5499324A (en) Graphic display apparatus with improved shading capabilities
JP2001126086A (en) Method and device for displaying three-dimensional model in video game, game machine, and computer- readable recording medium storing three-dimensional model displaying program for video game
JPH07225854A (en) System and method for generating two-dimensional display of three-dimensional object
JP4642431B2 (en) Map display device, map display system, map display method and program
US6590582B1 (en) Clipping processing method
Levene A framework for non-realistic projections
JP3586253B2 (en) Texture mapping program
US6429866B1 (en) Three-dimensional graphics drawing apparatus calculating tone of pixel based on tones of pixels at prescribed intervals, method thereof and medium recorded with program therefor
JP2001076180A (en) Three-dimensional graphics display device
JP3058769B2 (en) 3D image generation method
JPH11185052A (en) Device and method for calculating texture mapping coordinate of three-dimensional computer graphics
KR20080064523A (en) 3-dimension graphic processing apparatus and operating method thereof
JP2000339486A (en) Picture processing method and volume rendering processor