JP2002008059A - Data processing device - Google Patents

Data processing device

Info

Publication number
JP2002008059A
JP2002008059A JP2000194936A JP2000194936A JP2002008059A JP 2002008059 A JP2002008059 A JP 2002008059A JP 2000194936 A JP2000194936 A JP 2000194936A JP 2000194936 A JP2000194936 A JP 2000194936A JP 2002008059 A JP2002008059 A JP 2002008059A
Authority
JP
Japan
Prior art keywords
perspective
coordinate
perspective transformation
processing
reference point
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
JP2000194936A
Other languages
Japanese (ja)
Inventor
Toshiyuki Ogawa
敏行 小川
Masahiro Uminaga
正博 海永
Koshi Yamada
孔司 山田
Yasuhiko Saito
靖彦 斎藤
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2000194936A priority Critical patent/JP2002008059A/en
Publication of JP2002008059A publication Critical patent/JP2002008059A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To perform a perspective conversion at a high speed by approximation of division by a lower cost arithmetic. SOLUTION: As the perspective projection converting processing for projecting aggregation of plural vertexes (Xi, Yi, Zi) of a three dimensional shape onto an XY perspective plane surface, a first processing for setting reference points (Xc, Yc, Zc) of the aggregation of the vertexes, a second processing for computing a difference (dZi) between a Z-coordinate (Zc) of the reference point and a Z-coordinate (Zi) of the vertex, and a third processing for computing a perspective x-coordinate (SXi) and a perspective Y-coordinate (SYi) corresponding to the X-coordinate and the Y-coordinate of the vertex with an approximate formula using the difference (dXi) and a perspective Z-coordinate (SZ) on the XY perspective plane surface in relation to the Z-coordinate of the reference point, are carried out. The approximate formula uses a formula that a progression obtained by expanding the Maclaurin's series related to a differential function f(dZ)=1/(Z+dZ) is cut at an absolute term and a primary term.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、3次元グラフィッ
クス処理に関する透視変換(射影変換)に関し、特に微
細な画像に対する処理に適用して有効な技術に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to perspective transformation (projection transformation) relating to three-dimensional graphics processing, and more particularly to a technique effective when applied to processing of fine images.

【0002】[0002]

【従来の技術】3次元グラフィックス分野では3次元物
体をポリゴンと呼ばれる一種の多角形の集まりで表現
し、それらに対して画像処理を適用する。ポリゴンを対
象とした画像処理の参考文献としては、Addison
Wesley社から1982年に出版された文献
「(J.D.Foley & A.Van Dam著)
Fundamentals of Interacti
ve Computer Graphics」がある。
2. Description of the Related Art In the field of three-dimensional graphics, three-dimensional objects are represented by a group of polygons called polygons, and image processing is applied to them. For reference on image processing for polygons, see Addison
A document published in 1982 by Wesley, Inc. (by JD Foley & A. Van Dam)
Fundamentals of Interacti
ve Computer Graphics ".

【0003】ポリゴンで表現された物体を高精細且つ滑
らかに表現する方式としては物体を構成するポリゴンを
より細かくし、必要なポリゴン数を増やすということが
考えられる。しかし、ポリゴン数を増やすことにより、
演算量が増大する。
As a method of expressing an object represented by polygons with high definition and smoothness, it is conceivable to make the polygons constituting the object finer and increase the number of necessary polygons. However, by increasing the number of polygons,
The amount of calculation increases.

【0004】特に本発明者は、除算を必要とする3次元
グラフィックス処理における透視変換の演算量について
検討した。3次元グラフィックス処理の透視変換では、
コンピュータグラフィックス講義(青木 由直著 コロ
ナ社)の第113ページ等に記載されるように、ワール
ド座標系である3次元空間内の頂点を透視座標(スクリ
ーン座標)系である2次元空間へ投影する処理を行う。
この透視変換では、 SXi=Xi*SZ/Zi SYi==Yi*SZ/ZI という幾何学的な演算を行えばよい。ここで、(Xi,
Yi,Zi)は変換対象の頂点座標、(SXi,SY
i)は変換後の座標、SZは透視座標系である透視平面
(スクリーン平面)のZ座標である。透視変換では、3
次元オブジェクトの全ての頂点に対して上記演算を施
し、3次元物体を2次元のスクリーン平面へ投影する。
[0004] In particular, the present inventors have studied the amount of operation of perspective transformation in three-dimensional graphics processing requiring division. In perspective transformation of three-dimensional graphics processing,
As described on page 113 of the Computer Graphics Lecture (Yonao Aoki, Corona), vertices in a three-dimensional space that is a world coordinate system are projected onto a two-dimensional space that is a perspective coordinate (screen coordinate) system. Perform the following processing.
In this perspective transformation, a geometric operation of SXi = Xi * SZ / Zi SYi == Yi * SZ / ZI may be performed. Where (Xi,
(Yi, Zi) is the vertex coordinates to be converted, and (SXi, SY)
i) is the coordinate after conversion, and SZ is the Z coordinate of a perspective plane (screen plane) which is a perspective coordinate system. In perspective transformation, 3
The above operation is performed on all vertices of the three-dimensional object, and the three-dimensional object is projected on a two-dimensional screen plane.

【0005】[0005]

【発明が解決しようとする課題】透視変換では、上記演
算式より明らかなように、頂点毎に毎回除算を行わなけ
ればならない。一般に、加算や乗算に比べ、除算は多く
の演算サイクル数を要する。要するに、プロセッサなど
のデータ処理装置にとって演算コストが高い。即ち、上
記透視変換方法では、各頂点毎に、除算1回、乗算2回
の演算が必要である。そして、透視面に対してオブジェ
クトが遠くにあって、透視変換にはそれほど精度が要求
されない場合でも、上記同様に、除算1回、乗算2回に
よる透視変換で正確な処理を行っていた。
In the perspective transformation, division must be performed for each vertex every time, as is apparent from the above equation. In general, division requires a larger number of operation cycles than addition and multiplication. In short, the calculation cost is high for a data processing device such as a processor. That is, in the above perspective transformation method, one division and two multiplications are required for each vertex. Even when the object is far from the perspective plane and the precision is not so much required for the perspective transformation, accurate processing is performed by the perspective transformation by one division and two multiplications as described above.

【0006】本発明の目的は、除算をより演算コストの
低い演算により近似することで透視変換を高速化するこ
とにある。
An object of the present invention is to speed up perspective transformation by approximating division by an operation having a lower operation cost.

【0007】本発明の別の目的は、透視変換における処
理を高速化することによってグラフィックス処理全体を
高速化することにある。
Another object of the present invention is to speed up the entire graphics processing by speeding up the processing in the perspective transformation.

【0008】本発明の他の目的は、グラフィックス処理
の演算コストの低減を行うことにより高速なグラフィッ
クス処理装置を提供することにある。
Another object of the present invention is to provide a high-speed graphics processing apparatus by reducing the operation cost of graphics processing.

【0009】本発明の前記並びにその他の目的と新規な
特徴は本明細書の記述及び添付図面から明らかになるで
あろう。
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

【0010】[0010]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。
The following is a brief description of an outline of a typical invention among the inventions disclosed in the present application.

【0011】〔1〕本発明に係るデータ処理装置は、3
次元形状を構成する複数の頂点(Xi,Yi,Zi)の
集合をXY透視平面に投影する3次元グラフィックスの
透視変換処理が可能な演算制御手段を有する。前記演算
制御手段は、透視変換処理として、前記頂点の集合に基
準点(Xc,Yc,Zc)を設定する第1処理と、前記
基準点のZ座標(Zc)と前記頂点のZ座標(Zi)と
の差分(dZi)を演算する第2処理と、前記基準点の
Z座標(Zc)、前記差分(dZi)及び前記基準点の
Z座標(Zc)に対するXY透視平面上の透視Z座標
(SZ)を用いた近似式により、頂点のX座標及びY座
標に対応する透視X座標(SXi)及び透視Y座標(S
Yi)を演算する第3処理とを行うものである。
[1] The data processing device according to the present invention
An arithmetic control unit capable of performing perspective transformation processing of three-dimensional graphics for projecting a set of a plurality of vertices (Xi, Yi, Zi) constituting a dimensional shape onto an XY perspective plane. The arithmetic control means includes a first process of setting a reference point (Xc, Yc, Zc) in the set of vertices as a perspective transformation process, a Z coordinate (Zc) of the reference point, and a Z coordinate (Zi) of the vertex. ), And a Z coordinate (Zc) of the reference point, a perspective Z coordinate (XY) on the XY perspective plane with respect to the difference (dZi) and a Z coordinate (Zc) of the reference point. SZ), a perspective X coordinate (SXi) and a perspective Y coordinate (S
Yi) and a third process for calculating Yi).

