JPH09330419A - Graphic area discriminating device - Google Patents

Graphic area discriminating device

Info

Publication number
JPH09330419A
JPH09330419A JP8168421A JP16842196A JPH09330419A JP H09330419 A JPH09330419 A JP H09330419A JP 8168421 A JP8168421 A JP 8168421A JP 16842196 A JP16842196 A JP 16842196A JP H09330419 A JPH09330419 A JP H09330419A
Authority
JP
Japan
Prior art keywords
vertex
area
code
graphic
gate
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
JP8168421A
Other languages
Japanese (ja)
Inventor
Kazunori Matsuura
一教 松浦
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.)
Nippon Steel Corp
Original Assignee
Nippon Steel Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Steel Corp filed Critical Nippon Steel Corp
Priority to JP8168421A priority Critical patent/JPH09330419A/en
Publication of JPH09330419A publication Critical patent/JPH09330419A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

PROBLEM TO BE SOLVED: To accelerate a graphic area discriminating processing based on an algorithm by discriminating an area including a graphic based on output information of an AND gate and an OR gate. SOLUTION: Logical codes respectively assigned to areas constituting a graphic are obtained as the vertex codes of respective vertexes by an ALU 1 to store in a shift register 4. The AND and OR of the respective vertex codes stored in the shift register 4 are obtained by an AND gate means 5 and an OR gate means 6. Then based on output information of the means 5 and 6,, the area including the graphic is discriminated by a condition judging part 8. Thereby the graphic area discriminating processing based on an algorithm is accelerated.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は図形領域判別装置に
関し、例えば、コンピュータグラフィックス等の分野で
行われるクリッピングの前処理を行う際に用いて好適な
ものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a graphic area discriminating apparatus, which is suitable for use in, for example, preprocessing for clipping performed in the field of computer graphics and the like.

【0002】[0002]

【従来の技術】コンピュータグラフィックス(CG)等
の分野においては、CGで作られた物体を表示する際に
クリッピング処理を行うことが多い。クリッピングと
は、表示装置に物体を表示する際に、一定の表示領域を
設定しておき、その表示領域の外にはみ出す部分を表示
しないようにするために、表示領域の外部にある部分を
除外する処理のことを言う。
2. Description of the Related Art In the field of computer graphics (CG) and the like, clipping processing is often performed when displaying an object made of CG. Clipping is to exclude a portion outside the display area in order to set a certain display area when displaying an object on the display device and not to display a portion outside the display area. It means the process to do.

【0003】CGの2次元物体や3次元物体を構成する
ポリゴンは三角形や四角形などの図形によって構成され
るが、その図形には、図5に示すように、完全に表示
領域(クリッピングウィンドウ)50の内側にあるもの
(完全可視の三角形A)、完全に表示領域50の外側
にあるもの(完全不可視の三角形B,D)、表示領域
50の境界により内側と外側とに分割されるもの(部分
可視の三角形C)の3種類がある。この図5の例では、
クリッピング処理で、完全不可視の三角形B,D、およ
び部分可視の三角形Cの一部分を除外する処理を行う。
Polygons forming a two-dimensional object or a three-dimensional object of a CG are composed of figures such as triangles and quadrilaterals, and the figure has a complete display area (clipping window) 50 as shown in FIG. Inside (completely visible triangle A), completely outside the display area 50 (completely invisible triangles B and D), and divided into inside and outside by the boundary of the display area 50 (partial) There are three types of visible triangles C). In the example of FIG. 5,
In the clipping process, a process of excluding the completely invisible triangles B and D and a part of the partially visible triangle C is performed.

【0004】このようにクリッピング処理を行うのは、
表示されない図形をそのまま残しておくと、その後の処
理の負荷が大きくなってしまうからである。
The clipping process is performed in this way.
This is because if the figure that is not displayed is left as it is, the load of the subsequent processing increases.

【0005】以上のようなクリッピング処理を行うため
には、その前処理として、図形が上記〜のどの領域
に存在するのかを判別する必要がある。この3種類の領
域を判別するアルゴリズムの1つに、Cohen Sutherland
アルゴリズムと呼ばれるものがある。以下に、2次元C
Gに適用されるCohen Sutherlandアルゴリズムを図5を
用いて説明する。
In order to perform the clipping processing as described above, it is necessary to determine in which of the above-mentioned areas the figure exists as preprocessing. Cohen Sutherland is one of the algorithms that distinguishes these three types of regions.
There is something called an algorithm. Below, two-dimensional C
The Cohen Sutherland algorithm applied to G will be described with reference to FIG.

【0006】まず、クリッピングウィンドウ50を構成
するクリッピング直線(4本の境界線)によって分割さ
れた9個の領域のそれぞれに、4ビットの論理コードを
割り当てる。クリッピングウィンドウ50内の論理コー
ドは“0000”であるが、それよりも左側の領域では
最下位ビットに“1”が割り当てられ、右側の領域では
第2ビットに“1”が割り当てられる。また、クリッピ
ングウィンドウ50よりも下側の領域では第3ビットに
“1”が割り当てられ、上側の領域では最上位ビットに
“1”が割り当てられる。
First, a 4-bit logical code is assigned to each of the nine regions divided by the clipping straight lines (four boundary lines) that form the clipping window 50. Although the logic code in the clipping window 50 is "0000", "1" is assigned to the least significant bit in the left side area and "1" is assigned to the second bit in the right side area. Further, “1” is assigned to the third bit in the area below the clipping window 50, and “1” is assigned to the most significant bit in the area above.

【0007】次に、ポリゴン(図5の例では三角形)の
各頂点が上記した9個の領域の中の何れに存在するかを
調べ、各頂点に頂点コードを割り当てる。図5の例の場
合、三角形A〜Dの頂点コードは、それぞれ次のように
なる。 三角形A:“0000”、“0000”、“0000” 三角形B:“1001”、“1001”、“1000” 三角形C:“0010”、“0000”、“0010” 三角形D:“1010”、“1000”、“0010”
Next, it is checked which of the above-mentioned nine regions each vertex of the polygon (triangle in the example of FIG. 5) exists, and a vertex code is assigned to each vertex. In the case of the example of FIG. 5, the vertex codes of the triangles A to D are as follows. Triangle A: “0000”, “0000”, “0000” Triangle B: “1001”, “1001”, “1000” Triangle C: “0010”, “0000”, “0010” Triangle D: “1010”, “ 1000 "," 0010 "

【0008】そして、上述のようにして割り当てた三角
形の各頂点コードを用いて、以下に示す条件判定を行う
ことにより3つのグループに分類する。 (1) 3つの頂点コードの論理和が“0000”であるな
ら、その三角形は完全可視である(三角形A)。 (2) 3つの頂点コードの論理積が“0000”でないな
ら、その三角形は完全不可視である(三角形B)。 (3) 上記(1)(2)以外のものは、完全不可視あるいは部分
可視である(三角形Cおよび三角形D)。
Then, the vertex codes of the triangles assigned as described above are used to perform the following condition determination to classify them into three groups. (1) If the logical sum of three vertex codes is “0000”, the triangle is completely visible (triangle A). (2) If the logical product of the three vertex codes is not "0000", the triangle is completely invisible (triangle B). (3) Except for the above (1) and (2), it is completely invisible or partially visible (triangle C and triangle D).

【0009】なお、このCohen Sutherlandアルゴリズム
では、上記(2)(3)に示したように、完全不可視の図形と
部分可視の図形とを完全には分類することができない
が、何れの図形もクリッピング処理の対象となるもので
あり、正確な分類はその後のクリッピング処理において
行われる。以上は2次元空間でのクリッピング前処理で
あったが、3次元空間では上下左右の要素の他に前後の
要素が加わるので、論理コードおよび頂点コードは6ビ
ットになる。
Although the Cohen Sutherland algorithm cannot completely classify completely invisible figures and partially visible figures as shown in (2) and (3) above, any figure is clipped. It is the object of processing, and accurate classification is performed in the subsequent clipping processing. The above is the pre-clipping process in the two-dimensional space, but in the three-dimensional space, the elements before and after, in addition to the elements above, below, left and right are added, so that the logical code and the vertex code are 6 bits.

