JP2001092987A - Image data processing method - Google Patents

Image data processing method

Info

Publication number
JP2001092987A
JP2001092987A JP27002899A JP27002899A JP2001092987A JP 2001092987 A JP2001092987 A JP 2001092987A JP 27002899 A JP27002899 A JP 27002899A JP 27002899 A JP27002899 A JP 27002899A JP 2001092987 A JP2001092987 A JP 2001092987A
Authority
JP
Japan
Prior art keywords
polygon
voxels
intersection
vertex
straight line
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.)
Withdrawn
Application number
JP27002899A
Other languages
Japanese (ja)
Inventor
Maki Sato
真樹 佐藤
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.)
Victor Company of Japan Ltd
Original Assignee
Victor Company of Japan 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 Victor Company of Japan Ltd filed Critical Victor Company of Japan Ltd
Priority to JP27002899A priority Critical patent/JP2001092987A/en
Publication of JP2001092987A publication Critical patent/JP2001092987A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

PROBLEM TO BE SOLVED: To generate a cross generic polygon list at high speed by efficiently performing cross generic discrimination in ray tracing. SOLUTION: When generating the cross generic polygon list of respective voxels 3 with an accelerating method based on the spatial division of ray tracing, the cross generic discrimination is performed by executing work for painting out the polygon 1 with voxels 3 for the unit of each polygon while using a 3DDDA algorithm and the identifier of that polygon 1 is added to the cross generic polygon list of voxels 5 used for painting out the polygon 1. Thus, in the case of cross generic discrimination, idle voxels can be excluded from the target of processing.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、計算機システムに
おいて、光線追跡法やZバッファ=グーロシェーディン
グ法を用いることにより、3次元物体などの映像を高品
質で生成する画像データ処理方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image data processing method for generating a high-quality image of a three-dimensional object or the like by using a ray tracing method or a Z-buffer = Guro shading method in a computer system.

【0002】[0002]

【従来の技術】3次元コンピュータグラフィックス(C
G)における曲面の一般的な表現方法として、3次元図
形を複数の多角形により近似する方法が知られている。
これらの多角形はポリゴンと呼ばれ、ポリゴンを2次元
画像に投影することによって、CRT画面などのスクリ
ーン上に3次元図形の描画を行う。
2. Description of the Related Art Three-dimensional computer graphics (C)
As a general method of expressing a curved surface in G), a method of approximating a three-dimensional figure by a plurality of polygons is known.
These polygons are called polygons, and three-dimensional figures are drawn on a screen such as a CRT screen by projecting the polygons onto a two-dimensional image.

【0003】光線追跡法、すなわちレイトレーシング法
により画像の生成を行うと、反射や透過などを含む高品
質な映像を生成することができるが、非常に膨大な処理
時間を必要とするため、その時間を短縮する手段が望ま
れる。光線追跡法は、高品質な画像が得られるものの、
光線と物体の交差判定に膨大な処理時間を必要とするた
め、交差判定の高速アルゴリズムが必須となる。
[0003] When an image is generated by a ray tracing method, that is, a ray tracing method, a high-quality image including reflection and transmission can be generated, but an extremely enormous processing time is required. Means for reducing the time are desired. Ray tracing provides high quality images,
Since an enormous amount of processing time is required to determine the intersection between a ray and an object, a high-speed algorithm for determining the intersection is essential.

【0004】従来、高速アルゴリズムとして用いられて
いるものとして、空間分割法がある。空間をボクセルと
呼ばれる直方体に分割し、あらかじめ、各ボクセル単位
で各ボクセルが交差、包括する物体のリストを生成し保
持しておく。実際に光線追跡を行う場合には、対象光線
と、全ての物体の交差判定を行うのではなく、光線が通
過するボクセルを求め、そのボクセル単位で、先に求め
ておいたボクセル内ポリゴンリストに含まれる物体との
み交差判定を行う。これにより交差判定回数が減少し、
高速画像生成が可能となる。
Conventionally, a space division method has been used as a high-speed algorithm. The space is divided into cuboids called voxels, and a list of objects that each voxel intersects and encompasses in each voxel is generated and stored in advance. When actually performing ray tracing, instead of determining the intersection of the target ray and all objects, find the voxel through which the ray passes, and in the voxel unit, add the The intersection is determined only for the included object. This reduces the number of intersection judgments,
High-speed image generation becomes possible.

【0005】一方、Zバッファ法により画像の生成を行
う場合、各ポリゴン単位で輝度を計算していく。ただ
し、Zバッファ法に用いるグーロシェーディング法の場
合には、頂点に対してのみ何らかの照度モデルに基づき
輝度計算を行う。残りのポリゴン内部点の輝度は、頂点
間の内挿計算で求めるため、少ない処理時間で映像を生
成することができる。しかし、物体が作る影が表現でき
ないため、より現実的な映像を生成するためには、何ら
かの影付けの手段が望まれる。
On the other hand, when generating an image by the Z-buffer method, the brightness is calculated for each polygon. However, in the case of the Gouraud shading method used for the Z-buffer method, the luminance is calculated only for the vertices based on some illuminance model. Since the brightness of the remaining polygon inside points is obtained by interpolation between vertices, an image can be generated in a short processing time. However, since a shadow created by an object cannot be expressed, some means of shadowing is desired to generate a more realistic image.