【0012】前記近似式は、例えば微分可能関数f(d
Z)=1/(Z+dZ)に関するマクローリン級数展開
による級数を定数項と1次の項で打ち切った計算式を適
用したものである。
The approximate expression is, for example, a differentiable function f (d
This is obtained by applying a calculation formula obtained by terminating a series obtained by expanding a macro-Lin series regarding Z) = 1 / (Z + dZ) with a constant term and a first-order term.

【0013】上記より、グラフィックス処理において演
算コストのかかる透視変換において近似計算を用いてい
るので演算コストが低減される。また、透視変換におけ
る演算コストが低減されることによりグラフィックス処
理全体の演算速度を向上させることができる。
As described above, the approximation calculation is used in the perspective transformation which requires the computation cost in the graphics processing, so that the computation cost is reduced. In addition, since the calculation cost in the perspective transformation is reduced, the calculation speed of the entire graphics processing can be improved.

【0014】〔2〕上記透視変換の近似計算による誤差
は、頂点が基準点に近いほど少ない。これを考慮して、
画質の劣化を未然に防止するには、前記透視変換処理に
おいて前記演算制御手段は、頂点の座標と基準点の座標
との差分が既定値よりも小さいか否かを判定する第4処
理を行い、その判定結果が小さいとき前記近似計算によ
る前記第3処理を行い、前記第4処理による判定結果が
大きいときは前記第3処理に代えて幾何学の相似の関係
を用いた除算による透視変換を行って透視X座標(SX
i)及び透視Y座標(SYi)を演算する第5処理を行
うとよい。
[2] The error due to the approximate calculation of the perspective transformation is smaller as the vertex is closer to the reference point. With this in mind,
In order to prevent the image quality from deteriorating, in the perspective transformation process, the arithmetic control unit performs a fourth process of determining whether a difference between the coordinates of the vertex and the coordinates of the reference point is smaller than a predetermined value. When the determination result is small, the third processing by the approximation calculation is performed, and when the determination result by the fourth processing is large, the perspective transformation by division using the similarity of the geometry is performed instead of the third processing. Go to perspective X coordinate (SX
i) and a fifth process of calculating the perspective Y coordinate (SYi) may be performed.

【0015】〔3〕透視面にオブジェクトが近付くほど
透視変換には高い精度が要求される。したがって、透視
変換の精度は、透視変換の透視面から基準点までの距離
に相関がある。この観点より、画質の劣化を未然に防止
するには、前記透視変換処理において前記演算制御手段
は、透視変換の透視面から基準点までの距離が既定値よ
りも大きいか否かを判定する第6処理を行い、前記第6
処理による判定結果が大きいとき前記近似計算による前
記第3処理を行い、前記第6処理による判定結果が小さ
いときは前記第3処理に代えて、幾何学の相似の関係を
用いた除算による透視変換を行って透視X座標(SX
i)及び透視Y座標(SYi)を演算する第7処理を行
うとよい。
[3] Higher precision is required for perspective transformation as the object approaches the perspective plane. Therefore, the accuracy of the perspective transformation has a correlation with the distance from the perspective plane of the perspective transformation to the reference point. From this viewpoint, in order to prevent the deterioration of the image quality, in the perspective transformation processing, the arithmetic control unit determines whether or not the distance from the perspective plane of the perspective transformation to the reference point is larger than a predetermined value. 6 processing, the sixth
When the determination result by the processing is large, the third processing by the approximation calculation is performed, and when the determination result by the sixth processing is small, the perspective transformation by division using a similarity of geometrics instead of the third processing To perform the perspective X coordinate (SX
i) and a seventh process of calculating the perspective Y coordinate (SYi) may be performed.

【0016】〔4〕また、上記透視変換の近似計算によ
る誤差を正規の演算結果と直接比較して判断してもよ
い。この観点より、画質の劣化を未然に防止するには、
前記透視変換処理において前記演算制御手段は、前記3
次元オブジェクトを構成する複数の頂点の内の代表頂点
に対して、前記近似計算による前記第3処理を行って透
視座標を演算すると共に、幾何学の相似の関係を用いた
除算による透視変換を行って透視座標を演算する第8処
理と、第8処理によって得られた双方の演算結果の誤差
の大きさを判定する第9処理と、第9処理による誤差が
既定値以下の場合には残りの頂点に対し、前記近似計算
による前記第3処理を行い、判定結果が既定値よりも大
きい場合には残りの頂点に対し、前記第3処理に代えて
幾何学の相似の関係を用いた除算による透視変換を行っ
て透視X座標(SXi)及び透視Y座標(SYi)を演
算する第10処理を行うとよい。
[4] Further, the error caused by the approximate calculation of the perspective transformation may be directly compared with a normal calculation result to make the determination. From this point of view, in order to prevent image quality deterioration,
In the perspective transformation processing, the arithmetic control means
For the representative vertex of the plurality of vertices constituting the dimensional object, the third processing by the approximation calculation is performed to calculate the perspective coordinates, and the perspective transformation is performed by the division using the similarity of the geometry. An eighth process for calculating the perspective coordinates by using the second process, a ninth process for determining the magnitude of the error between the two calculation results obtained by the eighth process, and the remaining The third processing by the approximation calculation is performed on the vertices, and when the determination result is larger than a predetermined value, the remaining vertices are divided by a division using a similarity of geometry instead of the third processing. It is preferable to perform a tenth process of calculating perspective X coordinates (SXi) and perspective Y coordinates (SYi) by performing perspective transformation.

【0017】[0017]

【発明の実施の形態】《近似式を用いた透視変換の原
理》図3には3次元画像を構成する頂点集合の一例を示
す。ここでは3角形の集合により3次元空間内の物体表
面を擬似的に表す。このような三角形をポリゴンと呼
ぶ。図3では3つの頂点P1、P2、P3を持つポリゴ
ンをポリゴンP1P2P3と表記することにすれば、図
3はポリゴンP1P2P3、ポリゴンP2P3P4、ポ
リゴンP3P4P5をもつ物体表面を表している。この
ような幾何情報は頂点の並びP1、P2、P3、P4、
P5をこの順番で与えることにより表現できる。すなわ
ち最初の2つの頂点P1、P2は例外として、次の頂点
P3にポリゴンP1P2P3を対応させ、次の頂点P4
と直前のポリゴンを構成する頂点のうち、順番の新しい
2つ、すなわち頂点P2,P3とによりポリゴンP2P
3P4が表現できる。同様に次の頂点P5によりポリゴ
ンP3P4P5が表現される。このように頂点を1つ加
える毎に新しいポリゴンを構成するデータ表現をストリ
ップ表現と呼ぶ。各頂点の位置はその3次元座標、すな
わちX座標値、Y座標値,Z座標値で確定する。各座標
値は浮動小数点数で表現されるものとする。例えば、頂
点P1のX座標値、Y座標値,Z座標値はそれぞれX
1,Y1,Z1で表し、各座標値は浮動小数点数とす
る。各頂点は、さらに3次元座標値以外にも、色属性
や、法線ベクトル情報等の属性データも持っている。
DESCRIPTION OF THE PREFERRED EMBODIMENTS <Principle of Perspective Transformation Using Approximation Formula> FIG. 3 shows an example of a set of vertices forming a three-dimensional image. Here, an object surface in a three-dimensional space is simulated by a set of triangles. Such a triangle is called a polygon. In FIG. 3, if a polygon having three vertices P1, P2, and P3 is described as a polygon P1P2P3, FIG. 3 shows an object surface having a polygon P1P2P3, a polygon P2P3P4, and a polygon P3P4P5. Such geometric information is obtained by arranging the vertices P1, P2, P3, P4,
It can be expressed by giving P5 in this order. That is, with the exception of the first two vertices P1 and P2, the polygon P1P2P3 corresponds to the next vertex P3, and the next vertex P4
And two new vertices of the immediately preceding polygon, ie, vertices P2 and P3, form a polygon P2P.
3P4 can be expressed. Similarly, the polygon P3P4P5 is represented by the next vertex P5. Such a data expression that constitutes a new polygon each time one vertex is added is called a strip expression. The position of each vertex is determined by its three-dimensional coordinates, that is, the X coordinate value, the Y coordinate value, and the Z coordinate value. Each coordinate value is represented by a floating point number. For example, the X coordinate value, Y coordinate value, and Z coordinate value of vertex P1 are X
1, Y1, Z1 and each coordinate value is a floating point number. Each vertex has attribute data such as color attributes and normal vector information in addition to the three-dimensional coordinate values.