【0010】図3は、上記Cohen Sutherlandアルゴリズ
ムに基づいて図形領域判別を行う従来の図形領域判別装
置の構成を示す図であり、図4は、この図形領域判別を
行うための従来のプログラムの例を示す図である。以
下、これらの図面を用いて説明を行う。
FIG. 3 is a diagram showing the configuration of a conventional figure area discriminating apparatus for discriminating a figure area based on the Cohen Sutherland algorithm. FIG. 4 shows an example of a conventional program for discriminating the figure area. FIG. Hereinafter, description will be given with reference to these drawings.

【0011】なお、図4のプログラムは、通常のプロセ
ッサ(DSPなど)で行うプログラムを示したものであ
り、クリッピングウィンドウ50は、 −W≦X≦W,−W≦Y≦W,−W≦Z≦W の範囲でなる立方体であると仮定している。ただし、
X,Y,Zはそれぞれクリッピングウィンドウ50の中
心を始点とした左右方向、上下方向、前後方向の座標値
である。また、処理中のポリゴンの各頂点の座標を(X
[i],Y[i],Z[i] )としている(i=0,1,2)。
The program of FIG. 4 shows a program executed by an ordinary processor (DSP or the like), and the clipping window 50 has -W≤X≤W, -W≤Y≤W, -W≤. It is assumed that the cube is in the range of Z≤W. However,
X, Y, and Z are coordinate values in the left-right direction, the up-down direction, and the front-back direction, starting from the center of the clipping window 50. In addition, the coordinates of each vertex of the polygon being processed are (X
[i], Y [i], Z [i]) (i = 0, 1, 2).

【0012】図4において、(a)の部分は、三角形を
構成する3頂点の頂点コードvertex[i] (i=0,1,2) を全
て0(10)=000000(2) に初期化する処理である。
また、(b)の部分は、各頂点コードvertex[i] を実際
に求める処理である。3次元空間で図形領域判別を行う
場合、1つの頂点コードを求めるのに6回の条件判定を
行う必要がある。
In FIG. 4, part (a) initializes all vertex codes vertex [i] (i = 0,1,2) of three vertices forming a triangle to 0 (10) = 000000 (2) . It is a process to do.
The part (b) is a process for actually obtaining each vertex code vertex [i]. When the figure area is determined in the three-dimensional space, it is necessary to perform the condition determination six times to obtain one vertex code.

【0013】1回目の条件判定は、ある頂点のX座標値
X[i] がクリッピングウィンドウ50の左側の境界値で
ある−Wよりも小さいか否かを判定する処理であり、こ
の条件が成立する場合は、そのときの頂点コードvertex
[i] (初期化されたもの)と1(10)=000001(2)
との論理和をとったものが新たな頂点コードvertex[i]
とされることにより、最下位ビットに“1”が立てられ
る。
The first condition judgment is a process for judging whether or not the X coordinate value X [i] of a certain vertex is smaller than the boundary value -W on the left side of the clipping window 50, and this condition is satisfied. If so, the vertex code at that time vertex
[i] (initialized) and 1 (10) = 000001 (2)
Is the new vertex code vertex [i]
As a result, "1" is set in the least significant bit.

【0014】2回目の条件判定は、上記X座標値X[i]
がクリッピングウィンドウ50の右側の境界値であるW
よりも大きいか否かを判定する処理であり、この条件が
成立する場合は、そのときの頂点コードvertex[i] と2
(10)=000010(2) との論理和をとったものが新た
な頂点コードvertex[i] とされることにより、2ビット
目に“1”が立てられる。
In the second condition judgment, the above X coordinate value X [i]
Is the boundary value on the right side of the clipping window 50, W
If the condition is satisfied, the vertex code vertex [i] and 2 at that time are determined.
(10) = 000010 The logical sum of ( 0000 ) and (2) is used as the new vertex code vertex [i], and "1" is set at the second bit.

【0015】以下同様にして、Y座標値Y[i] ,Z座標
値Z[i] についての条件判定を順次行う。これら6回に
渡る条件判定では、記号orで示すように直前の頂点コ
ードvertex[i] の値とで論理和をとっているので、成立
する条件式に対応するビットの全てに“1”が立てられ
る。この6回の条件判定処理により、1つの頂点につい
ての頂点コードvertex[i] が求められる。3次元物体を
構成するポリゴンが三角形の場合、このような処理を3
回繰り返して行うことにより、3つの頂点コードvertex
[i] (i=0,1,2) が求められる。
In the same manner, the conditions for the Y coordinate value Y [i] and the Z coordinate value Z [i] are sequentially determined. In these 6 times of conditional judgment, as shown by the symbol or, the logical sum is taken with the value of the immediately preceding vertex code vertex [i], so that "1" is set to all the bits corresponding to the conditional expressions that are satisfied. Can be set up. The vertex code vertex [i] for one vertex is obtained by this six times of condition determination processing. If the polygons that make up the three-dimensional object are triangles, such processing is
Repeated three times, the three vertex codes vertex
[i] (i = 0,1,2) is calculated.

【0016】このようにして頂点コードvertex[i] を求
める図4(a)(b)の処理は、図3のALU(算術論
理演算装置)31が行っている。このとき、6回の条件
判定処理で用いている境界値W,−Wは、例えば一方の
レジスタ32に格納され、各座標値X[i] ,Y[i] ,Z
[i] は他方のレジスタ33に格納される。
The processing of FIGS. 4A and 4B for obtaining the vertex code vertex [i] in this manner is performed by the ALU (arithmetic logic unit) 31 of FIG. At this time, the boundary values W and −W used in the six condition determination processes are stored in, for example, one register 32, and the coordinate values X [i], Y [i], and Z are stored.
[i] is stored in the other register 33.

【0017】また、図4(c)(d)の部分は、上述の
ようにして求めた三角形の各頂点コードvertex[i] (i=
0,1,2) を用いて、上記した (1)〜(3) のグループ分け
を行う処理である。すなわち、図4(c)の部分では、
3つの頂点コードvertex[0] ,vertex[1] ,vertex[2]
の論理積と論理和とを求め、図4(d)の部分では、そ
の求めた論理積が0(10)でないかどうか、および求めた
論理和が0(10)であるかどうかを見ることによって3種
類のグループ分けを行う。
4C and 4D, each vertex code vertex [i] (i =
This is a process for grouping (1) to (3) using 0,1,2). That is, in the portion of FIG.
Three vertex codes vertex [0], vertex [1], vertex [2]
Logically ANDed and ORed, in the portion of FIG. 4 (d), the to see if whether the determined logical product is not 0 (10), and the logical sum calculated is 0 (10) There are 3 types of grouping.

【0018】上記図4(c)の処理は図3のALU31
が行い、図4(d)の処理は図3のALU31および条
件判定部35が行っている。すなわちALU31は、ま
ず、図4(b)の処理によって求めた3つの頂点コード
vertex[i] (i=0,1,2) をレジスタ32,33を介して入
力し、それらの論理積と論理和とを求める。次に、求め
た論理積の値が0(10)でないか、すなわち、該当するポ
リゴン(三角形)が上記(2) のグループに属するもので
あるかどうかを調べる。
The processing of FIG. 4C is performed by the ALU 31 of FIG.
The process of FIG. 4D is performed by the ALU 31 and the condition determination unit 35 of FIG. That is, the ALU 31 first determines the three vertex codes obtained by the processing of FIG.
vertex [i] (i = 0,1,2) is input via the registers 32 and 33, and the logical product and the logical sum of them are calculated. Then, it is checked whether the obtained logical product value is 0 (10) , that is, whether the corresponding polygon (triangle) belongs to the group (2).

【0019】なお、図4(b)の計算の性質上、論理積
が負の値をとることはないから、論理積が0(10)でない
ということは、論理積が0(10)よりも大きいということ
と同じである。したがって、図4(d)の最上段に示し
たように、求めた論理積が0(10)より大きいかどうかを
見ることによって上記(2) のグループに属するかどうか
を以下のようにして判定している。
Since the logical product does not take a negative value due to the nature of the calculation of FIG. 4 (b), the fact that the logical product is not 0 (10) means that the logical product is more than 0 (10). It is the same as being large. Therefore, as shown in the top row of FIG. 4 (d), it is determined whether or not it belongs to the group of (2) above by checking whether the obtained logical product is larger than 0 (10) as follows. are doing.