【0006】Zバッファ法で影を付けた映像を生成する
には、影が存在する範囲について黒いポリゴンからなる
仮想的な物体があるとみなし、それが対象とするポリゴ
ンを隠すというシャドーポリゴン法と呼ばれるアルゴリ
ズムを用いるか、ポリゴンの各点における輝度計算の際
に、その点と光源とを結んだベクトルとポリゴンとの交
差判定を行い、その点が影になっているかを判断すると
いうシャドーフィーラー法を用いるのが一般的である。
In order to generate an image with a shadow by the Z-buffer method, a shadow polygon method is used in which a virtual object consisting of a black polygon is regarded as being present in a range where the shadow exists, and the target polygon is hidden. A shadow feeler method that uses an algorithm called at the time of calculating the brightness at each point of a polygon and determines whether the polygon intersects with the vector connecting the point and the light source and determines whether the point is a shadow. Is generally used.

【0007】シャドーフィーラー法は、光源とポリゴン
上の点との間にある物体の光透過率を用いて物体により
減衰していく透過光の強さを求め、ポリゴン上の点に到
達する光の強さを算出する方法である。まず輝度を知り
たいポリゴン上の1点を定め、その点と光源を結ぶベク
トルを求める。このベクトルと交差するポリゴンを調
べ、交差したポリゴンの光透過率に応じた強さの光がそ
の点に到達するものとして光源からの光の強さを計算す
る。以下の(1)式がシャドーフィーラー法に用いられ
る基本的な計算式である。 ポリゴン上の点に到達する光の強さ =光源の光の強さ×{P1×P2×…×Pn×…×PN} (1) ただし、Pnは光源からの光がn番目に交差する交差ポ
リゴンの光透過率である。上の式(1)はN個のポリゴ
ンと交差した場合を表している。
In the shadow feeler method, the intensity of transmitted light attenuated by an object is determined using the light transmittance of an object between a light source and a point on the polygon, and the intensity of light reaching the point on the polygon is determined. This is a method of calculating strength. First, a point on a polygon whose luminance is to be determined is determined, and a vector connecting the point and the light source is determined. A polygon that intersects this vector is examined, and the intensity of light from the light source is calculated assuming that light having an intensity corresponding to the light transmittance of the intersecting polygon reaches that point. The following formula (1) is a basic calculation formula used in the shadow feeler method. Light intensity reaching a point on the polygon = light intensity of light source × {P 1 × P 2 ×... P n ×... PN } (1) where P n is n from the light source This is the light transmittance of the intersection polygon that intersects the third. The above equation (1) represents a case where it intersects with N polygons.

【0008】図4(a)はDDAにより生成されたデジ
タル直線を示す模式図である。図4(b)は線分描画に
より生成されたデジタル直線を示す模式図である。視線
と物体との交差判定の際に、3DDDA(3D Digital D
ifferential Analyzer)と呼ばれるアルゴリズムが用い
られる。3DDDAは3次元のデジタル直線を生成す
る。3DDDAによるデジタル直線は、線分描画により
生成されたデジタル直線、例えばディスプレイに直線を
表示する場合のデジタル直線とは異なっている。3DD
DAによるデジタル直線は、基となる直線が通過する全
てのボクセルの列であるが、ディスプレイに表示するデ
ジタル直線は表示時のバランスが考慮されて、基となる
直線が通過するボクセルが必ずしもデジタル直線を構成
するわけではない。
FIG. 4A is a schematic diagram showing a digital straight line generated by DDA. FIG. 4B is a schematic diagram showing a digital straight line generated by line drawing. When determining the intersection between the line of sight and the object, 3D
An algorithm called ifferential analyzer) is used. 3DDDA generates a three-dimensional digital straight line. A digital straight line according to 3DDDA is different from a digital straight line generated by line segment drawing, for example, a digital straight line when a straight line is displayed on a display. 3DD
The digital straight line by DA is a row of all the voxels through which the base straight line passes. Does not constitute

【0009】[0009]

【発明が解決しようとする課題】光線追跡法において、
空間分割型の高速アルゴリズムを採用することで光線追
跡処理は高速化するものの、そのための前処理、つま
り、各ボクセルでの交差包括ポリゴンリストを生成処理
する時間が必要となる。交差包括ポリゴンリストとはボ
クセルがどのポリゴンと交差又は包括しているかを判定
し、光線追跡法による処理を行う前にポリゴンの分布を
記録しておくものである。
SUMMARY OF THE INVENTION In the ray tracing method,
Although the ray tracing process is sped up by adopting the high-speed algorithm of the space division type, preprocessing for the ray tracing process, that is, time for generating an intersection comprehensive polygon list for each voxel is required. The intersection inclusion polygon list is for determining which polygon the voxel intersects or encompasses, and records the distribution of the polygons before performing the processing by the ray tracing method.

【0010】例えば、空間をN個のボクセルに分割し、
その空間内にM個の描写対象ポリゴンがある場合、単純
にボクセル毎に交差包括判定を行うと、N×M回の判定
処理が必要となる。N、Mが大きくなると、交差包括判
定の処理にかかる時間は、無視できないほど長くなる。
ボクセルの多くはポリゴンを含まない空ボクセルである
場合が多く、ボクセル数が多くなると空ボクセルも多く
なる。こうした空ボクセルはその後の光線追跡法におい
ては無視されるので、空ボクセルの交差包括判定を行う
ことは無駄である。
For example, the space is divided into N voxels,
If there are M rendering target polygons in that space, simply performing the intersection comprehensive determination for each voxel requires N × M determination processes. When N and M become large, the time required for the process of the intersection comprehensive determination becomes too long to be ignored.
Many voxels are often empty voxels that do not contain polygons, and the more voxels the more empty voxels. Since such an empty voxel is ignored in the subsequent ray tracing method, it is useless to perform the cross-overall inclusion determination of the empty voxel.