【0018】図3では、例として5つの頂点P1、P
2、P3、P4、P5の集まりを示している。このよう
に予め決められた頂点の集まりをクラスタと呼ぶことに
する。クラスタは複雑な3次元物体を構成する頂点集合
をより単純ないくつかの部分集合に分割したときの頂点
集合を表現するのに使用する。これらクラスタの例とし
ては、剛体的な特性、すなわち空間内の移動でその形を
変えないような特性をもつ物体(オブジェクト)を構成
する頂点の集まりなどがある。
In FIG. 3, five vertices P1, P
2, P3, P4, and P5 are shown. The set of vertices determined in advance in this way is called a cluster. A cluster is used to represent a vertex set when a vertex set constituting a complex three-dimensional object is divided into some simpler subsets. Examples of these clusters include a collection of vertices forming an object having a rigid characteristic, that is, a characteristic that does not change its shape due to movement in space.

【0019】図1は3次元空間をZ軸に垂直な方向から
見た図である。点Pcと原点とを結ぶ直線と2次元透視
平面(XY透視平面)10との交点をWcで表す。この
ように点Pcと座標原点を結ぶ直線と透視平面10との
交点Wcを求めることを透視変換といい、Wcを透視点
(透視座標)と呼ぶことにする。
FIG. 1 is a view of a three-dimensional space viewed from a direction perpendicular to the Z axis. The intersection of a straight line connecting the point Pc and the origin and a two-dimensional perspective plane (XY perspective plane) 10 is represented by Wc. Obtaining the intersection Wc between the line connecting the point Pc and the coordinate origin and the perspective plane 10 in this way is called perspective transformation, and Wc is called the perspective point (perspective coordinate).

【0020】透視点WcのX,Y,Z座標値をそれぞ
れ、SXc,SYc,SZと表す。2次元透視平面10
上の点の座標値は方程式「Z=SZ」を満たす平面なの
で、この平面上の点のZ座標値は常にSZである。Wc
のX、Y座標値SXc,SYcは幾何学の相似の関係よ
り、図2の式3および式4で計算できる。ここで式3お
よび式4に含まれる値Zf1は式1により計算される。
すなわち、透視点の座標値を計算するには、除算が1回
と、乗算が2回あれば十分である。
The X, Y, and Z coordinate values of the transparent viewpoint Wc are represented as SXc, SYc, and SZ, respectively. 2D perspective plane 10
Since the coordinate value of the upper point is a plane satisfying the equation “Z = SZ”, the Z coordinate value of the point on this plane is always SZ. Wc
The X and Y coordinate values SXc and SYc can be calculated by equations 3 and 4 in FIG. Here, the value Zf1 included in Expressions 3 and 4 is calculated by Expression 1.
That is, in order to calculate the coordinate values of the perspective viewpoint, one division and two multiplications are sufficient.

【0021】このとき、点Piが点Pcの十分近くにあ
れば、換言すれば点Piから点Pcに至るベクタが小さ
ければ、点Piの透視点WiのX座標値SXi、Y座標
値SYiを除算を使用しない近似式で計算できる。この
近似式とは、数学の分野での微分可能関数「1/z」を
zの近くで「マクローリン級数展開」した級数、換言す
れば関数F(dZ)=1/(Z+dZ)のマクローリン
級数(図2の式10)を、定数項と1次の項で打ち切っ
て得られる式を適用たものである。要するに、図2の式
11のようにSZ/{Zc+(Zi−Zc)}に対して
定数項と1次の項で打ち切ったマクローリン級数展開を
施す。これにより、図1の点Piが充分点Pcに近けれ
ば、点Piの透視点WiのX、Y座標値はそれぞれ、図
2の式5及び式6のSXi,SYiで近似できる。前記
(Zi−Zc)は点Pcから点Piへ向かう相対ベクト
ルのZ成分dZiである。
At this time, if the point Pi is sufficiently close to the point Pc, in other words, if the vector from the point Pi to the point Pc is small, the X coordinate value SXi and the Y coordinate value SYi of the perspective point Wi of the point Pi are calculated. It can be calculated with an approximate expression that does not use division. This approximate expression is a series obtained by “macrolin series expansion” of a differentiable function “1 / z” in the field of mathematics near z, in other words, a macrolein series of a function F (dZ) = 1 / (Z + dZ) ( This is obtained by applying an expression obtained by truncating Expression 10) in FIG. 2 with a constant term and a first-order term. In short, as shown in Equation 11 in FIG. 2, SZ / {Zc + (Zi−Zc)} is subjected to a macrolein series expansion truncated by a constant term and a first-order term. Thus, if the point Pi in FIG. 1 is sufficiently close to the point Pc, the X and Y coordinate values of the perspective point Wi of the point Pi can be approximated by SXi and SYi in Expressions 5 and 6 in FIG. (Zi-Zc) is the Z component dZi of the relative vector from the point Pc to the point Pi.

【0022】ここで、図2における式5及び式6に含ま
れる値Zf1、Zf2については図2の式1及び式2に
より予め計算しておき、式5及び式6において値「Zf
1−Zf2*(Zi−Zc)」も一度計算された値を再
利用するものとすれば、透視点の座標値の近似計算に
は、毎回除算は不要になり、毎回の乗算回数も減らすこ
とができる(ここで記号「*」は乗算を表すとする)。
プロセッサによる除算に必要な演算サイクル数が乗算や
加算に比べて大幅に大きいとき、上記のような近似計算
を点Pcの十分近くに存在する透視変換対象点Piに対
して適用することにより全体の演算処理時間が短縮され
る。例えば、浮動小数点データの除算に15サイクルか
かり、浮動小数点データの乗算と加算にそれぞれ2サイ
クル掛かるとすれば、近似計算しない場合、除算が1
回、乗算が2回、加算が2回で合計、23サイクルかか
る。一方、近似計算すれば、例えば乗算が3回と加算が
3回で合計12サイクルで済む。
Here, the values Zf1 and Zf2 included in Equations 5 and 6 in FIG. 2 are calculated in advance by Equations 1 and 2 in FIG.
If 1-Zf2 * (Zi-Zc) is also a value once calculated, the division is not required each time in the approximate calculation of the coordinate values of the perspective point, and the number of times of multiplication is reduced each time. (Where the symbol “*” represents multiplication).
When the number of operation cycles required for division by the processor is much larger than multiplication or addition, the above-described approximation calculation is applied to the perspective transformation target point Pi sufficiently close to the point Pc to obtain the entirety. The calculation processing time is reduced. For example, if the division of floating-point data takes 15 cycles and the multiplication and addition of floating-point data take 2 cycles each, if approximation calculation is not performed, the division becomes 1
Times, multiplication twice and addition twice, a total of 23 cycles. On the other hand, if the approximate calculation is performed, for example, three multiplications and three additions are required, for a total of 12 cycles.

【0023】このような近似計算の前提は、点Piが点
Pcの十分近くにあること、更に直接的に述べれば、点
Pcから点Piへ向かう相対ベクトルのZ成分dZi
(=Zi−Zc)が小さいことである。そこで、図3の
ようなクラスタの頂点の集合に対して、各頂点から比較
的近い位置に図1で説明した前記点Pcのような基準点
を設定し、これを用いることによって、透視変換に図1
で説明した近似計算を採用する。基準点として、例えば
クラスタの頂点の集合によって規定される形状の重心点
又は当該重心点に最も近い一つの頂点を採用することが
できる。
The premise of such an approximate calculation is that the point Pi is sufficiently close to the point Pc. More directly, the Z component dZi of the relative vector from the point Pc to the point Pi is obtained.
(= Zi−Zc) is small. Therefore, for a set of vertices of the cluster as shown in FIG. 3, a reference point such as the point Pc described with reference to FIG. 1 is set at a position relatively close to each vertex, and this is used for perspective transformation. FIG.
The approximation calculation described in is adopted. As the reference point, for example, a center of gravity of a shape defined by a set of vertices of a cluster or one vertex closest to the center of gravity can be adopted.

【0024】《グラフィックプロセッサ》上記近似式を
用いた透視変換の原理を適用したグラフィックプロセッ
サ及びその処理手順の具体例を説明する。
<< Graphic Processor >> A graphic processor to which the principle of perspective transformation using the above approximate expression is applied and a specific example of a processing procedure thereof will be described.