【0020】まず、ALU31が、上記求めた論理積の
値に対して0(10)を加算する。このとき、加算処理によ
り得られた値が0(10)であればサインフラグレジスタ3
4にゼロフラグの“1”が立てられる。よって、サイン
フラグレジスタ34の値が“0”であれば、求めた論理
積は0(10)より大きいということになる。そこで、条件
判定部35は、上記サインフラグレジスタ34の値を見
ることによって、求めた論理積が0(10)より大きいかど
うかを調べる。
First, the ALU 31 adds 0 (10) to the value of the logical product obtained above. At this time, if the value obtained by the addition processing is 0 (10) , the sign flag register 3
A zero flag “1” is set to 4. Therefore, if the value of the sign flag register 34 is "0", the obtained logical product is larger than 0 (10) . Therefore, the condition determination unit 35 checks whether the obtained logical product is larger than 0 (10) by looking at the value of the sign flag register 34.

【0021】条件判定部35は、上記サインフラグレジ
スタ34の値が“0”であると判断したときは、求めた
論理積の値が0(10)ではないということなので、プログ
ラムカウンタ37の値を1だけインクリメントしたアド
レス値をセレクタ36で選択するように制御し、該当す
る三角形が完全不可視のものであるとする処理を行う。
一方、上記サインフラグレジスタ34の値が“1”であ
ると判断したときは、次に論理和に関する条件判定を行
うべく分岐先のアドレス値をセレクタ36で選択するよ
うに制御する。
When the condition judging unit 35 judges that the value of the sign flag register 34 is "0", it means that the value of the logical product obtained is not 0 (10) , and therefore the value of the program counter 37. Is controlled so that the selector 36 selects an address value incremented by 1, and processing is performed to determine that the corresponding triangle is completely invisible.
On the other hand, when it is determined that the value of the sign flag register 34 is "1", control is performed so that the selector 36 selects the address value of the branch destination in order to perform the condition determination regarding the logical sum.

【0022】このようにして論理和の条件判定を行う分
岐先アドレスにプログラムが進められると、次に、AL
U31および条件判定部35は、図4(d)の第2段目
に示したように、求めた論理和の値が0(10)であるかど
うか、すなわち、該当するポリゴン(三角形)が上記
(1) のグループに属するものであるかどうかを調べる。
この場合も、ALU31において論理和の値に対して0
(10)を加算したときに得られるサインフラグレジスタ3
4の値を条件判定部35が見ることによって、求めた論
理和の値が0(10)であるかどうかを調べる。
When the program is advanced to the branch destination address for performing the logical sum condition determination in this way, next, AL
As shown in the second row of FIG. 4 (d), the U31 and the condition determining unit 35 determine whether or not the value of the obtained logical sum is 0 (10) , that is, the corresponding polygon (triangle) is
Check whether it belongs to the group of (1).
Also in this case, the value of the logical sum in the ALU 31 is 0.
Sign flag register 3 obtained by adding (10)
By checking the value of 4 by the condition determination unit 35, it is checked whether or not the obtained logical sum value is 0 (10) .

【0023】条件判定部35は、上記サインフラグレジ
スタ34の値が“1”であると判断したときは、求めた
論理和の値が0(10)であるということなので、プログラ
ムカウンタ37の値を1だけインクリメントしたアドレ
ス値をセレクタ36で選択するように制御し、該当する
三角形が完全可視のものであるとする処理を行う。
When the condition judging section 35 judges that the value of the sign flag register 34 is "1", it means that the value of the obtained logical sum is 0 (10). Is controlled so that the selector 36 selects an address value incremented by 1, and processing is performed to determine that the corresponding triangle is completely visible.

【0024】一方、上記サインフラグレジスタ34の値
が“0”であると判断したときは、図4(d)の最下段
の処理を行うべく分岐先のアドレス値をセレクタ36で
選択するように制御し、その分岐先にプログラムを進め
て、該当する三角形が完全不可視または部分可視のもの
であるとする処理を行う。
On the other hand, when it is determined that the value of the sign flag register 34 is "0", the branch destination address value is selected by the selector 36 in order to perform the process at the bottom of FIG. 4 (d). The control is performed, and the program is advanced to the branch destination to perform processing for determining that the corresponding triangle is completely invisible or partially visible.

【0025】[0025]

【発明が解決しようとする課題】図4に示したように、
従来の図形領域判別装置では、Cohen Sutherlandアルゴ
リズムに基づいてポリゴンが何れの領域に存在している
のかを判別するために、数多くの命令を実行している。
そのため、上記アルゴリズムの実行に長い時間がかかっ
ていた。そこで本発明は、上記Cohen Sutherlandアルゴ
リズムに基づく図形領域判別処理をより高速に行えるよ
うにすることを目的とする。
As shown in FIG.
In the conventional graphic area discriminating apparatus, a large number of instructions are executed in order to discriminate in which area the polygon exists based on the Cohen Sutherland algorithm.
Therefore, it took a long time to execute the above algorithm. Therefore, an object of the present invention is to make it possible to perform the graphic area discrimination processing based on the Cohen Sutherland algorithm at a higher speed.

【0026】[0026]

【課題を解決するための手段】本発明の図形領域判別装
置は、表示領域とその周囲にある非表示領域とで成る複
数の領域中のどこに図形が存在しているかを判別するた
めの図形領域判別装置において、上記図形を構成する各
頂点が属している領域にそれぞれ割り当てられている論
理コードを各頂点の頂点コードとして求め、求めた各頂
点の頂点コードをレジスタに格納する頂点コード算出手
段と、上記頂点コード算出手段により上記レジスタに格
納された各頂点の頂点コードの論理積をとる論理積ゲー
トと、上記頂点コード算出手段により上記レジスタに格
納された各頂点の頂点コードの論理和をとる論理和ゲー
トと、上記論理積ゲートおよび上記論理和ゲートの出力
情報に基づいて、上記図形がどの領域に存在しているか
を判別する領域判別手段とを備えたことを特徴とする。
A graphic area discriminating apparatus of the present invention is a graphic area for discriminating where a graphic exists in a plurality of areas consisting of a display area and a non-display area around the display area. In the discriminating device, a vertex code calculating means for obtaining a logic code assigned to each region to which each vertex constituting the above figure belongs as a vertex code of each vertex and storing the obtained vertex code of each vertex in a register. , A logical sum of the logical product gate of the vertex codes stored in the register by the vertex code calculation means, and the logical sum of the vertex code of each vertex stored in the register by the vertex code calculation means A logical sum gate, and an area judgment that determines in which area the figure exists based on the output information of the logical product gate and the logical sum gate. Characterized by comprising a means.

【0027】本発明の他の特徴とするところは、上記頂
点コード算出手段は、上記図形を構成する各頂点の座標
値と上記複数の領域の中心にある表示領域の境界値とを
各頂点ごとに順次比較し、その比較結果に応じたフラグ
情報を順次出力する比較手段と、上記比較手段より順次
出力されるフラグ情報を順次シフトさせながら格納して
いくことにより上記各頂点の頂点コードを得るシフトレ
ジスタとで構成されることを特徴とする。
Another feature of the present invention is that the vertex code calculating means sets, for each vertex, the coordinate value of each vertex forming the graphic and the boundary value of the display area at the center of the plurality of areas. To sequentially output the flag information according to the comparison result and the flag information sequentially output from the comparison means while sequentially shifting and storing the obtained vertex code of each vertex. And a shift register.