【0011】一方、Zバッファ法において、シャドーポ
リゴン法を行う場合、ポリゴン形状の導出や、現実の物
体との前後位置決定などの計算が必要となる。また、シ
ャドーフィーラー法を行う場合、ポリゴン上の各点で交
差判定による影判定をしなければならないなどの問題が
ある。いずれの場合も、輝度計算による影付けの処理に
時間がかかる。
On the other hand, when the shadow polygon method is used in the Z-buffer method, calculations such as derivation of a polygon shape and determination of a position before and after a real object are required. In addition, when the shadow feeler method is performed, there is a problem that shadow determination by intersection determination must be performed at each point on a polygon. In any case, it takes time to perform the shadowing process by the luminance calculation.

【0012】本発明は上記従来の問題に鑑み、光線追跡
法において、空ボクセルを処理対象から除外して交差包
括判定を行い、交差包括ポリゴンリストを高速で生成す
ることができる画像データ処理方法を提供することを目
的としている。
In view of the above-mentioned conventional problems, the present invention provides an image data processing method capable of generating an intersection inclusion polygon list at a high speed in a ray tracing method by excluding empty voxels from processing objects and performing intersection inclusion judgment. It is intended to provide.

【0013】また本発明は上記従来の問題に鑑み、Zバ
ッファ法において、他のポリゴンの影の影響を考慮し
て、ポリゴンの頂点輝度を計算することができる画像デ
ータ処理方法を提供することを目的としている。
Further, the present invention has been made in view of the above-mentioned conventional problems, and provides an image data processing method capable of calculating the vertex luminance of a polygon in the Z-buffer method in consideration of the influence of the shadow of another polygon. The purpose is.

【0014】[0014]

【課題を解決するための手段】上記目的を達成するため
に、本発明では空間分割法の前処理として行う各ボクセ
ルの交差包括ポリゴンリストの生成において、3DDD
Aを用いてデジタル直線を生成し、ポリゴンをボクセル
により塗りつぶす作業を行う。ポリゴンの塗りつぶしに
用いたボクセルはポリゴンと交差している、または包括
していると判定し、ポリゴンの塗りつぶしに用いたボク
セルの交差包括ポリゴンリストにそのポリゴンを追加す
る。
In order to achieve the above-mentioned object, according to the present invention, in generating an intersection comprehensive polygon list of each voxel performed as preprocessing of the space division method, 3DDD is used.
A digital straight line is generated using A, and the polygon is filled with voxels. It is determined that the voxel used to fill the polygon intersects or covers the polygon, and the polygon is added to the voxel intersection inclusion polygon list used to fill the polygon.

【0015】すなわち本発明によれば、ポリゴンにより
近似された物体を内包する空間を複数のボクセルに分割
するステップと、対象とするポリゴンを構成する各辺に
関して、前記複数のボクセルで構成されるデジタル直線
を3DDDAにより生成するステップと、前記複数のボ
クセルの境界と前記各辺との交点を求めるステップと、
前記デジタル直線を構成するボクセルが有する交差包括
ポリゴンリストに、前記対象とするポリゴンの識別子を
追加するステップと、前記対象とするポリゴンの頂点を
1点、任意に選択するステップと、選択された頂点と前
記交点とを結ぶ線分に関して、前記複数のボクセルで構
成される新たなデジタル直線を3DDDAにより生成す
るステップと、前記新たなデジタル直線を構成するボク
セルが有する交差包括ポリゴンリストに前記識別子を追
加するステップとを、有する画像データ処理方法が提供
される。
That is, according to the present invention, a step of dividing a space containing an object approximated by a polygon into a plurality of voxels, and a step of dividing each of the sides constituting a target polygon into a digital image comprising the plurality of voxels. Generating a straight line by 3DDDA; and obtaining an intersection between the boundaries of the plurality of voxels and the respective sides;
Adding an identifier of the target polygon to the intersection comprehensive polygon list of the voxels constituting the digital straight line, arbitrarily selecting one vertex of the target polygon, and selecting the selected vertex Generating, by 3DDDA, a new digital straight line composed of the plurality of voxels with respect to a line segment connecting the intersection and the intersection, and adding the identifier to an intersection comprehensive polygon list included in the voxels constituting the new digital straight line And an image data processing method.

【0016】また、上記目的を達成するために、本発明
ではZバッファ法において、シャドーフィーラー法を用
いて求めた光源からの光を遮る物体の光透過率を考慮し
て頂点の輝度を算出し、さらにグーロシェーディング法
を用いて頂点の輝度を内挿計算して、ポリゴン上の点の
輝度を算出する。
To achieve the above object, according to the present invention, in the Z-buffer method, the vertex luminance is calculated in consideration of the light transmittance of an object that blocks light from a light source obtained using the shadow feeler method. Then, the luminance of the vertices is interpolated using the Gouraud shading method to calculate the luminance of a point on the polygon.

【0017】すなわち本発明によれば、ポリゴンにより
近似された物体のうち、対象とするポリゴンの各頂点と
光源とのベクトルを算出するステップと、前記ベクトル
と周囲のポリゴンとの交差判定を行うステップと、交差
すると判定されたポリゴンの光透過率に応じて、前記各
頂点に達する前記光源からの光の強さを算出するステッ
プと、前記光の強さを基にして、前記各頂点の輝度を算
出するステップと、前記各頂点での輝度を内挿計算する
ことにより、前記対象とするポリゴン内部の点での輝度
を算出するステップとを、有する画像データ処理方法が
提供される。
That is, according to the present invention, a step of calculating a vector between each vertex of a target polygon and a light source in an object approximated by a polygon, and a step of determining an intersection between the vector and a surrounding polygon Calculating the intensity of light from the light source reaching each of the vertices according to the light transmittance of the polygon determined to intersect; and calculating the luminance of each of the vertices based on the intensity of light. And calculating the brightness at a point inside the target polygon by interpolating the brightness at each of the vertices.