【0025】図4には本発明に係るデータ処理装置の一
例としてグラフィックプロセッサが示される。グラフィ
ックプロセッサ1は、特に制限されないが、CMOS集
積回路製造技術などにより、単結晶シリコンのような1
個の半導体チップ(半導体基板)に形成される。グラフ
ィックプロセッサ1は、演算制御装置2として例えば中
央処理装置(CPU)3及びアクセラレータ4を有す
る。CPU3は、特に図示はしないが、フェッチした命
令を解読して制御信号を生成する命令制御手段と、前記
制御信号を受けて演算処理を行う命令実行手段とを有
し、その動作プログラムに従ってデータ処理を行う。ア
クセラレータ4はCPU3の演算処理負担を軽減し或い
はCPU3では難しい演算処理を実現する為の演算回路
である。3次元グラフィックス処理をサポートするグラ
フィックプロセッサ1において、アクセラレータ4は、
例えば浮動小数点演算可能な浮動小数点演算ユニット、
或いはアフィン変換や透視変換等の処理を行う専用ハー
ドウェアとして構成される。アクセラレータ4で処理さ
れる画像情報はグラフィックスインタフェースバッファ
9を介して図示を省略するフレームバッファなどを有す
る表示制御系に渡すことができるようになっている。
FIG. 4 shows a graphic processor as an example of the data processing apparatus according to the present invention. Although the graphic processor 1 is not particularly limited, the graphic processor 1 may be made of single-crystal silicon by a CMOS integrated circuit manufacturing technique or the like.
It is formed on individual semiconductor chips (semiconductor substrates). The graphic processor 1 has, for example, a central processing unit (CPU) 3 and an accelerator 4 as the arithmetic and control unit 2. Although not specifically shown, the CPU 3 has instruction control means for decoding a fetched instruction to generate a control signal, and instruction execution means for performing arithmetic processing in response to the control signal. I do. The accelerator 4 is an arithmetic circuit for reducing the arithmetic processing load on the CPU 3 or realizing arithmetic processing that is difficult for the CPU 3. In the graphics processor 1 that supports three-dimensional graphics processing, the accelerator 4
For example, a floating-point arithmetic unit capable of floating-point arithmetic,
Alternatively, it is configured as dedicated hardware for performing processing such as affine transformation and perspective transformation. The image information processed by the accelerator 4 can be transferred to a display control system having a frame buffer (not shown) via the graphics interface buffer 9.

【0026】キャッシュユニット5はCPU3が一度利
用した情報(命令、データ)のアドレス近傍に配置され
ているアドレスの情報を一時的に保持する連想メモリ構
造を有する高速メモリである。キャッシュメモリユニッ
ト5によるキャッシュミスなどに応答して外部バスサイ
クルを制御するバスステートコントローラ6が設けら
れ、バスインタフェースバッファ8を介して外部バスを
アクセス制御することができる。バスステートコントロ
ーラ6にはタイマやDMAC(ダイレクト・メモリ・ア
クセス・コントローラ)などの周辺回路7が接続され
る。
The cache unit 5 is a high-speed memory having an associative memory structure for temporarily storing information on addresses (instructions, data) used once by the CPU 3 near addresses of information. A bus state controller 6 for controlling an external bus cycle in response to a cache miss or the like by the cache memory unit 5 is provided, and access to an external bus can be controlled via a bus interface buffer 8. Peripheral circuits 7 such as a timer and a DMAC (Direct Memory Access Controller) are connected to the bus state controller 6.

【0027】前記グラフィックプロセッサ1を用いる3
次元画像処理の対象とされる画像データは、空間内の頂
点の集まりから成り、各頂点は、3次元の座標値、さら
に明るさを示すための頂点法線データ(法線ベクトル)
等の属性データを持っている。グラフィックプロセッサ
1はこれら座標値や属性データに対して前記透視変換、
更にはアフィン変換等の処理を行う。
3 using the graphic processor 1
The image data to be subjected to the three-dimensional image processing is composed of a collection of vertices in space, and each vertex has three-dimensional coordinate values and vertex normal data (normal vector) for indicating brightness.
And other attribute data. The graphic processor 1 performs the perspective transformation on these coordinate values and attribute data,
Further, processing such as affine transformation is performed.

【0028】《透視変換処理》前記近似計算を適用して
透視変換を行うか、または除算による透視変換を行うか
は、3次元オブジェクトに応じて任意に決定でき、近似
計算を用いるオブジェクトに対しては基準点を設定す
る。これによりスクリーンに近いオブジェクトのように
近似による誤差が大きい場合には、除算による正規の透
視変換を行えばよい。
<< Perspective Transformation Processing >> Whether to perform perspective transformation by applying the above-described approximation calculation or to perform perspective transformation by division can be arbitrarily determined according to a three-dimensional object. Sets the reference point. Thus, when an error due to approximation is large, such as an object close to the screen, normal perspective transformation by division may be performed.

【0029】また、一つのオブジェクトに対して近似計
算を用いる範囲を、基準点に対する近傍の範囲とすれ
ば、近傍の範囲を任意に設定することにより、画像の粗
さなどを設定できる。以下、それらを考慮しながら透視
変換処理の具体例を説明する。
If the range in which the approximation calculation is performed for one object is a range in the vicinity of the reference point, the roughness of the image can be set by arbitrarily setting the range in the vicinity. Hereinafter, a specific example of the perspective transformation processing will be described while considering them.

【0030】図5には前記演算制御装置2で実行される
透視変換処理、特に近似による透視変換処理の手順が示
される。
FIG. 5 shows a procedure of a perspective transformation process executed by the arithmetic and control unit 2, particularly a perspective transformation process by approximation.

【0031】先ず、一つの3次元オブジェクトとしての
一つのクラスタの頂点データを読み込んで、それらクラ
スタの頂点に対して基準点Pc(Xc,Yc,Zc)を
設定する(S1)。基準点は、例えばクラスタの全頂点
によって形成される図形の重心点に最も近い一つの頂点
座標とする。例えば図3に示されるクラスタを想定した
とき、頂点P3を基準点とし、その他の頂点P1,P
2,P4,P5を基準点に対する近傍点とする。要する
に、基準点P3に対してその他の頂点P1,P2,P
4,P5は前記近似計算上誤差が問題にならない程度に
近接している。
First, vertex data of one cluster as one three-dimensional object is read, and a reference point Pc (Xc, Yc, Zc) is set for the vertices of those clusters (S1). The reference point is, for example, one vertex coordinate closest to the center of gravity of the figure formed by all vertices of the cluster. For example, assuming the cluster shown in FIG. 3, the vertex P3 is used as a reference point, and the other vertices P1 and P
2, P4, and P5 are set as points near the reference point. In short, the other vertices P1, P2, P with respect to the reference point P3
4, P5 are so close that errors in the approximation calculation do not matter.

【0032】次に、視点(図1の座標原点)からスクリ
ーン(図1の透視平面10)までの距離SZと、前記基
準点PcのZ座標Zcを用いて、図2の式1、式2に示
される近似係数を求める(ステップS2)。
Next, using the distance SZ from the viewpoint (the coordinate origin in FIG. 1) to the screen (the see-through plane 10 in FIG. 1) and the Z coordinate Zc of the reference point Pc, equations 1 and 2 in FIG. (Step S2).

【0033】処理対象とされる一つのクラスタにはi個
の近傍点が含まれるものとする。先ず、iを“0”に初
期化する(S3)。
It is assumed that one cluster to be processed includes i neighboring points. First, i is initialized to "0" (S3).

【0034】そして、ステップS1で設定された基準点
Pc(Xc,Yc,Zc)のZ座標Zcと当該オブジェ
クトに含まれる頂点のZ座標Ziを用いて、基準点Pc
からの相対Z座標(dZi)を求める(S4)。即ち、
dZi=Zi−Zcを演算する。
Then, using the Z coordinate Zc of the reference point Pc (Xc, Yc, Zc) set in step S1 and the Z coordinate Zi of the vertex included in the object, the reference point Pc
Is obtained (S4). That is,
Calculate dZi = Zi-Zc.

【0035】次に、求められた近似係数と当該頂点のX
座標からスクリーン上のX座標SXiを算出する。すな
わち、SXi=Xi*SZ/Ziに代えて、図2の式5
による近似式にて、SXi≒{Zf1−Zf2*dZ
i}*Xiを演算する(S5)。同様に、前記近似係数
と当該頂点のY座標からスクリーン上のY座標SYi
を、SYi=Yi*SZ/Ziに代えて、図2の式6に
よる近似式にて、SYi≒{Zf1−Zf2*dZi}
*Yiを演算して取得する(S6)。
Next, the obtained approximation coefficient and the X of the vertex
The X coordinate SXi on the screen is calculated from the coordinates. That is, instead of SXi = Xi * SZ / Zi, Equation 5 in FIG.
SXi ≒ {Zf1-Zf2 * dZ
i} * Xi is calculated (S5). Similarly, the Y coordinate SYi on the screen is obtained from the approximation coefficient and the Y coordinate of the vertex.
Is replaced by SYi = Yi * SZ / Zi, and SYi {Zf1-Zf2 * dZi} by an approximate expression of Expression 6 in FIG.
* Yi is calculated and obtained (S6).

【0036】これによって変換対象の頂点Pi(Xi,
Yi,Zi)に対する透視平面上の透視座標(SXi,
SYi)が得られる。以上の処理は、全ての近傍点に対
して行なわれる(S7)。
As a result, the vertex Pi (Xi, Xi,
Yi, Zi), the perspective coordinates (SXi,
SYi) is obtained. The above processing is performed for all neighboring points (S7).