【0028】本発明のその他の特徴とするところは、上
記論理積ゲートにより求められた各頂点コードの論理積
を構成する各ビットの論理和をとる第1の論理和ゲート
を上記論理積ゲートの後段に更に設けるとともに、上記
論理和ゲートにより求められた各頂点コードの論理和を
構成する各ビットの論理和をとる第2の論理和ゲートを
上記論理和ゲートの後段に更に設け、上記領域判別手段
は、上記第1の論理和ゲートの出力情報が“1”である
ときには上記図形が完全不可視の領域にあると判別し、
上記第2の論理和ゲートの出力情報が“0”であるとき
には上記図形が完全可視の領域にあると判別し、それ以
外のときには上記図形が完全不可視または部分可視の領
域にあると判別することを特徴とする。
Another feature of the present invention is that the first logical sum gate for taking the logical sum of each bit forming the logical product of each vertex code obtained by the logical product gate is the logical product gate of the logical product gate. A second OR gate, which is further provided in the latter stage and which ORs each bit forming the OR of the respective vertex codes obtained by the OR gate, is further provided in the latter stage of the OR gate to determine the area. The means determines that the figure is in a completely invisible area when the output information of the first OR gate is "1",
When the output information of the second OR gate is "0", it is determined that the figure is in the completely visible area, and in other cases, it is determined that the figure is in the completely invisible or partially visible area. Is characterized by.

【0029】本発明のその他の特徴とするところは、表
示領域とその周囲にある非表示領域とで成る複数の領域
中のどこに図形が存在しているかを判別するための図形
領域判別装置において、上記図形を構成する各頂点の座
標値と上記複数の領域の中心にある表示領域の境界値と
を各頂点ごとに順次比較し、その比較結果に応じたフラ
グ情報を順次出力する比較手段と、上記比較手段より順
次出力されるフラグ情報を順次シフトさせながら格納し
ていくことにより各頂点の頂点コードを得るシフトレジ
スタと、上記シフトレジスタに格納された各頂点コード
の論理積を構成する各ビットの中に“1”のビットが少
なくとも1つあるかどうかによって“1”または“0”
のANDコードを出力するように構成した論理積ゲート
手段と、上記シフトレジスタに格納された各頂点コード
の論理和を構成する各ビットの中に“1”のビットが少
なくとも1つあるかどうかによって“1”または“0”
のORコードを出力するように構成した論理和ゲート手
段と、上記論理積ゲート手段より出力されるANDコー
ドが“1”であるときには上記図形が完全不可視の領域
にあると判別し、上記論理和ゲート手段より出力される
ORコードが“0”であるときには上記図形が完全可視
の領域にあると判別し、それ以外のときには上記図形が
完全不可視または部分可視の領域にあると判別する領域
判別手段とを備えたことを特徴とする。
Another feature of the present invention is that in a graphic area discriminating apparatus for discriminating where a graphic is present in a plurality of areas consisting of a display area and a non-display area around the display area, Comparing means for sequentially comparing the coordinate values of the vertices forming the figure and the boundary value of the display area at the center of the plurality of areas for each vertex, and sequentially outputting flag information according to the comparison result, A bit that forms a logical product of a shift register that obtains the vertex code of each vertex by sequentially storing the flag information that is sequentially output from the comparison means while shifting the flag information, and each bit that forms the logical product of each vertex code stored in the shift register. "1" or "0" depending on whether there is at least one "1" bit in the
AND gate means configured to output the AND code and the presence or absence of at least one "1" bit in each bit forming the logical sum of the vertex codes stored in the shift register. "1" or "0"
When the AND code output from the logical product gate means is "1", it is determined that the figure is in a completely invisible area, and the logical sum is calculated. An area discriminating means for discriminating that the figure is in a completely visible area when the OR code outputted from the gate means is "0", and otherwise discriminating that the figure is in a completely invisible or partially visible area. It is characterized by having and.

【0030】本発明のその他の特徴とするところは、上
記図形の存在する空間は、上記表示領域が長方形であ
り、上記非表示領域が上記表示領域の上下左右方向に対
して8個に分割された2次元空間であることを特徴とす
る。
Another feature of the present invention is that, in the space where the graphic exists, the display area is rectangular, and the non-display area is divided into eight in the vertical and horizontal directions of the display area. It is characterized by being a two-dimensional space.

【0031】本発明のその他の特徴とするところは、上
記図形の存在する空間は、上記表示領域が直方体であ
り、上記非表示領域が上記表示領域の上下左右前後方向
に対して28個に分割された3次元空間であることを特
徴とする。
Another feature of the present invention is that, in the space in which the figure exists, the display area is a rectangular parallelepiped, and the non-display area is divided into 28 in the vertical, horizontal, and front-back directions of the display area. It is a three-dimensional space that has been created.

【0032】本発明は上記技術手段より成るので、各頂
点の頂点コードの論理積を求める部分と論理和を求める
部分とがそれぞれ論理積ゲートおよび論理和ゲートによ
りハードウェア的に構成され、各頂点の頂点コードが求
められた時点でそれらの論理積と論理和とが自動的に直
ちに求められるようになり、論理積や論理和を従来のよ
うに計算によって求めなくても済む。
Since the present invention comprises the above-mentioned technical means, the portion for obtaining the logical product of the vertex codes of each vertex and the portion for obtaining the logical sum are respectively constituted by the logical product gate and the logical sum gate in hardware, and each vertex is formed. The logical product and the logical sum of them are automatically calculated immediately when the vertex code of is calculated, and the logical product and the logical sum do not have to be calculated by the conventional method.

【0033】本発明の他の特徴によれば、各頂点の頂点
コードは、各頂点の座標値と表示領域の境界値とを各頂
点ごとに順次比較し、比較処理を1つ実行するごとに比
較結果のフラグ情報をシフトレジスタに順次転送するだ
けで求められるので、従来に比べてより少ない計算手順
によって各頂点コードが求められるようになる。
According to another feature of the present invention, the vertex code of each vertex sequentially compares the coordinate value of each vertex and the boundary value of the display area for each vertex, and every time one comparison process is executed. Since the flag information of the comparison result is obtained only by sequentially transferring it to the shift register, each vertex code can be obtained by a smaller calculation procedure than in the conventional case.

【0034】本発明のその他の特徴によれば、領域判別
を行う際に条件分岐命令の条件として参照する情報を求
めるための機構が第1、第2の論理和ゲートによりハー
ドウェア的に構成されているので、そのような参照情報
が各頂点コードの論理積および論理和から自動的に直ち
に求められるようになり、従来のように計算によって求
めなくても済む。
According to another feature of the present invention, a mechanism for obtaining information to be referred to as a condition of a conditional branch instruction at the time of area discrimination is constructed by the first and second OR gates in hardware. Therefore, such reference information can be automatically obtained immediately from the logical product and the logical sum of the respective vertex codes, and it is not necessary to obtain it by calculation as in the conventional case.

【0035】[0035]

【発明の実施の形態】以下、本発明の一実施形態を図面
に基づいて説明する。図1は、表示領域とその周囲にあ
る複数に分割された非表示領域とで成る複数の領域中の
どこに図形が存在しているかを判別するための本実施形
態に係る図形領域判別装置の構成を示す図であり、図2
は、この図形領域判別を行うための本実施形態によるプ
ログラムの例を示す図である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below with reference to the drawings. FIG. 1 shows the configuration of a graphic region discriminating apparatus according to the present embodiment for discriminating where a graphic is present in a plurality of regions consisting of a display region and a plurality of non-display regions surrounding the display region. 2 is a diagram showing FIG.
FIG. 6 is a diagram showing an example of a program according to the present embodiment for performing this graphic area determination.

【0036】なお、図2のプログラムでは、表示領域
(クリッピングウィンドウ)が、 −W≦X≦W,−W≦Y≦W,−W≦Z≦W の範囲でなる立方体であると仮定している。ただし、
X,Y,Zはそれぞれクリッピングウィンドウの中心を
始点とした左右方向、上下方向、前後方向の座標値であ
る。また、処理中のポリゴンの各頂点の座標を(X[i],
Y[i],Z[i] )としている(i=0,1,2)。この場
合、非表示領域は、表示領域の上下左右前後方向に28
個の領域に分割される。
In the program of FIG. 2, it is assumed that the display area (clipping window) is a cube in the range of -W≤X≤W, -W≤Y≤W, -W≤Z≤W. There is. However,
X, Y, and Z are coordinate values in the left-right direction, the up-down direction, and the front-back direction, starting from the center of the clipping window. In addition, the coordinates of each vertex of the polygon being processed are (X [i],
Y [i], Z [i]) (i = 0, 1, 2). In this case, the non-display area is 28 in the up, down, left, right, front, and back directions of the display area.
It is divided into individual areas.