【0018】[0018]

【発明の実施の形態】<第1の実施の形態>以下、図面
を参照しながら本発明の画像データ処理方法の説明をす
る。説明を簡略化するために、2次元空間における2D
DDA(2D Digital DifferentialAnalyzer)に関して
説明をする。以下、2DDDAを単にDDA(Digital
Differential Analyzer)と記すことにする。また、後
述するように、2次元空間から3次元空間への拡張は容
易である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS <First Embodiment> An image data processing method according to the present invention will be described below with reference to the drawings. 2D in two-dimensional space to simplify the description
The DDA (2D Digital Differential Analyzer) will be described. Hereinafter, 2DDDA is simply referred to as DDA (Digital
Differential Analyzer). Further, as will be described later, expansion from a two-dimensional space to a three-dimensional space is easy.

【0019】図1は、本発明の画像データ処理方法に係
る第1の実施の形態を説明するフローチャートである。
また図3は、ボクセルにより分割された空間にあるポリ
ゴンを示す模式図である。今、対象としているポリゴン
をN角形と仮定する。ステップS101において、図3
に示すように(図3はN=5の場合が描かれている)、
頂点が時計回りに遷移するに従って、指数の値が増加す
るようにVnを割り当てる。また、対象とするポリゴン
1の辺は、Vnに対して時計回りで正の方向の隣にある
頂点Vn+1とを結ぶ線分であり、対象とするポリゴン1
の辺を線分L(n,n+1)で表すことにする。ただ
し、n=NならばVN+1=V1となる。また、図3に示し
たように、対象とするポリゴン1を含む平面はS×Sで
ボクセル分割されており、S2個のボクセル3が存在し
ているものとする。
FIG. 1 is a flowchart illustrating a first embodiment of the image data processing method according to the present invention.
FIG. 3 is a schematic diagram showing polygons in a space divided by voxels. Now, assume that the target polygon is an N-gon. In step S101, FIG.
(FIG. 3 depicts the case where N = 5), as shown in FIG.
According vertex transitions clockwise, assign V n such that the value of the exponent is increased. Also, the sides of the polygon 1 of interest is a line segment connecting the vertex V n + 1 next to the positive direction in the clockwise direction with respect to V n, polygons 1 of interest
Is represented by a line segment L (n, n + 1). However, if n = N, V N + 1 = V 1 . Also, as shown in FIG. 3, it is assumed that the plane including the target polygon 1 is divided into voxels by S × S, and that there are S 2 voxels 3.

【0020】ステップS103において、n=1〜Nま
でのN本の線分L(n,n+1)に関して、DDAによ
りデジタル直線を生成する。これにより、対象とするポ
リゴン1を構成するN本の辺をデジタル直線で表すこと
ができる。またこのとき、DDAの処理過程において、
線分L(n,n+1)とボクセル3の境界との交点も同
時に求められる。
In step S103, digital straight lines are generated by DDA for N line segments L (n, n + 1) from n = 1 to N. As a result, the N sides constituting the target polygon 1 can be represented by digital straight lines. At this time, in the process of DDA,
The intersection between the line segment L (n, n + 1) and the boundary of the voxel 3 is also determined at the same time.

【0021】図5は線分L(n,n+1)とボクセル3
の境界との交点C(n,q)を示す模式図である。ステ
ップS105において、DDA処理中に求められる線分
L(n,n+1)とボクセル3の境界との交点をVn
近い順から交点C(n,q)と表すことにする。ただ
し、qは各交点の参照番号であり、qは自然数である。
このようにして、n=1〜Nに関して交点C(n,q)
が求められる。
FIG. 5 shows a line segment L (n, n + 1) and a voxel 3
FIG. 4 is a schematic diagram showing an intersection C (n, q) with the boundary of FIG. In step S105, it will be represented line L (n, n + 1) obtained in the DDA processing the intersection of the boundary voxel 3 from the forward close to V n intersection C (n, q) and. Here, q is a reference number of each intersection, and q is a natural number.
Thus, the intersection C (n, q) for n = 1 to N
Is required.

【0022】DDAにより発生したデジタル直線は、頂
点Vnと頂点Vn+1とを結ぶ線分L(n,n+1)を過不
足なく包括するボクセルの集まりである。すなわち、図
4(a)に示したようなデジタル直線を構成するボクセ
ル5により、対象とするポリゴン1の1辺は構成されて
おり、またデジタル直線を構成するボクセル5は対象と
するポリゴン1を含んでいることから、ステップS10
7において、デジタル直線を構成する各ボクセル5の交
差包括ポリゴンリストに、対象とするポリゴン1の識別
子を追加する。ただし、すでにリスト内に対象とするポ
リゴン1の識別子が存在する場合には、対象とするポリ
ゴン1の識別子を交差包括ポリゴンリストに追加する処
理を行う必要はない。なお、ポリゴンの識別子を複数の
ポリゴンの中から1つのポリゴンを特定できるよう前も
って設定しておく必要がある。
The jagged line generated by DDA is a collection of voxels that comprise the line L (n, n + 1) a just proportion connecting the vertex V n + 1 vertices V n. That is, one side of the target polygon 1 is constituted by the voxels 5 constituting the digital straight line as shown in FIG. 4A, and the voxel 5 constituting the digital straight line is constituted by the voxel 5 constituting the digital straight line. Because it includes, step S10
At 7, the identifier of the target polygon 1 is added to the intersection comprehensive polygon list of each voxel 5 constituting the digital straight line. However, if the identifier of the target polygon 1 already exists in the list, it is not necessary to perform the process of adding the identifier of the target polygon 1 to the intersection comprehensive polygon list. It is necessary to set an identifier of a polygon in advance so that one polygon can be specified from a plurality of polygons.