【0037】前記透視変換処理を図4のアクセラレータ
4で行う場合、図6に例示されるように、アクセラレー
タ4は、近似計算を適用した透視変換のために、3次元
オブジェクト基準点Pc(Xc,Yc,Zc)の座標デ
ータ、視点(座標原点)からスクリーンまでの距離SZ
のデータ、及び基準点に対する近傍点を成すポリゴンデ
ータが入力される。アクセラレータ4は、与えられたデ
ータによって前記近似計算による透視変換を行って、透
視変換後データを出力する。
When the perspective transformation process is performed by the accelerator 4 shown in FIG. 4, as shown in FIG. 6, the accelerator 4 performs the three-dimensional object reference point Pc (Xc, Xc, Yc, Zc) coordinate data, distance SZ from viewpoint (coordinate origin) to screen
, And polygon data forming a point near the reference point. The accelerator 4 performs a perspective transformation based on the approximation calculation based on the given data, and outputs data after the perspective transformation.

【0038】《基準点に対する近傍範囲の考慮》上記透
視変換の近似計算による誤差は、頂点が基準点に近いほ
ど少ない。そこで、基準点に対する近傍範囲を設定しそ
の範囲で近似計算を適用することができる。
<< Consideration of Neighboring Range with Reference Point >> The error caused by the approximate calculation of the perspective transformation is smaller as the vertex is closer to the reference point. Therefore, a near range with respect to the reference point can be set, and the approximate calculation can be applied in that range.

【0039】図7には基準点に対する近傍点の範囲であ
る近傍範囲の設定を考慮した透視変換処理が例示され
る。ステップS10において、基準点における近傍の範
囲の値として、(RX,RY,RZ)を設定する。基準
点Pcの座標を(Xc,Yc,Zc)とし、処理対象頂
点の座標をPi(Xi,Yi,Zi)とし、基準点Pc
に対する頂点Piの相対位置座標を(dX,dY,d
Z)とするとき、dX=Xi−Xc、dY=Yi−Y
c、dZ=Zi−Zcを演算する(S11)。その相対
座標に対して、dXi<RX,dYi<RY,dZi<
RZを満足するか否かを判定し(S12)、満足すると
きは、前記近似計算を用いた透視変換を行い(S1
3)、満足しない場合には除算による透視変換を行う
(S14)。
FIG. 7 exemplifies a perspective transformation process in consideration of the setting of a neighboring range which is a range of neighboring points with respect to a reference point. In step S10, (RX, RY, RZ) is set as a value in a range near the reference point. The coordinates of the reference point Pc are (Xc, Yc, Zc), the coordinates of the processing target vertex are Pi (Xi, Yi, Zi), and the reference point Pc
Relative coordinates of the vertex Pi with respect to (dX, dY, d
Z), dX = Xi-Xc, dY = Yi-Y
c, dZ = Zi−Zc are calculated (S11). For the relative coordinates, dXi <RX, dYi <RY, dZi <
It is determined whether or not RZ is satisfied (S12). If so, the perspective transformation using the approximate calculation is performed (S1).
3) If not satisfied, perform perspective transformation by division (S14).

【0040】頂点毎にステップS11,S12を繰り返
すことにより、設定された近傍範囲に対してだけ選択的
に近似計算による透視変換を行うことが可能になる。
尚、クラスタ内の頂点のうち、例えば基準点から最も遠
い頂点Pi(Xi,Yi,Zi)を代表点としてステッ
プS11の相対座標取得及びステップS12の判定を行
い、その判定結果に従って他の全ての頂点に対する処理
を決定することも可能である。
By repeating steps S11 and S12 for each vertex, it becomes possible to selectively perform perspective transformation by approximation calculation only on the set neighborhood range.
Note that among the vertices in the cluster, for example, the vertex Pi (Xi, Yi, Zi) farthest from the reference point is used as a representative point, the relative coordinates are obtained in step S11, and the determination in step S12 is performed. It is also possible to determine the processing for the vertices.

【0041】図8には近傍範囲設定機能を備えて透視変
換を行うアクセラレータの概略ブロック図が示される。
前記ステップS10による近傍範囲の値(RX,RY,
RZ)は例えばCPU3がレジスタ21に設定する。前
記ステップS11による相対位置の算出は相対位置算出
回路20が行う。ステップS12の比較は近傍値比較回
路22で行う。前記ステップS13の近似計算を用いた
透視変換は近時透視変換回路23で行い、ステップS1
4の除算による透視変換は透視変換回路24で行う。透
視変換の演算指示はCPU3から制御信号C1で与えら
れる。セレクタ25はその演算指示C1を、近傍値比較
回路22による比較結果信号S1に応じて、透視変換回
路24又は近似透視変換回路23に選択的に与えて、除
算による透視変換又は近似計算を用いた透視変換を選択
する。
FIG. 8 is a schematic block diagram of an accelerator having a neighborhood range setting function and performing perspective transformation.
The value (RX, RY,
RZ) is set in the register 21 by the CPU 3, for example. The calculation of the relative position in step S11 is performed by the relative position calculation circuit 20. The comparison in step S12 is performed by the neighborhood value comparison circuit 22. The perspective transformation using the approximation calculation in step S13 is performed by the recent perspective transformation circuit 23, and step S1 is performed.
The perspective transformation by division of 4 is performed by the perspective transformation circuit 24. The calculation instruction of the perspective transformation is given from the CPU 3 by the control signal C1. The selector 25 selectively gives the operation instruction C1 to the perspective transformation circuit 24 or the approximate perspective transformation circuit 23 according to the comparison result signal S1 from the neighborhood value comparison circuit 22, and uses the perspective transformation by division or the approximate calculation. Select perspective transformation.

【0042】前記相対位置算出回路20、近傍値比較回
路22、近似透視変換回路23、及び透視変換回路24
は、夫々専用のハードウェアを用いなくても、浮動小数
点演算ユニットを用いて実現可能である。
The relative position calculation circuit 20, neighborhood value comparison circuit 22, approximate perspective conversion circuit 23, and perspective conversion circuit 24
Can be realized by using a floating-point arithmetic unit without using dedicated hardware.

【0043】《透視面に対する基準点位置の考慮》透視
面にオブジェクトが近付くほど透視変換には高い精度が
要求される。したがって、透視変換の精度は、透視変換
の透視面から基準点までの距離に相関がある。この観点
より、基準点に対するZ座標閾値を想定する。即ち、Z
座標閾値とは透視面からの距離と考える事ができる。基
準点がZ座標閾値の範囲にあれば、換言すると、基準点
がZ座標閾値よりも透視面に近ければ、その基準点を持
つクラスタに対して除算を用いた透視変換を行う。逆
に、基準点がZ座標閾値よりも透視面から離れていれ
ば、その基準点を持つクラスタに対して近似計算による
透視変換を行う。
<< Consideration of Reference Point Position on Perspective Surface >> The closer the object is to the perspective surface, the higher the accuracy of perspective transformation is required. Therefore, the accuracy of the perspective transformation has a correlation with the distance from the perspective plane of the perspective transformation to the reference point. From this viewpoint, a Z coordinate threshold for the reference point is assumed. That is, Z
The coordinate threshold can be considered as a distance from the see-through surface. If the reference point is within the range of the Z coordinate threshold, in other words, if the reference point is closer to the perspective plane than the Z coordinate threshold, perspective transformation using division is performed on the cluster having the reference point. Conversely, if the reference point is farther from the perspective than the Z-coordinate threshold, perspective transformation by approximate calculation is performed on the cluster having the reference point.

【0044】図9にはZ座標閾値を考慮したときの透視
変換処理手順が示される。先ず、変換対象オブジェクト
に対してZ座標閾値のデータを設定する(S20)。こ
のZ座標閾値はオブジェクトに対する拡大・縮小率を考
慮して決定する。要するに、拡大したときはZ座標閾値
を比較的大きく設定して、透視面から、より離れた位置
に対して近似計算可能とし、近似計算による誤差が顕在
化され難い状態にする。
FIG. 9 shows a perspective transformation processing procedure when the Z coordinate threshold value is considered. First, Z coordinate threshold data is set for the conversion target object (S20). The Z coordinate threshold value is determined in consideration of the enlargement / reduction ratio of the object. In short, when the image is enlarged, the Z coordinate threshold value is set relatively large so that approximation calculation can be performed at a position further away from the see-through surface, so that an error due to the approximation calculation is unlikely to appear.

【0045】次に、透視変換の透視面から基準点までの
距離(Zc−SZ)がZ座標閾値よりも大きいか否か、
換言すれば、当該基準点がZ座標閾値よりも透視面に近
いか否か、を判定する(S21)。判定結果が大きいと
き(Yes)前記近似計算による透視変換を行い(S2
2)、前記判定結果が小さいときは(No)幾何学の相
似の関係を用いた除算による透視変換を行う(S2
3)。
Next, whether the distance (Zc-SZ) from the perspective plane of the perspective transformation to the reference point is greater than the Z coordinate threshold,
In other words, it is determined whether or not the reference point is closer to the see-through surface than the Z coordinate threshold (S21). When the determination result is large (Yes), the perspective transformation by the approximate calculation is performed (S2).
2) If the result of the determination is small (No), perspective transformation is performed by division using the similarity of the geometry (S2).
3).