【0037】図1において、1はALUであり、2つの
レジスタ2,3に格納される情報を用いて以下に述べる
ような演算を行う。すなわち、ALU1は、3次元物体
の構成するポリゴン(本実施形態の場合は三角形)の各
頂点の座標値と表示領域の境界値とを各頂点ごとに順次
比較し、その比較結果に応じた1ビットのフラグ情報を
順次出力する演算を行う。このとき、1つの比較処理が
行われるごとに順次出力されるフラグ情報は、シフトレ
ジスタ4に順次格納されていく。
In FIG. 1, reference numeral 1 is an ALU, which uses the information stored in the two registers 2 and 3 to perform the following calculation. That is, the ALU 1 sequentially compares, for each vertex, the coordinate value of each vertex of a polygon (triangle in the case of the present embodiment) that forms a three-dimensional object, and the boundary value of the display area is sequentially compared. An operation of sequentially outputting bit flag information is performed. At this time, the flag information that is sequentially output each time one comparison process is performed is sequentially stored in the shift register 4.

【0038】つまり、ALU1は、図2に示したプログ
ラム中の(a)の部分に示した演算を行う。ここで、co
mpare(a,b)の実行命令は、a>bであれば、図2のシフ
トレジスタ4に“1”のフラグ情報を転送し、そうでな
い場合は“0”を転送するようにする命令である。
That is, the ALU 1 performs the operation shown in the part (a) in the program shown in FIG. Where co
The execution instruction of mpare (a, b) is an instruction to transfer flag information of "1" to the shift register 4 of FIG. 2 if a> b, and to transfer "0" otherwise. is there.

【0039】上記シフトレジスタ4は、三角形の各頂点
に対応した6ビット構成で成る3つのシフトレジスタ4
-1,4-2,4-3が従属接続されて構成されている。した
がって、上記compare(a,b)の実行命令を1つ実行するご
とに比較結果のフラグ情報をシフトレジスタ4に順次転
送していくことにより、上記命令を18回実行した時点
で3つのシフトレジスタ4-1,4-2,4-3に各頂点の頂
点コードが格納されることとなる。
The shift register 4 comprises three shift registers 4 each having a 6-bit structure corresponding to each vertex of the triangle.
-1 , 4 -2 , 4 -3 are connected in cascade. Therefore, by sequentially transferring the flag information of the comparison result to the shift register 4 every time one of the execution instructions of the above compare (a, b) is executed, three shift registers are executed when the above instruction is executed 18 times. The vertex code of each vertex is stored in 4 -1 , 4 -2 , 4 -3 .

【0040】なお、これら各頂点の頂点コードは、図4
(a)(b)の部分で求めた頂点コードと同様に、上記
三角形を構成する各頂点が複数(本実施形態の場合は2
9個)に分割された領域中のどこに属しているかによっ
て、それぞれの領域に割り当てられている論理コード
(図5参照)に応じて決められるものである。
The vertex code of each of these vertices is shown in FIG.
Similar to the vertex code obtained in the portions (a) and (b), there are a plurality of vertices forming the triangle (2 in the case of the present embodiment).
It is decided according to the logical code (see FIG. 5) assigned to each area, depending on where it belongs to the area divided into 9 areas.

【0041】5は論理積ゲート手段であり、上記シフト
レジスタ4に格納された各頂点の頂点コードの論理積を
構成する各ビットの中に“1”のビットが少なくとも1
つあるかどうかによって“1”または“0”のANDコ
ードを出力するように構成されている。すなわち、上記
論理積ゲート手段5は、上記シフトレジスタ4に格納さ
れた各頂点の頂点コードの論理積をとるための6個の論
理積ゲート5-1〜5-6と、上記6個の論理積ゲート5-1
〜5-6により求められた論理積を構成する各ビットの論
理和をとる論理和ゲート5-7とで構成される。
A logical product gate means 5 has at least one "1" bit among the respective bits constituting the logical product of the vertex codes of the respective vertices stored in the shift register 4.
It is configured to output an AND code of "1" or "0" depending on whether there is one. That is, the logical product gate means 5 has six logical product gates 5 -1 to 5 -6 for taking a logical product of the vertex codes of the respective vertices stored in the shift register 4, and the six logical products. Product gate 5 -1
.About.5 -6 and a logical sum gate 5 -7 that calculates the logical sum of the bits forming the logical product.

【0042】上記6個の論理積ゲート5-1〜5-6のう
ち、1番目の論理積ゲート5-1では、各頂点コードの最
下位ビットa0,b0,c0の論理積をとり、2番目の
論理積ゲート(図示せず)では、各頂点コードの第2ビ
ットa1,b1,c1の論理積をとり、・・・6番目の
論理積ゲート5-6では、各頂点コードの最上位ビットa
5,b5,c5の論理積をとる。これにより、上記6個
の論理積ゲート5-1〜5 -6から各頂点コードの論理積が
6ビットで出力される。
The above six AND gates 5-1~ 5-6Horse
The first AND gate 5-1Then, the maximum of each vertex code
The logical product of the lower bits a0, b0, c0 is taken and the second
In the AND gate (not shown), the second bit of each vertex code is
AND of the a1, b1, c1
AND gate 5-6Then, the most significant bit a of each vertex code
The logical product of 5, b5 and c5 is calculated. As a result, the above 6
AND gate 5-1~ 5 -6From the logical product of each vertex code
It is output in 6 bits.

【0043】そして、上記6個の論理積ゲート5-1〜5
-6の後段に接続された論理和ゲート5-7により、6ビッ
トの論理積を構成する各ビットの論理和がとられる。し
たがって、各頂点コードの論理積を構成する各ビットの
中に、“1”のビットが少なくとも1つあるときには
“1”のANDコードが出力され、また“1”のビット
が1つもないときには“0”のANDコードが出力され
るようになる。このようにして出力されたANDコード
は、フラグレジスタ7中のANDコードレジスタ7bに
格納される。
Then, the above six AND gates 5 -1 to 5
The logical sum gate 5-7 connected to the subsequent stage of -6 takes the logical sum of each bit forming the logical product of 6 bits. Therefore, an AND code of "1" is output when there is at least one bit of "1" in each bit forming the logical product of each vertex code, and when there is no bit of "1", "AND" is output. An AND code of "0" will be output. The AND code output in this way is stored in the AND code register 7b in the flag register 7.

【0044】6は論理和ゲート手段であり、上記シフト
レジスタ4に格納された各頂点の頂点コードの論理和を
構成する各ビットの中に“1”のビットが少なくとも1
つあるかどうかによって“1”または“0”のORコー
ドを出力するように構成されている。すなわち、上記論
理和ゲート手段6は、上記シフトレジスタ4に格納され
た各頂点コードを構成する各ビットの論理和をとるため
の3個の論理和ゲート6-1〜6-3と、上記3個の論理和
ゲート6-1〜6-3から出力される各ビットの論理和をと
る論理和ゲート6-4とで構成される。
Reference numeral 6 denotes a logical sum gate means which has at least one bit "1" among the bits constituting the logical sum of the vertex codes of the respective vertices stored in the shift register 4.
It is configured to output an OR code of "1" or "0" depending on whether there is one. That is, the logical sum gate means 6 includes three logical sum gates 6 -1 to 6 -3 for logically summing the respective bits constituting each vertex code stored in the shift register 4, and the above 3 And OR gates 6 -4 that take the OR of the respective bits output from the OR gates 6 -1 to 6 -3 .

【0045】上記3個の論理和ゲート6-1〜6-3のう
ち、1番目の論理和ゲート6-1では、第1の頂点コード
を構成する6ビットa0〜a5の論理和をとり、2番目
の論理和ゲート(図示せず)では、第2の頂点コードを
構成する6ビットb0〜b5の論理和をとり、3番目の
論理和ゲート6-3では、第3の頂点コードを構成する6
ビットc0〜c5の論理和をとる。これにより、上記3
個の論理和ゲート6-1〜6-3から3ビットの情報が出力
される。
Of the three OR gates 6 -1 to 6 -3 , the first OR gate 6 -1 takes the logical sum of 6 bits a0 to a5 forming the first vertex code, in the second OR gate (not shown), takes the logical sum of the 6 bits b0~b5 constituting the second vertex code, the third OR gate 6-3, constituting a third vertex code Do 6
The logical sum of bits c0 to c5 is calculated. As a result, the above 3
3-bit information is output from each of the OR gates 6 -1 to 6 -3 .