【0023】上記の実施の形態では、対象とするポリゴ
ン1の全ての辺に対して、一括して各ステップの処理を
行っているが、各辺ごとに、ステップS103〜S10
7の処理を行うことも可能である。すなわち、まず線分
L(1,2)に関して、3DDDAでデジタル直線を生
成し、そのデジタル直線を構成しているボクセル5の交
差包括ポリゴンリストに対象とするポリゴン1の識別子
を追加する。次に線分L(2,3)に関して同様の処理
を行う。そして、対象とする辺を変えていき、線分L
(N,1)に至るまで全ての辺に関して、ステップS1
03〜S107の処理を行っていくことも可能である。
In the above embodiment, the processing of each step is collectively performed on all the sides of the target polygon 1. However, for each side, steps S103 to S10 are performed.
7 can be performed. That is, first, a digital straight line is generated by 3DDDA for the line segment L (1, 2), and the identifier of the target polygon 1 is added to the intersection comprehensive polygon list of the voxels 5 constituting the digital straight line. Next, the same processing is performed for the line segment L (2, 3). Then, by changing the target side, the line segment L
Step S1 for all sides up to (N, 1)
It is also possible to perform the processing of 03 to S107.

【0024】次にステップS109において、対象とす
るポリゴン1の頂点を1点、任意に選択する。今、例え
ば頂点Vmを選んだ場合を考える。ただし、1≦m≦N
である。ステップS111において、線分L(m−1,
m)及び線分L(m,m+1)上の点を除く全てのC
(n,q)と頂点Vmとを結ぶ線分に対して、DDAに
よりデジタル直線を生成する。すなわち、n≠m−1、
mであるC(n,q)と頂点Vmとを結ぶ線分に対し
て、DDAによりデジタル直線を生成する。そして、ス
テップS113において、ステップS111で生成され
たデジタル直線を構成するボクセル5の交差包括ポリゴ
ンリストに、対象とするポリゴン1の識別子を追加す
る。ただし、ステップS107の場合と同様に、すでに
交差包括ポリゴンリスト内に同一のポリゴンの識別子が
存在する場合には、その識別子を追加する処理を行う必
要はない。上記のステップS101〜S113により、
ある対象とするポリゴン1を含むボクセル3を全て調べ
ることが可能となる。
Next, in step S109, one vertex of the target polygon 1 is arbitrarily selected. Now, consider the case where the vertex Vm is selected, for example. However, 1 ≦ m ≦ N
It is. In step S111, the line segment L (m-1,
m) and all C except points on the line segment L (m, m + 1)
(N, q) with respect to a line segment connecting the the vertex V m, to produce a digital linear with DDA. That is, n ≠ m−1,
a m C (n, q) with respect to a line segment connecting the vertex V m, to produce a digital linear with DDA. Then, in step S113, the identifier of the target polygon 1 is added to the intersection comprehensive polygon list of the voxels 5 constituting the digital straight line generated in step S111. However, as in the case of step S107, if the identifier of the same polygon already exists in the intersection comprehensive polygon list, it is not necessary to perform the process of adding the identifier. By the above steps S101 to S113,
It becomes possible to check all voxels 3 including a certain polygon 1 to be processed.

【0025】なお、線分L(m−1,m)及び線分L
(m,m+1)上の点は、C(m−1,q)とVmとを
結ぶ線分及びC(m,q)とVmとを結ぶ線分と同一で
ある。したがって、すでにステップS107で、線分L
(m−1,m)及び線分L(m,m+1)を包括するボ
クセルの交差包括ポリゴンリストに対象とするポリゴン
1の識別子を追加する作業が行われているので、ステッ
プS111でn=m−1、及びn=mであるC(n,
q)とVmとを結ぶ線分に関しては、デジタル直線を生
成する必要がない。
The line segment L (m-1, m) and the line segment L
(M, m + 1) points on is identical to the line segment connecting the segments and C (m, q) connecting the C (m-1, q) and V m and the V m. Therefore, already in step S107, the line segment L
Since the work of adding the identifier of the target polygon 1 to the intersection inclusion polygon list of the voxels including (m-1, m) and the line segment L (m, m + 1) is performed, n = m in step S111. -1 and C (n, n = m
For the line segment connecting q) and a V m, it is not necessary to generate a digital line.

【0026】さらに上記のステップをポリゴン単位で行
うことにより、3次元空間内での全てのポリゴンに関し
てポリゴン−ボクセル間の交差判定を行うことができ、
全てのボクセルに関して交差包括ポリゴンリストの作成
が可能となる。
Further, by performing the above steps in units of polygons, intersection determination between polygons and voxels can be performed for all polygons in the three-dimensional space.
An intersection comprehensive polygon list can be created for all voxels.