【0046】図10にはZ座標閾値設定機能を備えて透
視変換を行うアクセラレータの概略ブロック図が示され
る。Z座標閾値のデータはZ座標閾値変更回路30に設
定される。ここでは、Z座標閾値変更回路30は、CP
U3からZ座標閾値設定データと元のオブジェクトに対
する拡大・縮小率のデータが入力され、拡大・縮小率に
応じて調整されたZ座標閾値が設定される。この設定は
Z座標閾値変更回路30内のレジスタ30Aに対して行
なわれる。透視変換の透視面から基準点までの距離(Z
c−SZ)がZ座標閾値よりも大きいか否かの判定はZ
座標比較回路で行なわれる。その比較結果に応ずる選択
信号S2によって、演算対象となるポリゴンデータが近
似透視変換回路32に供給されるか、除算を用いる透視
変換回路33に供給されるかがセレクタ34で選択され
る。
FIG. 10 is a schematic block diagram of an accelerator having a Z coordinate threshold value setting function and performing perspective transformation. The data of the Z coordinate threshold is set in the Z coordinate threshold changing circuit 30. Here, the Z-coordinate threshold value changing circuit 30 uses the CP
The Z coordinate threshold setting data and the data of the enlargement / reduction ratio for the original object are input from U3, and the Z coordinate threshold adjusted according to the enlargement / reduction ratio is set. This setting is performed for the register 30A in the Z coordinate threshold value changing circuit 30. Distance from perspective plane of perspective transformation to reference point (Z
c-SZ) is greater than the Z coordinate threshold.
This is performed by a coordinate comparison circuit. Based on the selection signal S2 corresponding to the comparison result, the selector 34 selects whether the polygon data to be operated is supplied to the approximate perspective transformation circuit 32 or to the perspective transformation circuit 33 using division.

【0047】尚、図10のように判定結果に応じてポリ
ゴンデータの供給先を制御する制御形態に限定されず、
近似透視変換回路32又は除算を用いる透視変換回路3
3の何れを動作させるかを選択するようにしてよいこと
は言うまでもない。前記Z座標比較回路31、近似透視
変換回路32、及び除算を用いる透視変換回路33は、
夫々専用のハードウェアを用いなくても、浮動小数点演
算ユニットを用いて実現可能である。
It is to be noted that the present invention is not limited to the control mode for controlling the supply destination of polygon data according to the determination result as shown in FIG.
Approximate perspective transformation circuit 32 or perspective transformation circuit 3 using division
Needless to say, it is possible to select any one of the three operations. The Z coordinate comparison circuit 31, the approximate perspective transformation circuit 32, and the perspective transformation circuit 33 using division include:
The present invention can be realized by using a floating point arithmetic unit without using dedicated hardware.

【0048】《代表点の誤差を考慮した透視変換》図1
1には上記透視変換の近似計算による誤差を正規の演算
結果と直接比較して、透視変換の演算手法を決定する透
視変換処理手順が例示される。先ず、処理対象オブジェ
クトに含まれる頂点の内から代表点(FX,FY,F
Z)を決める(S30)。例えば代表点は、クラスタに
含まれる頂点のうち基準点から最も離れた位置の頂点、
或いは大凡中間に位置する頂点等とすることができる。
<< Perspective Transformation Considering Error of Representative Point >> FIG.
1 shows an example of a perspective transformation processing procedure for directly comparing an error caused by the approximate calculation of the perspective transformation with a normal operation result and determining an operation method of the perspective transformation. First, the representative points (FX, FY, F) are selected from the vertices included in the processing target object.
Z) is determined (S30). For example, the representative point is the vertex at the position farthest from the reference point among the vertices included in the cluster,
Alternatively, it may be a vertex located approximately at the center.

【0049】前記代表点に対して近似計算による透視変
換処理を行い(S31)、次いで、前記代表点に対して
除算による正規の透視変換処理を行う(S32)。そし
て、双方の透視変換処理結果に対する誤差が既定値の範
囲であるか否かが判定され(S33)、既定値以内であ
れば(Yes)、全ての頂点に対して近似透視変換を行
い(S35),既定値から逸脱していれば(No)、全
ての頂点に対して除算による透視変換を行う(S3
4)。
The representative point is subjected to perspective transformation processing by approximate calculation (S31), and then the representative point is subjected to normal perspective transformation processing by division (S32). Then, it is determined whether or not an error with respect to both perspective transformation processing results is within a predetermined value range (S33). If the error is within the predetermined value (Yes), approximate perspective transformation is performed on all vertices (S35). ), If it deviates from the default value (No), perspective transformation by division is performed on all vertices (S3).
4).

【0050】図12には代表点の誤差確認機能を備えて
透視変換を行うアクセラレータの概略ブロック図が示さ
れる。代表点に対する近似透視変換回路41による透視
変換処理結果と、代表点に対する除算を用いる透視変換
回路42による透視変換処理結果とは、透視変換後デー
タ比較回路43で比較され、その比較結果に応じた選択
信号S3により、ポリゴンデータがセレクタ40で選択
されて、透視変換回路41又は除算を用いる透視変換回
路42に供給されるようになっている。
FIG. 12 is a schematic block diagram of an accelerator having a function of confirming an error of a representative point and performing perspective transformation. The result of the perspective transformation process by the approximate perspective transformation circuit 41 for the representative point and the result of the perspective transformation process by the perspective transformation circuit 42 using division for the representative point are compared by the data transformation circuit 43 after the perspective transformation, and according to the comparison result. The polygon data is selected by the selector 40 according to the selection signal S3, and supplied to the perspective transformation circuit 41 or the perspective transformation circuit 42 using division.

【0051】尚、図12のように判定結果に応じてポリ
ゴンデータの供給先を制御する制御形態に限定されず、
近似透視変換回路41又は除算を用いる透視変換回路4
2の何れを動作させるかを選択するようにしてもよい。
また、前記透視変換後データ比較回路43、近似透視変
換回路41、及び除算を用いる透視変換回路42は、夫
々専用のハードウェアを用いなくても、浮動小数点演算
ユニットを用いて実現可能である。
It should be noted that the present invention is not limited to the control mode for controlling the supply destination of the polygon data according to the determination result as shown in FIG.
Approximate perspective transformation circuit 41 or perspective transformation circuit 4 using division
2 may be selected.
Further, the perspective-transformed data comparison circuit 43, the approximate perspective transformation circuit 41, and the perspective transformation circuit 42 using division can be realized by using a floating-point arithmetic unit without using dedicated hardware.

【0052】以上により説明した種々の透視変換処理で
は、クラスタの複数の頂点に対して基準点を設け、その
近傍にあるデータに対しては基準点からの相対位置とし
てのデータを利用し、除算による透視変換を行わずに近
似係数を用いて透視変換を行う。したがって、3次元グ
ラフィックス処理における透視変換処理の演算コストを
低減できる。例えば、浮動小数点演算の加算に要する演
算サイクル数を3、乗算にかかる演算サイクル数を3、
除算に要する演算サイクル数を12とした場合、1個の
頂点に対する除算による透視変換を行うとき除算1回と
乗算2回を必要とすると、この場合の透視変換にかかる
演算サイクル数は15サイクルとなる。これに対し、近
似係数を用いて近似計算で透視変換を行った場合、乗算
2回と加算1回で透視変換を行うことができ、演算サイ
クル数は9サイクルとなる。このように基準点における
近傍のデータが多ければ多いほど、演算コストの差が顕
著になってくる。よって、微細画像に対する処理ほど演
算コストの低減効果は高い。
In the various perspective transformation processes described above, a reference point is provided for a plurality of vertices of a cluster, and data near the reference point is divided by using data as a relative position from the reference point. Is performed using the approximation coefficient without performing the perspective transformation. Therefore, the calculation cost of the perspective transformation processing in the three-dimensional graphics processing can be reduced. For example, the number of operation cycles required for addition of a floating-point operation is 3, the number of operation cycles required for multiplication is 3,
Assuming that the number of operation cycles required for division is 12, when one perspective and one multiplication are required when performing perspective transformation by division on one vertex, the number of operation cycles required for perspective transformation in this case is 15 cycles. Become. On the other hand, when the perspective transformation is performed by the approximate calculation using the approximation coefficient, the perspective transformation can be performed by two multiplications and one addition, and the number of operation cycles is nine. As described above, the more the data in the vicinity of the reference point is, the more noticeable the difference in calculation cost is. Therefore, as the processing is performed on a finer image, the effect of reducing the calculation cost is higher.