【0046】そして、上記3個の論理和ゲート6-1〜6
-3の後段に接続された論理和ゲート6-4により、上記3
ビットの情報を構成する各ビットの論理和がとられる。
したがって、上記3個の頂点コードを構成する18ビッ
トの中に、“1”のビットが少なくとも1つあるときに
は“1”のORコードが出力され、また“1”のビット
が1つもないときには“0”のORコードが出力される
ようになる。このようにして出力されたORコードは、
フラグレジスタ7中のORコードレジスタ7cに格納さ
れる。
Then, the above three OR gates 6 -1 to 6
-3 is connected to the latter stage by the OR gate 6 -4.
The logical sum of each bit forming the bit information is taken.
Therefore, an OR code of "1" is output when at least one bit of "1" is included in the 18 bits forming the above three vertex codes, and when there is no bit of "1", "OR" is output. An OR code of "0" will be output. The OR code output in this way is
It is stored in the OR code register 7c in the flag register 7.

【0047】なお、上記論理和ゲート手段6は、上記の
ような構成に限らず、論理積ゲート手段5と同様に、上
記シフトレジスタ4に格納された各頂点の頂点コードの
論理和をとるための6個の論理和ゲートと、上記6個の
論理和ゲートにより求められた論理和を構成する各ビッ
トの論理和をとる論理和ゲートとで構成するようにして
もよい。
The logical sum gate means 6 is not limited to the above-mentioned configuration, and the logical sum of the vertex codes of the respective vertices stored in the shift register 4 is taken like the logical product gate means 5. It may be configured by the six OR gates and the OR gate for ORing each bit forming the OR obtained by the six OR gates.

【0048】この場合には、上記6個の論理和ゲートの
うち、1番目の論理和ゲートでは、各頂点コードの最下
位ビットa0,b0,c0の論理和をとり、2番目の論
理和ゲートでは、各頂点コードの第2ビットa1,b
1,c1の論理和をとり、・・・6番目の論理和ゲート
では、各頂点コードの最上位ビットa5,b5,c5の
論理和をとる。これにより、上記6個の論理和ゲートか
ら各頂点コードの論理和が6ビットで出力される。
In this case, of the six OR gates, the first OR gate calculates the OR of the least significant bits a0, b0, c0 of each vertex code and the second OR gate. Then, the second bits a1 and b of each vertex code
The logical sum of 1 and c1 is calculated, and the sixth logical sum gate calculates the logical sum of the most significant bits a5, b5 and c5 of each vertex code. As a result, the logical sum of each vertex code is output in 6 bits from the above 6 logical sum gates.

【0049】そして、上記6個の論理和ゲートの後段に
接続された論理和ゲートにより、6ビットの論理和を構
成する各ビットの論理和がとられる。このように構成し
た場合にも、上記3個の頂点コードを構成する18ビッ
トの中に“1”のビットが少なくとも1つあるときには
“1”のORコードが出力され、また“1”のビットが
1つもないときには“0”のORコードが出力されるよ
うになる。
Then, the logical sum gates connected to the subsequent stages of the above-mentioned six logical sum gates take the logical sum of each bit forming the logical sum of 6 bits. Even in the case of such a configuration, when there is at least one "1" bit in the 18 bits forming the above three vertex codes, the OR code of "1" is output, and the bit of "1" is also output. When there is not even one, an OR code of "0" is output.

【0050】上述したフラグレジスタ7は、ANDコー
ドレジスタ7bおよびORコードレジスタ7cの他に、
サインレジスタ7aを備えており、上記ALU1におけ
る加減算などの演算結果が負の値であったことを表すフ
ラグ情報などが格納されるが、これは本実施形態におい
て特徴的なものではない。本実施形態において特に利用
するのはANDコードおよびORコードである。なお、
これらの情報は以下に述べる条件判定の動作時にタイミ
ングよく得られるので、実際には物理的なレジスタは必
要ではない。
The flag register 7 described above includes, in addition to the AND code register 7b and the OR code register 7c,
The sine register 7a is provided to store flag information indicating that the operation result of addition and subtraction in the ALU1 is a negative value, but this is not a characteristic of the present embodiment. The AND code and the OR code are particularly used in this embodiment. In addition,
Since these pieces of information are obtained with good timing at the time of the operation of the condition determination described below, no physical register is actually necessary.

【0051】8は条件判定部であり、上記ANDコード
レジスタ7b内のANDコード(実際には上記論理積ゲ
ート手段5より出力されるANDコード)が“1”であ
るかどうかを見て、そうであれば、各頂点コードの論理
積が“000000”ではないということなので、該当
する三角形は完全不可視の領域にある(完全に表示領域
外にある)と判別する。
Reference numeral 8 is a condition judging unit, which checks whether the AND code in the AND code register 7b (actually, the AND code output from the AND gate means 5) is "1". If so, it means that the logical product of the respective vertex codes is not “000000”, and therefore it is determined that the corresponding triangle is in the completely invisible area (completely outside the display area).

【0052】条件判定部8また、上記ORコードレジス
タ7c内のORコード(実際には上記論理和ゲート手段
6より出力されるORコード)が“0”であるかどうか
を見て、そうであれば、各頂点コードの論理和が“00
0000”であるということなので、該当する三角形は
完全可視の領域にある(完全に表示領域内にある)と判
別する。
Condition judging section 8 Also, by checking whether the OR code in the OR code register 7c (in fact, the OR code output from the OR gate means 6) is "0", it is determined. For example, the logical sum of each vertex code is "00
Since it is "0000", it is determined that the corresponding triangle is in the completely visible area (completely in the display area).

【0053】また、条件判定部8は、上記2つの条件を
何れも満たさないと判断したときには、該当する三角形
は完全不可視または部分可視の領域にある(完全に表示
領域外にあるか表示領域と非表示領域とにまたがってい
る)と判別する。
When the condition judging unit 8 judges that neither of the above two conditions is satisfied, the corresponding triangle is in the completely invisible or partially visible area (whether it is completely outside the display area or the display area). It straddles the non-display area).

【0054】すなわち、上記条件判定部8は、図2に示
したプログラム中の(b)の部分の処理を行っており、
その判別結果に応じて、プログラムカウンタ10の値を
1だけインクリメントしたアドレス値をセレクタ9で選
択するか、あるいは次の条件判定を行うべく分岐先のア
ドレス値をセレクタ9で選択するように制御する。
That is, the condition judging section 8 carries out the processing of the part (b) in the program shown in FIG.
Depending on the result of the determination, the selector 9 selects an address value obtained by incrementing the value of the program counter 10 by one, or the selector 9 selects the address value of the branch destination for the next condition determination. .

【0055】以上のように、本実施形態によれば、各頂
点の頂点コードの論理積を求める部分と論理和を求める
部分とをシフトレジスタ4、論理積ゲート手段5および
論理和ゲート手段6によりハードウェア的に構成したの
で、ALU1により18回の比較演算が実行されて18
個目のフラグ情報がシフトレジスタ4に転送された時点
で、各頂点コードの論理積と論理和とが自動的に求めら
れるようになる。したがって、従来ALU31が行って
いた図4(c)の部分の計算を行うことなく、各頂点コ
ードの論理積や論理和を直ちに求めることができる。
As described above, according to this embodiment, the shift register 4, the logical product gate means 5, and the logical sum gate means 6 are used to calculate the logical product of the vertex codes of each vertex and the logical sum. Since it is configured in hardware, 18 comparison operations are executed by ALU1 and
The logical product and the logical sum of the respective vertex codes are automatically obtained at the time when the flag information of the number is transferred to the shift register 4. Therefore, the logical product or the logical sum of each vertex code can be immediately obtained without performing the calculation of the portion of FIG. 4C which is conventionally performed by the ALU 31.