【0027】上記実施の形態では説明を簡単にするため
に2次元空間内のポリゴンを考え、ポリゴンを含む平面
がS×Sにボクセル分割されているとしたが、実際に
は、ボクセル分割されている3次元空間にポリゴンが埋
め込まれている形となっている。しかし、実際の3次元
空間内のポリゴンにおいても、3DDDAを用いてポリ
ゴンの辺に関してデジタル直線を生成し、上記の実施の
形態と全く同様の過程を行えばよい。したがって、ボク
セル2次元空間から3次元空間への拡張は容易で、実際
に3次元空間内のポリゴンに関して処理する場合も、上
記の2次元空間の実施の形態と同様である。
In the above embodiment, a polygon in a two-dimensional space is considered for the sake of simplicity, and a plane including the polygon is divided into voxels by S × S. The polygon is embedded in a three-dimensional space. However, for a polygon in an actual three-dimensional space, a digital straight line may be generated with respect to the side of the polygon using 3DDDA, and the same process as in the above embodiment may be performed. Therefore, it is easy to expand the voxel two-dimensional space to the three-dimensional space, and the case of actually processing polygons in the three-dimensional space is the same as the above-described two-dimensional space embodiment.

【0028】また、対象とするポリゴン1がN角形の場
合、N角形を3角形に分割してからステップS113以
下の処理を行うことも可能である。この場合、N角形ポ
リゴンを3角形に分割する処理はステップS111の代
わりに行われる処理である。N角形を3角形に分割して
考え、分割されたあとの各3角形のポリゴンにおいて、
2つの頂点を結ぶ辺上での交点C(n,q)と前記2つ
の頂点とは異なる頂点とを結ぶ線分が通過するボクセル
の識別子を、交差包括ポリゴンリストに追加する。
When the target polygon 1 is an N-sided polygon, it is also possible to divide the N-sided polygon into triangles and then perform the processing from step S113. In this case, the process of dividing the N-sided polygon into triangles is a process performed instead of step S111. Consider dividing the N polygon into triangles, and in each triangular polygon after division,
An identifier of a voxel passing through a line segment connecting the intersection C (n, q) on the side connecting the two vertices and a vertex different from the two vertices is added to the intersection comprehensive polygon list.

【0029】<第2の実施の形態>図2は、本発明の画
像データ処理方法に係る第2の実施の形態を説明するフ
ローチャートである。
<Second Embodiment> FIG. 2 is a flowchart for explaining a second embodiment according to the image data processing method of the present invention.

【0030】頂点における輝度計算を行う場合、まずス
テップS201において、対象とするポリゴン11の各
頂点から光源13へのベクトルを算出する。次にステッ
プS203において、S201で算出したベクトルと画
像を構成する周囲のポリゴンとの交差判定を行う。これ
は、図6に示すように、光源13と対象とするポリゴン
11の各頂点との間に別のポリゴンがあるかどうかを求
めるものである。ステップS203でベクトルと交差す
るポリゴン15a、bがあると判定された場合、交差す
る周囲のポリゴン15a、bの光透過率に応じた強さの
光がその頂点に達すると考えるシャドーフィーラー法を
用いて、ステップS205において、各頂点での光源1
3から光の強さを式(2)により算出する。
When calculating the brightness at the vertices, first, in step S201, a vector from each vertex of the target polygon 11 to the light source 13 is calculated. Next, in step S203, an intersection between the vector calculated in S201 and surrounding polygons constituting the image is determined. This is to determine whether there is another polygon between the light source 13 and each vertex of the target polygon 11, as shown in FIG. If it is determined in step S203 that there is a polygon 15a, b that intersects the vector, a shadow feeler method is used that considers that light having an intensity corresponding to the light transmittance of the surrounding polygon 15a, b reaches the vertex. In step S205, the light source 1 at each vertex
The light intensity is calculated from Equation (3) according to Equation (2).

【0031】 ポリゴンの頂点に到達する光の強さ =光源の光の強さ×{P1×P2×…×Pn×…×PN} (2) ただし、Pnは光源からの光がn番目に交差するポリゴ
ン15の光透過率である。上の式(2)はN個のポリゴ
ンと交差した場合を表している。なお、各ポリゴンの光
透過率は各ポリゴン固有のデータとして、事前に与えら
れている。また、ステップS203で交差しないと判定
された場合は、頂点における光の強さは光源の光の強さ
に等しいとみなす。また、(2)の式を用いて頂点にお
ける光の強さを算出する際に、各頂点と光源との距離に
応じて、光の減衰を考慮してもよい。
Light intensity reaching the apex of the polygon = light intensity of light source × {P 1 × P 2 ×... × P n ×... × P N } (2) where P n is light from the light source Is the light transmittance of the polygon 15 that intersects nth. The above equation (2) represents a case where the polygon intersects with N polygons. The light transmittance of each polygon is given in advance as data unique to each polygon. If it is determined in step S203 that they do not intersect, it is considered that the light intensity at the vertex is equal to the light intensity of the light source. When calculating the light intensity at the vertices using the equation (2), the light attenuation may be considered according to the distance between each vertex and the light source.

【0032】図6は、対象とするポリゴン11の頂点と
光源13を結ぶベクトルと交差するポリゴン15a、b
が存在している一実施例を示す模式図である。対象とす
るポリゴン11の1つの頂点V´と光源を結ぶベクトル
上に、透過率P1=aを有するポリゴン15a及び透過
率P2=bを有するポリゴン15bがあるとする。この
場合、光源13から頂点V´に届く光の強さF´は以下
のようになる。 F´=光源の強さ×a×b
FIG. 6 shows polygons 15a and 15b intersecting a vector connecting the vertices of the target polygon 11 and the light source 13.
FIG. 3 is a schematic diagram showing an example in which is present. It is assumed that there is a polygon 15a having a transmittance P 1 = a and a polygon 15b having a transmittance P 2 = b on a vector connecting one vertex V ′ of the target polygon 11 and the light source. In this case, the intensity F 'of light reaching the vertex V' from the light source 13 is as follows. F ′ = light source intensity × a × b