【0053】また、Z座標閾値を設定できるレジスタ3
0Aを設けて、そのレジスタ30Aの値と当該オブジェ
クトの基準点を比較し、当該オブジェクトの基準点が遠
かった場合、近似計算による透視変換を行うように制御
する比較回路31を備えることによって、演算コストを
低減しつつも高画質なグラフィックス処理装置を構成で
きる。
A register 3 for setting a Z coordinate threshold value
0A is provided, a comparison circuit 31 is provided for comparing the value of the register 30A with the reference point of the object and, when the reference point of the object is far, controlling to perform perspective transformation by approximation calculation. A high-quality graphics processing device can be configured while reducing costs.

【0054】基準点に対して近傍点となる頂点の範囲を
設定できる近傍範囲設定レジスタ21を設けることによ
り、画像の粗さを任意に設定できる。
The provision of the vicinity range setting register 21 which can set the range of the vertex which is the vicinity point with respect to the reference point allows the roughness of the image to be arbitrarily set.

【0055】基準点の近傍における頂点のデータのうち
の代表点に対して近似計算による透視変換と除算による
透視変換を行い、そのデータの誤差を求めて、その誤差
に応じて基準点の近傍における頂点に対して近似計算、
または除算による透視変換を選択できるようにすること
によって、高画質の維持が容易になる。
Perspective transformation by approximation calculation and perspective transformation by division are performed on the representative point of the vertex data in the vicinity of the reference point, an error of the data is obtained, and the error in the vicinity of the reference point is determined in accordance with the error. Approximate calculation for vertices,
Alternatively, it is easy to maintain high image quality by making it possible to select perspective transformation by division.

【0056】以上本発明者によってなされた発明を実施
形態に基づいて具体的に説明したが、本発明はそれに限
定されるものではなく、その要旨を逸脱しない範囲にお
いて種々変更可能であることは言うまでもない。
Although the invention made by the present inventor has been specifically described based on the embodiment, it is needless to say that the present invention is not limited to the embodiment and can be variously modified without departing from the gist thereof. No.

【0057】例えば、データ処理装置の演算制御装置は
CPUとアクセラレータから成る構成に限定されず、ハ
ードワイヤードロジックによって専用化しても良い。ま
た、ポリゴンの頂点データなどは浮動小数点型データに
限定されず、演算精度に支障無ければ整数データであっ
てもよい。
For example, the arithmetic and control unit of the data processing device is not limited to a configuration including a CPU and an accelerator, and may be dedicated to a hard wired logic. Further, the vertex data of the polygon is not limited to the floating point data, and may be integer data as long as the calculation accuracy is not hindered.

【0058】[0058]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
の通りである。
The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows.

【0059】クラスタの複数の頂点に対して基準点を設
け、その近傍にあるデータに対しては基準点からの相対
位置としてのデータを利用し、除算による透視変換を行
わずに近似係数を用いて透視変換を行うから、3次元グ
ラフィックス処理における演算コストを低減できる。透
視変換のための除算をより演算コストの低い乗算と加算
により近似することで透視変換を高速化することができ
るから、グラフィックス処理全体を高速化することがで
きる。基準点における近傍のデータが多ければ多いほ
ど、演算コストの差が顕著になってくる。よって、微細
画に対する像処ほど高い効果を得ることができる。
A reference point is provided for a plurality of vertices of a cluster, and data as a relative position from the reference point is used for data in the vicinity of the reference point, and an approximate coefficient is used without performing perspective transformation by division. Since the perspective transformation is performed, the calculation cost in the three-dimensional graphics processing can be reduced. Since the perspective transformation can be speeded up by approximating the division for the perspective transformation by multiplication and addition with lower operation costs, the entire graphics processing can be speeded up. The more data in the vicinity of the reference point, the more noticeable the difference in computation cost. Therefore, a higher effect can be obtained for an image processing for a fine image.

【0060】Z座標閾値のような既定値を設定し、その
値と基準点を比較し、当該基準点が遠かった場合、近似
計算による透視変換を行うように制御することによっ
て、演算コストを低減しつつも高画質なグラフィックス
処理装置を構成できる。
A predetermined value such as a Z coordinate threshold value is set, and the value is compared with a reference point. If the reference point is far, control is performed to perform perspective transformation by approximation calculation, thereby reducing the calculation cost. In addition, a high-quality graphics processing device can be configured.

【0061】基準点に対して近傍点となる頂点の範囲の
ような既定値を設定することにより、画像の粗さを任意
に設定できる。
By setting a predetermined value such as a range of vertices that are neighboring points with respect to the reference point, the roughness of the image can be arbitrarily set.

【0062】基準点の近傍のデータのうちの代表点に対
して、近似計算による透視変換と除算による透視変換を
行い、そのデータの誤差に応じて近似計算によるか、又
は除算による透視変換によるかをを選択することによっ
て、高画質の維持が容易になる。
The representative point of the data in the vicinity of the reference point is subjected to the perspective transformation by approximation calculation and the perspective transformation by division, and the approximation calculation or the perspective transformation by division is performed according to the error of the data. By selecting, it is easy to maintain high image quality.

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

【図1】3次元空間をZ軸に垂直な方向から見た状態で
透視変換を説明するための説明図である。
FIG. 1 is an explanatory diagram for explaining perspective transformation when a three-dimensional space is viewed from a direction perpendicular to a Z axis.

【図2】透視変換のための近似式の説明図である。FIG. 2 is an explanatory diagram of an approximate expression for perspective transformation.

【図3】3次元画像を構成する頂点集合の一例を示す説
明図である。
FIG. 3 is an explanatory diagram showing an example of a vertex set forming a three-dimensional image.

【図4】本発明に係るデータ処理装置の一例であるグラ
フィックプロセッサのブロック図である。
FIG. 4 is a block diagram of a graphic processor which is an example of a data processing device according to the present invention.

【図5】演算制御装置で実行される近似計算による透視
変換処理の手順を例示するフローチャートである。
FIG. 5 is a flowchart illustrating a procedure of a perspective transformation process based on an approximate calculation executed by the arithmetic and control unit.

【図6】図5の透視変換処理を演算制御装置で行うとき
の入出力データを例示する説明図である。
FIG. 6 is an explanatory diagram exemplifying input / output data when the perspective control processing of FIG. 5 is performed by the arithmetic and control unit.

【図7】基準点に対する近傍範囲を考慮した透視変換処
理手順を例示するフローチャートである。
FIG. 7 is a flowchart illustrating an example of a perspective transformation processing procedure in which a neighborhood range with respect to a reference point is considered;

【図8】近傍範囲設定機能を備えて透視変換を行うアク
セラレータの概略ブロック図である。
FIG. 8 is a schematic block diagram of an accelerator having a near range setting function and performing perspective transformation.

【図9】Z座標閾値を考慮したときの透視変換処手順を
示すフローチャートである。
FIG. 9 is a flowchart illustrating a procedure of a perspective transformation process when a Z coordinate threshold value is considered.

【図10】Z座標閾値設定機能を備えて透視変換を行う
アクセラレータの概略ブロック図である。
FIG. 10 is a schematic block diagram of an accelerator having a Z coordinate threshold value setting function and performing perspective transformation.

【図11】透視変換の近似計算による誤差を正規の演算
結果と直接比較して透視変換の演算手法を決定する透視
変換処理手順を例示するフローチャートである。
FIG. 11 is a flowchart illustrating an example of a perspective transformation processing procedure in which an error due to an approximate calculation of the perspective transformation is directly compared with a normal operation result to determine an operation method of the perspective transformation.

【図12】代表点の誤差確認機能を備えて透視変換を行
うアクセラレータの概略ブロック図である。
FIG. 12 is a schematic block diagram of an accelerator having a function of confirming an error of a representative point and performing perspective transformation.

【符号の説明】 1 グラフィックプロセッサ 2 演算制御装置 3 CPU 4 アクセラレータ 5 キャッシュメモリユニット Pc 基準点 Pi ポリゴンの頂点[Description of Signs] 1 Graphic Processor 2 Arithmetic Controller 3 CPU 4 Accelerator 5 Cache Memory Unit Pc Reference Point Pi Vertex of Polygon