【0056】また、本実施形態によれば、各頂点の頂点
コードは、図2(a)に示したように各頂点の座標値と
表示領域の境界値とを各頂点ごとに順次比較して、比較
処理を1つ実行するごとに比較結果のフラグ情報を上記
シフトレジスタ4に順次転送するだけで求められるよう
になる。したがって、図4(a)に示した初期化処理が
不要になるだけでなく、ALU1における図2(a)の
演算も図4(b)に示した従来の演算に比べてより簡単
になり、各頂点コードをより簡単な手続きで求めること
ができるようになる。
According to this embodiment, the vertex code of each vertex is obtained by sequentially comparing the coordinate value of each vertex and the boundary value of the display area for each vertex as shown in FIG. , The flag information of the comparison result is sequentially transferred to the shift register 4 every time the comparison process is executed. Therefore, not only is the initialization process shown in FIG. 4 (a) unnecessary, but the operation of FIG. 2 (a) in the ALU1 is simpler than the conventional operation shown in FIG. 4 (b). Each vertex code can be obtained by a simpler procedure.

【0057】さらに、本実施形態によれば、条件判定部
8で図形の領域判別を行う際に条件分岐命令の条件とし
て参照する情報を求めるための機構を論理和ゲート
-7,6-4によりハードウェア的に構成したので、その
ような参照情報(ANDコードおよびORコード)も計
算を行うことなく自動的に求められるようになる。
Further, according to the present embodiment, a mechanism for obtaining information to be referred to as the condition of the conditional branch instruction when the condition determining unit 8 determines the area of the graphic is OR gates 5 -7 , 6 -4. Since it is configured by hardware as described above, such reference information (AND code and OR code) can be automatically obtained without performing calculation.

【0058】すなわち、図4(d)に示した従来の条件
判定では、条件判定に使用している論理積(and_code)
や論理和 (or_code) が3次元空間の場合には6ビット
であるので、その論理積や論理和に0(10)を加算してそ
の結果得られる1ビットのフラグ情報を見る必要があっ
た。これに対して本実施形態では、条件判定に使用可能
な1ビットのANDコードやORコードがハードウェア
的な構成により自動的に求められるので、条件判定を直
ちに行うことができるようになる。
That is, in the conventional condition determination shown in FIG. 4D, the logical product (and_code) used for the condition determination is used.
If the or logical sum (or_code) is 3 bits, it is 6 bits, so it was necessary to add 0 (10) to the logical product or logical sum and see the 1 bit flag information obtained as a result. . On the other hand, in the present embodiment, since the 1-bit AND code and OR code that can be used for the condition determination are automatically obtained by the hardware configuration, the condition determination can be performed immediately.

【0059】以上の結果、本実施形態では、図形領域判
別の際に実行する命令数を従来の半分程度に削減するこ
とができ、処理の高速化を実現することができる。
As a result, according to the present embodiment, the number of instructions to be executed at the time of discriminating the graphic area can be reduced to about half that of the conventional method, and the processing speed can be increased.

【0060】[0060]

【発明の効果】本発明は上述したように、シフトレジス
タを設け、比較手段による比較命令実行ごとに比較結果
のフラグ情報を上記シフトレジスタに転送して各頂点コ
ードを求める。さらに、上記シフトレジスタに格納した
各頂点コードからそれらの論理積と論理和とをハードウ
ェア的に構成された論理積ゲート手段および論理和ゲー
ト手段により自動的に求めるとともに、その結果を領域
判別の際に条件分岐命令の条件として直接参照できるよ
うにする機構を設けたので、少ないハードウェア量で、
実行する命令数を従来に比べて格段に少なくすることが
でき、図形領域判別を行う処理を高速にすることができ
る。
As described above, according to the present invention, the shift register is provided, and the flag information of the comparison result is transferred to the shift register every time the comparison instruction is executed by the comparison means to obtain each vertex code. Further, the logical product and the logical sum of the vertex codes stored in the shift register are automatically obtained by the logical product gate means and the logical sum gate means configured by hardware, and the result is determined by the area discrimination. At that time, since a mechanism that allows direct reference as the condition of the conditional branch instruction is provided, with a small amount of hardware,
The number of instructions to be executed can be remarkably reduced as compared with the related art, and the processing for determining the graphic area can be speeded up.

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

【図1】本発明の一実施形態である図形領域判別装置の
構成例を示す図である。
FIG. 1 is a diagram showing an example of the configuration of a graphic region discriminating apparatus according to an embodiment of the present invention.

【図2】本実施形態の図形領域判別装置で実行するプロ
グラムの例を示す図である。
FIG. 2 is a diagram showing an example of a program executed by the graphic area discrimination device of the present embodiment.

【図3】従来の図形領域判別装置の構成例を示す図であ
る。
FIG. 3 is a diagram showing a configuration example of a conventional graphic area discrimination device.

【図4】従来の図形領域判別装置で実行するプログラム
の例を示す図である。
FIG. 4 is a diagram showing an example of a program executed by a conventional graphic area discrimination device.

【図5】Cohen Sutherlandアルゴリズムに基づく図形領
域判別処理を説明するための図である。
FIG. 5 is a diagram for explaining graphic region determination processing based on the Cohen Sutherland algorithm.

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