【0033】ステップS205で式(2)により算出さ
れた各頂点における光の強さは、頂点に到達する光源1
3からの入射光の強さである。ステップS207におい
て、求められた光源からの入射光の強さを、拡散反射や
鏡面反射などを計算する輝度計算モデル式に代入するこ
とにより、各頂点での輝度が算出する。さらに、ステッ
プS209において、この算出された頂点輝度を用い
て、グーロシェーディング法による内挿計算を行うこと
により、ポリゴン上の任意の点での輝度を算出すること
が可能となる。
The light intensity at each vertex calculated by the equation (2) in step S205 is equal to the light source 1 reaching the vertex.
3 is the intensity of the incident light. In step S207, the luminance at each vertex is calculated by substituting the obtained intensity of the incident light from the light source into a luminance calculation model formula for calculating diffuse reflection, specular reflection, and the like. Further, in step S209, by performing interpolation calculation by the Gouraud shading method using the calculated vertex luminance, it is possible to calculate the luminance at an arbitrary point on the polygon.

【0034】さらに、Zバッファ法の場合、一般的にポ
リゴンの光透過率を用いた輝度計算は行なわれない。し
たがって、ポリゴンの光透過率が定義されていない簡略
型のデータの場合、ポリゴンの光透過率が全て0であれ
ば透過光の強さは0になり、1つのポリゴンとの交差が
検出できた時点で残りの交差判定が不要となって、処理
時間の短縮が期待できる。
Further, in the case of the Z-buffer method, generally, luminance calculation using the light transmittance of a polygon is not performed. Therefore, in the case of simplified data in which the light transmittance of the polygon is not defined, if the light transmittance of the polygon is all 0, the intensity of the transmitted light is 0, and the intersection with one polygon can be detected. At this point, the remaining intersection determination becomes unnecessary, and a reduction in processing time can be expected.

【0035】[0035]

【発明の効果】以上説明したように本発明によれば、空
間分割法の前処理として行う各ボクセルの交差包括ポリ
ゴンリストの生成において、3DDDAアルゴリズムを
用いて各ポリゴン単位でそのポリゴンをボクセルにより
塗りつぶす作業を行い、ポリゴンの塗りつぶしに用いた
ボクセルはポリゴンと交差している、または包括してい
ると判定し、ポリゴンの塗りつぶしに用いたボクセルの
交差包括ポリゴンリストにそのポリゴンの識別子を追加
するので、従来のようなポリゴンを含まない空ボクセル
に対する無駄な交差包括判定が不要となり、処理時間を
短縮することができる。また本発明によれば、各ボクセ
ルの交差包括ポリゴンリストの生成において、空間分割
法の光線追跡の際に行う光線の通過ボクセル判定におい
ても必要とされている3DDDAアルゴリズム処理機能
を用いるので、ハードウェアの規模増大を回避できる。
As described above, according to the present invention, in the generation of the intersection comprehensive polygon list of each voxel to be performed as preprocessing of the space division method, the polygon is filled with the voxel for each polygon using the 3DDDA algorithm. Perform the work, determine that the voxel used for filling the polygon intersects or is inclusive with the polygon, and add the identifier of the polygon to the intersection inclusion polygon list of the voxel used for filling the polygon, It is not necessary to perform useless intersection comprehensive determination for an empty voxel that does not include a polygon as in the related art, and the processing time can be reduced. Also, according to the present invention, in generating the intersection comprehensive polygon list of each voxel, the 3DDDA algorithm processing function which is also required in the ray passing voxel determination performed at the time of ray tracing by the space division method is used. Increase in size can be avoided.

【0036】また、以上説明したように本発明によれ
ば、Zバッファ法において、シャドーフィーラー法によ
り求めた光源からの光を遮る物体の光透過率を考慮して
頂点の輝度を算出し、さらにグーロシェーディング法を
用いて頂点の輝度を内挿計算してポリゴン上の点の輝度
を算出するので、従来のシャドーフィーラー法と比較し
て処理時間を短縮することができ、従来のグーロシェー
ディング法と比較して精度の高い輝度計算を行うことが
できる。
As described above, according to the present invention, in the Z-buffer method, the vertex luminance is calculated in consideration of the light transmittance of an object that blocks light from the light source obtained by the shadow feeler method. Since the brightness of vertices is interpolated using the Gouraud shading method to calculate the brightness of points on the polygon, the processing time can be reduced compared to the conventional shadow feeler method, and the conventional Gouraud shading The luminance calculation can be performed with higher precision than the method.

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

【図1】本発明の画像データ処理方法に係る第1の実施
の形態を説明するフローチャートである。
FIG. 1 is a flowchart illustrating a first embodiment of an image data processing method according to the present invention.

【図2】本発明の画像データ処理方法に係る第2の実施
の形態を説明するフローチャートである。
FIG. 2 is a flowchart illustrating a second embodiment of the image data processing method according to the present invention.

【図3】ボクセルにより分割された空間にあるポリゴン
を示す模式図である。
FIG. 3 is a schematic diagram showing polygons in a space divided by voxels.

【図4】DDAにより生成されたデジタル直線及び線分
描画により生成されたデジタル直線を示す模式図であ
る。
FIG. 4 is a schematic diagram showing a digital straight line generated by DDA and a digital straight line generated by line segment drawing.

【図5】線分L(n,n+1)とボクセル3の境界との
交点C(n,q)を示す模式図である。
FIG. 5 is a schematic diagram showing an intersection C (n, q) between a line segment L (n, n + 1) and a boundary of a voxel 3;