───────────────────────────────────────────────────── フロントページの続き (72)発明者 山田 孔司 東京都小平市上水本町五丁目20番1号 株 式会社日立製作所半導体グループ内 (72)発明者 斎藤 靖彦 東京都小平市上水本町五丁目20番1号 株 式会社日立製作所半導体グループ内 Fターム(参考) 5B046 DA10 FA17 JA07 5B056 BB11 BB51 HH03 5B080 BA04 DA06  ──────────────────────────────────────────────────続 き Continuing on the front page (72) Koji Yamada, Inventor 5--20-1, Kamizuhoncho, Kodaira-shi, Tokyo Within the Semiconductor Group, Hitachi, Ltd. 5-20-1 F-term within Hitachi Semiconductor Co., Ltd. Semiconductor Group 5B046 DA10 FA17 JA07 5B056 BB11 BB51 HH03 5B080 BA04 DA06

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 3次元形状を構成する複数の頂点(X
i,Yi,Zi)の集合をXY透視平面に投影する3次
元グラフィックスの透視変換処理が可能な演算制御手段
を有し、 前記演算制御手段は、透視変換処理として、前記頂点の
集合に基準点(Xc,Yc,Zc)を設定する第1処理
と、前記基準点のZ座標(Zc)と前記頂点のZ座標
(Zi)との差分(dZi)を演算する第2処理と、前
記基準点のZ座標(Zc)、前記差分(dZi)及び前
記基準点のZ座標(Zc)に対するXY透視平面上の透
視Z座標(SZ)を用いた近似式により、頂点のX座標
及びY座標に対応する透視X座標(SXi)及び透視Y
座標(SYi)を演算する第3処理処理とを行うもので
あることを特徴とするデータ処理装置。
A plurality of vertices (X) forming a three-dimensional shape
i, Yi, Zi) having an operation control unit capable of performing a perspective transformation process of three-dimensional graphics for projecting the set on an XY perspective plane, wherein the operation control unit performs a perspective transformation process based on the set of vertices. A first process for setting a point (Xc, Yc, Zc); a second process for calculating a difference (dZi) between a Z coordinate (Zc) of the reference point and a Z coordinate (Zi) of the vertex; The approximate coordinates using the perspective Z coordinate (SZ) on the XY perspective plane with respect to the Z coordinate (Zc) of the point, the difference (dZi), and the Z coordinate (Zc) of the reference point are converted to the X coordinate and the Y coordinate of the vertex. Corresponding perspective X coordinate (SXi) and perspective Y
A data processing device for performing a third processing for calculating coordinates (SYi).
【請求項2】 前記近似式は微分可能関数f(dZ)=
1/(Z+dZ)に関するマクローリン級数展開による
級数を定数項と1次の項で打ち切った計算式を適用した
ものであることを特徴とする請求項1記載のデータ処理
装置。
2. The approximate expression is a differentiable function f (dZ) =
2. The data processing apparatus according to claim 1, wherein a calculation formula obtained by truncating a series of 1 / (Z + dZ) by a Macroleigh series expansion with a constant term and a first-order term is applied.
【請求項3】 前記透視変換処理において前記演算制御
手段は、頂点の座標と基準点の座標との差分が既定値よ
りも小さいか否かを判定する第4処理を行い、その判定
結果が小さいとき前記近似計算による前記第3処理を行
い、前記第4処理による判定結果が大きいときは前記第
3処理に代えて幾何学の相似の関係を用いた除算による
透視変換を行って透視X座標(SXi)及び透視Y座標
(SYi)を演算する第5処理を行うものであることを
特徴とする請求項1又は2記載のデータ処理装置。
3. In the perspective transformation process, the arithmetic control unit performs a fourth process of determining whether a difference between the coordinates of the vertex and the coordinates of the reference point is smaller than a predetermined value, and the determination result is small. When the third processing by the approximation calculation is performed, and when the determination result by the fourth processing is large, a perspective transformation is performed by division using a similarity relationship of the geometry instead of the third processing to perform a perspective X coordinate ( 3. The data processing device according to claim 1, wherein a fifth process for calculating SXi) and a perspective Y coordinate (SYi) is performed.
【請求項4】 前記透視変換処理において前記演算制御
手段は、透視変換の透視面から基準点までの距離が既定
値よりも大きいか否かを判定する第6処理を行い、 前記第6処理による判定結果が大きいとき前記近似計算
による前記第3処理を行い、前記第6処理による判定結
果が小さいときは前記第3処理に代えて、幾何学の相似
の関係を用いた除算による透視変換を行って透視X座標
(SXi)及び透視Y座標(SYi)を演算する第7処
理を行うものであることを特徴とする請求項1又は2記
載のデータ処理装置。
4. In the perspective transformation process, the arithmetic control unit performs a sixth process of determining whether a distance from a perspective surface of the perspective transformation to a reference point is greater than a predetermined value. When the determination result is large, the third processing by the approximation calculation is performed, and when the determination result by the sixth processing is small, the perspective transformation by division using the similarity of the geometry is performed instead of the third processing. The data processing apparatus according to claim 1, wherein a seventh process of calculating a perspective X coordinate (SXi) and a perspective Y coordinate (SYi) is performed.
【請求項5】 前記透視変換処理において前記演算制御
手段は、前記3次元オブジェクトを構成する複数の頂点
の内の代表頂点に対して、前記近似計算による前記第3
処理を行って透視座標を演算すると共に、幾何学の相似
の関係を用いた除算による透視変換を行って透視座標を
演算する第8処理と、第8処理によって得られた双方の
演算結果の誤差の大きさを判定する第9処理と、第9処
理による誤差が既定値以下の場合には残りの頂点に対
し、前記近似計算による前記第3処理を行い、判定結果
が既定値よりも大きい場合には残りの頂点に対し、前記
第3処理に代えて幾何学の相似の関係を用いた除算によ
る透視変換を行って透視X座標(SXi)及び透視Y座
標(SYi)を演算する第10処理を行うものであるこ
とを特徴とする請求項1又は2記載のデータ処理装置。
5. In the perspective transformation processing, the arithmetic control unit performs the third calculation based on the approximate calculation with respect to a representative vertex of a plurality of vertices constituting the three-dimensional object.
An eighth process of calculating perspective coordinates by performing processing and calculating perspective coordinates by performing a perspective transformation by division using a similarity relationship between geometrics, and an error of both calculation results obtained by the eighth process A ninth process for determining the size of the vertices, and when the error due to the ninth process is equal to or smaller than a predetermined value, the third process based on the approximate calculation is performed on the remaining vertices. In the tenth process, a perspective X coordinate (SXi) and a perspective Y coordinate (SYi) are calculated for the remaining vertices by performing perspective transformation by division using a similarity in geometry instead of the third process. 3. The data processing device according to claim 1, wherein the data processing is performed.
JP2000194936A 2000-06-23 2000-06-23 Data processing device Withdrawn JP2002008059A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000194936A JP2002008059A (en) 2000-06-23 2000-06-23 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000194936A JP2002008059A (en) 2000-06-23 2000-06-23 Data processing device

Publications (1)

Publication Number Publication Date
JP2002008059A true JP2002008059A (en) 2002-01-11

Family

ID=18693688

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000194936A Withdrawn JP2002008059A (en) 2000-06-23 2000-06-23 Data processing device

Country Status (1)

Country Link
JP (1) JP2002008059A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110490970A (en) * 2019-08-08 2019-11-22 广联达科技股份有限公司 Store the method, apparatus and electronic equipment of three-dimensional geometric information

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110490970A (en) * 2019-08-08 2019-11-22 广联达科技股份有限公司 Store the method, apparatus and electronic equipment of three-dimensional geometric information

Similar Documents

Publication Publication Date Title
JP4030519B2 (en) Image processing apparatus and image processing system
TWI443603B (en) Two dimensional vector graphics triangulation system and method thereof
US9030478B2 (en) Three-dimensional graphics clipping method, three-dimensional graphics displaying method, and graphics processing apparatus using the same
US6166743A (en) Method and system for improved z-test during image rendering
JP2008077627A (en) Method and system for early z test in three-dimensional image rendering
WO2022242038A1 (en) Animation migration method and apparatus, device, storage medium, and computer program product
US10535188B2 (en) Tessellation edge shaders
US20210158155A1 (en) Average power estimation using graph neural networks
TWI238975B (en) Method of performing cubic mapping with texturing
JP3557839B2 (en) How to create mesh data on a curved surface
JPH11161819A (en) Image processor, its method and recording medium recording image processing program
US5402533A (en) Method and apparatus for approximating a signed value between two endpoint values in a three-dimensional image rendering device
US5892516A (en) Perspective texture mapping circuit having pixel color interpolation mode and method thereof
US7636095B2 (en) Pixel delta interpolation method and apparatus
JP2002535759A (en) Method and apparatus for stretch britting using 3D pipeline
JP2002008059A (en) Data processing device
JP4526121B2 (en) Method for calculating intersection of triangle and line segment and its program
JP3367506B2 (en) Image processing apparatus and image processing method
US10593111B2 (en) Method and apparatus for performing high throughput tessellation
US20050057568A1 (en) Bicubic surface rendering
US6930686B1 (en) Method and apparatus for drawing thick graphic primitives
JP3278828B2 (en) Translucent stereoscopic image processing device
US20220207690A1 (en) Primitive Testing for Ray Intersection at Multiple Precisions
JP2000207576A (en) Method and device for processing image and recording medium recording image processing program
US6822656B1 (en) Sphere mode texture coordinate generator

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070904