1 ALU 2,3 レジスタ 4 シフトレジスタ 5 論理積ゲート手段 5-1〜5-6 論理積ゲート 5-7 論理和ゲート 6 論理和ゲート手段 6-1〜6-3 論理和ゲート 6-4 論理和ゲート 7 フラグレジスタ 7b ANDコードレジスタ 7c ORコードレジスタ 8 条件判定部 9 セレクタ 10 プログラムカウンタ1 ALU 2,3 register 4 shift register 5 AND gate means 5 -1 to 5 -6 AND gate 5 -7 OR gate 6 OR gate means 6 -1 to 6 -3 OR gate 6 -4 OR gate Gate 7 Flag register 7b AND code register 7c OR code register 8 Condition determination unit 9 Selector 10 Program counter

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 表示領域とその周囲にある非表示領域と
で成る複数の領域中のどこに図形が存在しているかを判
別するための図形領域判別装置において、 上記図形を構成する各頂点が属している領域にそれぞれ
割り当てられている論理コードを各頂点の頂点コードと
して求め、求めた各頂点の頂点コードをレジスタに格納
する頂点コード算出手段と、 上記頂点コード算出手段により上記レジスタに格納され
た各頂点の頂点コードの論理積をとる論理積ゲートと、 上記頂点コード算出手段により上記レジスタに格納され
た各頂点の頂点コードの論理和をとる論理和ゲートと、 上記論理積ゲートおよび上記論理和ゲートの出力情報に
基づいて、上記図形がどの領域に存在しているかを判別
する領域判別手段とを備えたことを特徴とする図形領域
判別装置。
1. A graphic area discriminating apparatus for discriminating where a graphic is present in a plurality of areas consisting of a display area and a non-display area around the display area, wherein each vertex forming the graphic belongs to The vertex code calculation means for obtaining the logic code assigned to each area as the vertex code of each vertex and storing the obtained vertex code of each vertex in the register, and the vertex code calculation means for storing the vertex code of each vertex in the register A logical product gate that takes the logical product of the vertex codes of the respective vertices, a logical sum gate that takes the logical sum of the vertex codes of the respective vertices stored in the register by the aforementioned vertex code calculation means, the aforementioned logical product gate and the aforementioned logical sum A graphic area, characterized by comprising area determining means for determining in which area the graphic is present based on output information from the gate. Another apparatus.
【請求項2】 上記頂点コード算出手段は、上記図形を
構成する各頂点の座標値と上記複数の領域の中心にある
表示領域の境界値とを各頂点ごとに順次比較し、その比
較結果に応じたフラグ情報を順次出力する比較手段と、 上記比較手段より順次出力されるフラグ情報を順次シフ
トさせながら格納していくことにより上記各頂点の頂点
コードを得るシフトレジスタとで構成されることを特徴
とする請求項1に記載の図形領域判別装置。
2. The apex code calculating means sequentially compares, for each apex, the coordinate value of each apex forming the graphic and the boundary value of the display area at the center of the plurality of areas. Comparing means for sequentially outputting corresponding flag information, and a shift register for obtaining the vertex code of each vertex by sequentially shifting and storing the flag information sequentially outputted by the comparing means. The graphic area discriminating apparatus according to claim 1, characterized in that
【請求項3】 上記論理積ゲートにより求められた各頂
点コードの論理積を構成する各ビットの論理和をとる第
1の論理和ゲートを上記論理積ゲートの後段に更に設け
るとともに、 上記論理和ゲートにより求められた各頂点コードの論理
和を構成する各ビットの論理和をとる第2の論理和ゲー
トを上記論理和ゲートの後段に更に設け、 上記領域判別手段は、上記第1の論理和ゲートの出力情
報が“1”であるときには上記図形が完全不可視の領域
にあると判別し、上記第2の論理和ゲートの出力情報が
“0”であるときには上記図形が完全可視の領域にある
と判別し、それ以外のときには上記図形が完全不可視ま
たは部分可視の領域にあると判別することを特徴とする
請求項1または2に記載の図形領域判別装置。
3. A first logical sum gate for calculating a logical sum of respective bits forming a logical product of the respective vertex codes obtained by the logical product gate is further provided in a stage subsequent to the logical product gate, and the logical sum is provided. A second logical sum gate for taking the logical sum of the respective bits forming the logical sum of the respective vertex codes obtained by the gate is further provided at the subsequent stage of the logical sum gate, and the area discriminating means is provided for the first logical sum. When the output information of the gate is "1", it is determined that the figure is in the completely invisible area, and when the output information of the second OR gate is "0", the figure is in the completely visible area. 3. The graphic area discriminating apparatus according to claim 1, wherein the graphic area discriminating apparatus judges that the graphic is in a completely invisible or partially visible area in all other cases.
【請求項4】 表示領域とその周囲にある非表示領域と
で成る複数の領域中のどこに図形が存在しているかを判
別するための図形領域判別装置において、 上記図形を構成する各頂点の座標値と上記複数の領域の
中心にある表示領域の境界値とを各頂点ごとに順次比較
し、その比較結果に応じたフラグ情報を順次出力する比
較手段と、 上記比較手段より順次出力されるフラグ情報を順次シフ
トさせながら格納していくことにより各頂点の頂点コー
ドを得るシフトレジスタと、 上記シフトレジスタに格納された各頂点コードの論理積
を構成する各ビットの中に“1”のビットが少なくとも
1つあるかどうかによって“1”または“0”のAND
コードを出力するように構成した論理積ゲート手段と、 上記シフトレジスタに格納された各頂点コードの論理和
を構成する各ビットの中に“1”のビットが少なくとも
1つあるかどうかによって“1”または“0”のORコ
ードを出力するように構成した論理和ゲート手段と、 上記論理積ゲート手段より出力されるANDコードが
“1”であるときには上記図形が完全不可視の領域にあ
ると判別し、上記論理和ゲート手段より出力されるOR
コードが“0”であるときには上記図形が完全可視の領
域にあると判別し、それ以外のときには上記図形が完全
不可視または部分可視の領域にあると判別する領域判別
手段とを備えたことを特徴とする図形領域判別装置。
4. A graphic area discriminating apparatus for discriminating where a graphic is present in a plurality of areas consisting of a display area and a non-display area around the display area, wherein coordinates of vertices forming the graphic are provided. The value and the boundary value of the display area in the center of the plurality of areas are sequentially compared for each vertex and the flag information corresponding to the comparison result is sequentially output, and the flag sequentially output by the comparison means. A bit of "1" is included in each bit forming the logical product of the vertex code stored in the shift register and the shift register that obtains the vertex code of each vertex by sequentially shifting and storing the information. AND of "1" or "0" depending on whether there is at least one
Depending on whether there is at least one bit of "1" among the bits forming the logical sum of the vertex codes stored in the shift register and the AND gate means configured to output the code, "1" When the AND code output from the AND gate means configured to output an OR code of "" or "0" is "1", it is determined that the figure is in a completely invisible area. The OR output from the OR gate means
When the code is “0”, it is determined that the figure is in a completely visible area, and in other cases, the area determination means is for determining that the figure is in a completely invisible or partially visible area. The graphic area discriminating device.
【請求項5】 上記図形の存在する空間は、上記表示領
域が長方形であり、上記非表示領域が上記表示領域の上
下左右方向に対して8個に分割された2次元空間である
ことを特徴とする請求項1〜4の何れか1項に記載の図
形領域判別装置。
5. The space where the graphic exists is characterized in that the display area is a rectangle and the non-display area is a two-dimensional space divided into eight in the vertical and horizontal directions of the display area. The figure area discriminating device according to any one of claims 1 to 4.
【請求項6】 上記図形の存在する空間は、上記表示領
域が直方体であり、上記非表示領域が上記表示領域の上
下左右前後方向に対して28個に分割された3次元空間
であることを特徴とする請求項1〜4の何れか1項に記
載の図形領域判別装置。
6. The space in which the graphic exists is such that the display area is a rectangular parallelepiped, and the non-display area is a three-dimensional space divided into 28 in the vertical, horizontal, and front-back directions of the display area. The graphic area discriminating apparatus according to claim 1, wherein the graphic area discriminating apparatus is characterized in that:
JP8168421A 1996-06-07 1996-06-07 Graphic area discriminating device Withdrawn JPH09330419A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8168421A JPH09330419A (en) 1996-06-07 1996-06-07 Graphic area discriminating device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8168421A JPH09330419A (en) 1996-06-07 1996-06-07 Graphic area discriminating device

Publications (1)

Publication Number Publication Date
JPH09330419A true JPH09330419A (en) 1997-12-22

Family

ID=15867820

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8168421A Withdrawn JPH09330419A (en) 1996-06-07 1996-06-07 Graphic area discriminating device

Country Status (1)

Country Link
JP (1) JPH09330419A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6581087B1 (en) 1999-12-17 2003-06-17 Mitsubishi Denki Kabushiki Kaisha Floating point adder capable of rapid clip-code generation
US7315310B2 (en) 2002-07-31 2008-01-01 Sony Corporation Clipping device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6581087B1 (en) 1999-12-17 2003-06-17 Mitsubishi Denki Kabushiki Kaisha Floating point adder capable of rapid clip-code generation
US7315310B2 (en) 2002-07-31 2008-01-01 Sony Corporation Clipping device

Similar Documents

Publication Publication Date Title
US7119809B1 (en) Parallel architecture for graphics primitive decomposition
EP0356103B1 (en) Scan-conversion process and processor
US5249264A (en) Image display method and apparatus
JPH09326043A (en) Pixel fragment combining system and its method
US5253335A (en) Hidden-surface processing device, anti-aliasing method and three-dimensional graphics processing apparatus
JPH0749961A (en) Floating-point processor of graphic accelerator and method for execution of floating-point function
US6369828B1 (en) Method and system for efficiently using fewer blending units for antialiasing
US5369741A (en) Method for pre-clipping a line lying within a clipping rectangular region which is a subset of a region of a display screen
US7400325B1 (en) Culling before setup in viewport and culling unit
US6898692B1 (en) Method and apparatus for SIMD processing using multiple queues
JPH11259671A (en) Image displaying method and image display device executing the same
JPH04346182A (en) Method, program product and system for identifying polygon
JP2007528033A (en) Method and system for compositing 3D graphics images using a joint decision mechanism
US7315310B2 (en) Clipping device
JPH0869538A (en) Method and equipment for execution of clip check by using out code
JPH09330419A (en) Graphic area discriminating device
JPH10293853A (en) Clip processor
JP2002183741A (en) Figure processing method
US5563990A (en) Method and apparatus for processing a pick event
JPH09319892A (en) Image processor and its processing method
JP4106719B2 (en) Image processing device
JP3655723B2 (en) Coordinate transformation processing circuit for performing coordinate transformation and clipping determination
JP3583443B2 (en) Arithmetic device and arithmetic method
JPS63118982A (en) Arithmetic processing method for deciding whether points are inside or outside on polygon
JPH0567219A (en) Three-dimensional graphic hidden-surface elimination processing system

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: 20030902