【図6】対象とするポリゴンの頂点と光源を結ぶベクト
ル上にポリゴンが存在している一実施例を示す模式図で
ある。
FIG. 6 is a schematic diagram showing an embodiment in which a polygon exists on a vector connecting a vertex of a target polygon and a light source.

【符号の説明】 1、11 対象とするポリゴン 3 ボクセル 5 デジタル直線を構成するボクセル 13 光源 15 対象とするポリゴン11の各頂点から光源13へ
のベクトルと交差するポリゴン
[Description of Signs] 1, 11 Target polygon 3 Voxel 5 Voxel constituting digital straight line 13 Light source 15 Polygon that intersects vector from each vertex of target polygon 11 to light source 13

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 ポリゴンにより近似された物体を内包す
る空間を複数のボクセルに分割するステップと、 対象とするポリゴンを構成する各辺に関して、前記複数
のボクセルで構成されるデジタル直線を3DDDAによ
り生成するステップと、 前記複数のボクセルの境界と前記各辺との交点を求める
ステップと、 前記デジタル直線を構成するボクセルが有する交差包括
ポリゴンリストに、前記対象とするポリゴンの識別子を
追加するステップと、 前記対象とするポリゴンの頂点を1点、任意に選択する
ステップと、 選択された頂点と前記交点とを結ぶ線分に関して、前記
複数のボクセルで構成される新たなデジタル直線を3D
DDAにより生成するステップと、 前記新たなデジタル直線を構成するボクセルが有する交
差包括ポリゴンリストに前記識別子を追加するステップ
とを、 有する画像データ処理方法。
1. A step of dividing a space containing an object approximated by a polygon into a plurality of voxels, and generating a digital straight line constituted by the plurality of voxels by 3DDDA for each side constituting a target polygon. Determining the intersection of the boundary of each of the plurality of voxels and each of the sides, and adding the identifier of the target polygon to the intersection comprehensive polygon list of the voxels constituting the digital straight line, Arbitrarily selecting one vertex of the target polygon; and, regarding a line segment connecting the selected vertex and the intersection, a new digital straight line composed of the plurality of voxels is created in 3D.
An image data processing method, comprising: generating by the DDA; and adding the identifier to the intersection comprehensive polygon list included in the voxels constituting the new digital straight line.
【請求項2】 ポリゴンにより近似された物体のうち、
対象とするポリゴンの各頂点と光源とのベクトルを算出
するステップと、 前記ベクトルと周囲のポリゴンとの交差判定を行うステ
ップと、 交差すると判定されたポリゴンの光透過率に応じて、前
記各頂点に達する前記光源からの光の強さを算出するス
テップと、 前記光の強さを基にして、前記各頂点の輝度を算出する
ステップと、 前記各頂点での輝度を内挿計算することにより、前記対
象とするポリゴン内部の点での輝度を算出するステップ
とを、 有する画像データ処理方法。
2. An object approximated by a polygon,
Calculating a vector between each vertex of the target polygon and the light source; determining an intersection between the vector and a surrounding polygon; and determining each of the vertices according to the light transmittance of the polygon determined to intersect. Calculating the intensity of the light from the light source that reaches, and calculating the luminance of each vertex based on the intensity of the light, by interpolating the luminance at each vertex. Calculating the luminance at a point inside the target polygon.
JP27002899A 1999-09-24 1999-09-24 Image data processing method Withdrawn JP2001092987A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27002899A JP2001092987A (en) 1999-09-24 1999-09-24 Image data processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27002899A JP2001092987A (en) 1999-09-24 1999-09-24 Image data processing method

Publications (1)

Publication Number Publication Date
JP2001092987A true JP2001092987A (en) 2001-04-06

Family

ID=17480537

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27002899A Withdrawn JP2001092987A (en) 1999-09-24 1999-09-24 Image data processing method

Country Status (1)

Country Link
JP (1) JP2001092987A (en)

Similar Documents

Publication Publication Date Title
CN111508052B (en) Rendering method and device of three-dimensional grid body
AU2014363213B2 (en) Image rendering of laser scan data
JP4643271B2 (en) Visible surface determination system and method for computer graphics using interval analysis
JP2669599B2 (en) Shadow drawing method and three-dimensional graphic computer system
US9251622B2 (en) System and method for calculating multi-resolution dynamic ambient occlusion
Schütz et al. Real-time continuous level of detail rendering of point clouds
US9508191B2 (en) Optimal point density using camera proximity for point-based global illumination
CN110706325B (en) Real-time dynamic rendering method and system for three-dimensional submarine environment
US9811944B2 (en) Method for visualizing freeform surfaces by means of ray tracing
RU2680355C1 (en) Method and system of removing invisible surfaces of a three-dimensional scene
JP4584956B2 (en) Graphics processor and drawing processing method
CN109934893A (en) Display methods, device and the electronic equipment of solid arbitrary section
KR101118597B1 (en) Method and System for Rendering Mobile Computer Graphic
US20230274493A1 (en) Direct volume rendering apparatus
US20180005432A1 (en) Shading Using Multiple Texture Maps
JP2001092987A (en) Image data processing method
CN117333598B (en) 3D model rendering system and method based on digital scene
US6831636B1 (en) System and process for level of detail selection based on approximate visibility estimation
JP2952585B1 (en) Image generation method
JP3867071B2 (en) Image processing apparatus and image processing method
Swan et al. Slice-based volume rendering
JPH06168340A (en) 3d graphic display device
JPH04155592A (en) Parametric curved surface display device by glow shading
JP2019121193A (en) Program, recording medium, and shade drawing method
und Algorithmen et al. Shadow Mapping of Large Environments

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20061205