JPH0821085B2 - Clipping circuit - Google Patents
Clipping circuitInfo
- Publication number
- JPH0821085B2 JPH0821085B2 JP1142513A JP14251389A JPH0821085B2 JP H0821085 B2 JPH0821085 B2 JP H0821085B2 JP 1142513 A JP1142513 A JP 1142513A JP 14251389 A JP14251389 A JP 14251389A JP H0821085 B2 JPH0821085 B2 JP H0821085B2
- Authority
- JP
- Japan
- Prior art keywords
- vertex
- clipping
- boundary
- input
- output
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Image Generation (AREA)
- Controls And Circuits For Display Device (AREA)
Description
【発明の詳細な説明】 産業上の利用分野 本発明はグラフィック・ディスプレイ装置のクリッピ
ング回路に関し、特に多角形を表す頂点の座標系列を入
力とし、クリッピング領域外部に存在する部分を除去
し、内部に存在する部分のみからなる新たな多角形を構
成する頂点の座標系列を出力するクリッピング回路に関
する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a clipping circuit of a graphic display device, and more particularly, to a coordinate sequence of vertices representing a polygon as an input, removing a portion existing outside the clipping region, and The present invention relates to a clipping circuit that outputs a coordinate series of vertices that form a new polygon consisting only of existing portions.
従来の技術 グラフィック・ディスプレイ装置において物体を表示
する際、ビューポートを越えて図形が現れる場合が生じ
うる。この場合表示図形がビューポート内に収まるよう
に物体のはみ出した部分を切り取る必要がある。この処
理はクリッピングと呼ばれ、切り取るための境界はクリ
ッピング境界と呼ばれ、一般に、表示物体が2次元物体
であるときはクリッピング境界は複数の2次元直線で構
成され、表示物体が3次元物体であるときはクリッピン
グ境界は複数の3次元平面で構成される。一方、表示物
体は2次元物体の場合でも3次元物体の場合でも多角形
の集合として近似的に表現されることが多い。従って、
クリッピングの処理は物体を構成する各々の多角形の不
要な部分を複数のクリッピング境界面または境界線に対
して切り取るという処理であると考えられる。(以後、
クリッピング境界面とクリッピング境界線をまとめて
「クリッピング境界」と呼ぶものとする)。このクリッ
ピング処理に対する有力な解法としては、アイ・イー・
サザーランドとジー・ダブリュー・ホッジマン(I.E.Su
ther−land and G.W.Hod geman)による「リエントラン
トポリゴンクリッピング」コミュニケーションズ・オブ
・ジ・エイ・シー・エム、第17巻、第1号(″Reentran
t Pol ygon Clipping,″CACM.Vol.17,No.1)、pp32−4
2、1974年、で示されている方法が挙げられる。この方
法では、クリッピングの対象となる多角形を頂点の列と
して入力し、クリッピング境界を構成する直線または平
面の1つの境界についてクリッピング処理を行い、1つ
の境界についての処理が終わると、その処理結果として
出力される頂点の列で構成される多角形を新たな入力と
して次の境界についてのクリッピング処理を行う。この
方法の特徴は前記の1つ1つのクリッピング境界ごとに
順次処理を行うことに加えて、多角形を頂点の系列と考
えて2つの隣接する頂点を結ぶ線分に対してクリッピン
グ処理を行うということである。ある1つのクリッピン
グ境界と多角形を構成する2つの隣接する頂点の位置関
係を第8図に示す。第8図の(a)〜(d)において80
1はクリッピング境界を、802はクリッピング境界801に
対する内側を、803はクリッピング境界801に対する外側
を示す。なお、クリッピング境界801そのものは、内側8
02または外側803のいずれか一方に含まれるものとす
る。頂点P804と頂点Q805は、先に頂点P804が入力されそ
の次に頂点Q805が入力されたものとする。第8図の
(a)は、2つの頂点P804とQ805がともに内側802にあ
る場合を示している。この場合、線分PQ806もまた内側8
02にある。第8図の(b)は、2つの頂点P804とQ805が
ともに外側803にある場合を示している。この場合、線
分PQ806もまた外側にある。第8図の(C)は、頂点P80
4が内側802にありQ805が外側803にある場合を示してい
る。この場合、線分PQ806とクリッピング境界801との交
点をR807とすると線分PR808が内側にある。第8図の
(d)は、頂点Q805が内側802にありP804が外側803にあ
る場合を示している。この場合、線分PQ806とクリッピ
ング境界801との交点をR807とすると線分RQ809が内側に
ある。従って第8図の各々の場合に応じて不要な部分を
切り取ることにより、入力された多角形の頂点の系列に
対するクリッピングされた多角形の頂点の系列が生成さ
れる。第9図に、第8図の(a)〜(d)の各々の場合
に応じて出力すべき頂点を示す。順次入力されたすべて
の頂点について、隣接する2つの頂点とクリッピング境
界との位置関係を判定し、第9図に従って入力された頂
点および/または交点の座標を出力することにより、そ
のクリッピング境界に対する1つの多角形のクリッピン
グ処理が完了する。第10図に示した多角形ABCD1001につ
いて前記の方法を適用した場合の具体的な処理の流れを
以下に説明する。第10図において、1001はクリッピング
の対象となる多角形ABCDを、1002はクリッピング境界
を、1003はクリッピング境界1002に対する内側を、1004
はクリッピング境界1002に対する外側を示す。なお、多
角形1001の頂点はA,B,C,Dの順に入力されるものとす
る。まず最初に頂点A1005が入力される。頂点A1005は内
側1003にある。次に頂点B1006が入力される。頂点B1006
もまた内側1003にあることから、線分AB1007には前記の
第8図または第9図の(a)の場合が適用され、頂点B1
006が出力される。次に頂点C1008が入力される。頂点C1
008は外側1004にあることから、線分BC1009には前記の
第8図または第9図の(C)の場合が適用され、線分BC
1009とクリッピング境界1002との交点E1010が出力され
る。次に頂点D1011が入力される。頂点D1011は外側1004
にあることから、線分CD1012には前記の第8図または第
9図の(b)の場合が適用され、頂点は出力されない。
最後に、再度頂点A1005が入力されるか、または最初に
頂点A1005が入力されたときに保持していたクリッピン
グ境界1002に対する頂点A1005の内外判定結果を参照す
ると、頂点A1005は内側1003にあることから、線分DA101
3には前記の第8図または第9図の(d)の場合が適用
され、線分DA1013とクリッピング境界1002との交点F101
4がまず出力され、その後に頂点A1005が出力される。以
上の結果、入力された多角形1001に対してクリッピング
境界1002の外側1004にある部分を取り除いた多角形の頂
点の列として、4つの頂点B,E,F,Aが出力される。な
お、第11図に以上の処理の流れを一覧にして示す。第11
図において「位置関係」の欄は、「1つ前に入力された
頂点」と「(今、)入力された頂点」でできる線分とク
リッピング境界1002との位置関係に対して、前記の第8
図または第9図の4通りのいずれの場合が適用されたか
を示している。2. Description of the Related Art When an object is displayed on a graphic display device, a graphic may appear beyond the viewport. In this case, it is necessary to cut out the protruding portion of the object so that the displayed figure fits in the viewport. This process is called clipping, and a boundary for clipping is called a clipping boundary. Generally, when the display object is a two-dimensional object, the clipping boundary is composed of a plurality of two-dimensional straight lines, and the display object is a three-dimensional object. Sometimes the clipping boundary is composed of multiple 3D planes. On the other hand, the display object is often approximately expressed as a set of polygons regardless of whether it is a two-dimensional object or a three-dimensional object. Therefore,
The clipping process is considered to be a process of cutting out an unnecessary portion of each polygon forming the object with respect to a plurality of clipping boundary surfaces or boundary lines. (Hereinafter,
The clipping boundary surface and the clipping boundary line are collectively referred to as "clipping boundary"). A powerful solution to this clipping process is
Sutherland and GW Hodgman (IESu
"Reentrant Polygon Clipping" by Ther-land and GWHod geman, Communications of the ACM, Volume 17, Issue 1 ("Reentran
t Polygon Clipping, ″ CACM.Vol.17, No.1), pp32−4
2, 1974, the method shown. In this method, a polygon to be clipped is input as a sequence of vertices, clipping processing is performed on one boundary of straight lines or planes that form the clipping boundary, and when the processing for one boundary ends, the processing result As a new input, a clipping process for the next boundary is performed by using a polygon composed of a sequence of vertices output as. The feature of this method is that, in addition to performing the above-mentioned sequential processing for each clipping boundary, the polygon is considered as a series of vertices, and clipping processing is performed for a line segment connecting two adjacent vertices. That is. The positional relationship between a certain clipping boundary and two adjacent vertices forming a polygon is shown in FIG. 80 in (a) to (d) of FIG.
1 indicates a clipping boundary, 802 indicates the inside of the clipping boundary 801, and 803 indicates the outside of the clipping boundary 801. Note that the clipping boundary 801 itself is the inner 8
It shall be included in either 02 or outside 803. For the vertex P804 and the vertex Q805, it is assumed that the vertex P804 is input first and then the vertex Q805 is input. FIG. 8A shows a case where the two vertices P804 and Q805 are both inside 802. In this case, the line segment PQ806 is also inside 8
It is in 02. FIG. 8B shows a case where the two vertices P804 and Q805 are both on the outer side 803. In this case, the line segment PQ806 is also outside. FIG. 8C shows the vertex P80.
4 is on the inside 802 and Q805 is on the outside 803. In this case, assuming that the intersection of the line segment PQ806 and the clipping boundary 801 is R807, the line segment PR808 is inside. FIG. 8D shows a case where the vertex Q805 is on the inner side 802 and P804 is on the outer side 803. In this case, assuming that the intersection of the line segment PQ806 and the clipping boundary 801 is R807, the line segment RQ809 is inside. Therefore, a clipped polygonal vertex sequence for the input polygonal vertex sequence is generated by cutting out unnecessary portions in each case of FIG. FIG. 9 shows the vertices to be output according to each of the cases (a) to (d) of FIG. For all the vertices sequentially input, the positional relationship between two adjacent vertices and the clipping boundary is determined, and the coordinates of the input vertices and / or intersections are output according to FIG. The clipping process for one polygon is completed. A specific processing flow when the above method is applied to the polygon ABCD1001 shown in FIG. 10 will be described below. In FIG. 10, 1001 is the polygon ABCD to be clipped, 1002 is the clipping boundary, 1003 is the inside of the clipping boundary 1002, 1004
Indicates the outside of the clipping boundary 1002. The vertices of polygon 1001 are input in the order of A, B, C, D. First, the vertex A1005 is input. The vertex A1005 is located inside 1003. Next, the vertex B1006 is input. Vertex B1006
Since it is also inside 1003, the case of (a) in FIG. 8 or FIG. 9 described above is applied to the line segment AB1007, and the vertex B1
006 is output. Next, the vertex C1008 is input. Vertex C1
Since 008 is on the outer side 1004, the case of (C) in FIG. 8 or FIG. 9 described above is applied to the line segment BC1009.
The intersection E1010 between 1009 and the clipping boundary 1002 is output. Next, the vertex D1011 is input. Vertex D1011 is outside 1004
Therefore, the case of (b) in FIG. 8 or FIG. 9 described above is applied to the line segment CD1012, and the vertex is not output.
Finally, referring to the inside / outside judgment result of the vertex A1005 with respect to the clipping boundary 1002 held when the vertex A1005 is input again or the first time the vertex A1005 is input, it is found that the vertex A1005 is inside 1003. , Line segment DA101
The case of (d) in FIG. 8 or FIG. 9 is applied to 3 and the intersection F101 of the line segment DA1013 and the clipping boundary 1002 is applied.
4 is output first, and then vertex A1005 is output. As a result of the above, four vertices B, E, F, A are output as a row of vertexes of the polygon obtained by removing the portion outside the clipping boundary 1002 from the input polygon 1001. Note that FIG. 11 shows a list of the above processing flow. 11th
In the figure, the column of “Position relation” indicates the above-mentioned first relation with respect to the positional relation between the line segment formed by “the vertex input one before” and “the vertex input (now)” and the clipping boundary 1002. 8
It shows which of the four cases of FIG. 9 or FIG. 9 has been applied.
発明が解決しようとする課題 しかしながら、以上に述べたクリッピング処理の方法
に基づくクリッピング回路においては、クリッピング境
界上に存在するような頂点を含んだ多角形を入力したと
きに、クリッピング境界上の頂点が重複して出力される
という問題があった。第12図に示す多角形ABCD1201を用
いて具体的に説明する。第12図において、1202はクリッ
ピング境界を、1203はクリッピング境界1202に対する内
側を、1204はクリッピング境界1202に対する外側を示
す。なお、クリッピング境界1202そのものは内側1203に
含まれるものとする。また頂点B1206およびD1210はクリ
ッピング境界1202上にあるものとする。なお、多角形12
01の頂点はA,B,C,Dの順に入力されるものとする。まず
最初に頂点A1205が入力される。頂点A1205は内側1203に
ある。次に頂点B1206が入力される。頂点B1206はクリッ
ピング境界1202上の頂点である。従って、先の仮定から
頂点B1206もまた内側1203にあることから、線分AB1207
には前記の第8図または第9図の(a)の場合が適用さ
れ、頂点B1206が出力される。次に頂点C1208が入力され
る。頂点C1208は外側1204にあることから、線分BC1209
には前記の第8図または第9図の(C)の場合が適用さ
れ、線分BC1209とクリッピング境界1202との交点が出力
されるが、この交点は頂点B1206に等しく、再度頂点B12
06が出力されることになる。次に頂点D1210が入力され
る。頂点D1210はクリッピング境界1202上の頂点であ
る。従って、先の仮定から頂点D1210もまた内側1203に
あることから、線分CD1211には前記の第8図または第9
図の(d)の場合が適用され、線分CD1211とクリッピン
グ境界1202との交点がまず出力され、その後に頂点D121
0が出力されるが、この交点は頂点D1210に等しい。従っ
て、頂点D1210が2つ続けて出力される。最後に、再度
頂点A1205が入力されるか、または最初に頂点A1205が入
力されたときに保持していたクリッピング境界1202に対
する頂点A1205の内外判定結果を参照すると、頂点A1205
は内側1203にあることから、線分DA1212には前記の第8
図または第9図の(a)の場合が適用され、頂点A1205
が出力される。以上の結果、入力された多角形1201に対
してクリッピング境界1202の外側1204にある部分を取り
除いた多角形の頂点の列として、5つの頂点B,B,D,D,A
が出力される。従って、クリッピング境界1202上の頂点
B1206および頂点D1210が各々2度ずつ出力されたことに
なる。第13図に以上の処理の流れを一覧にして示す。以
上の例では、クリッピング境界そのものを内側に含まれ
るものとしていた。逆にクリッピング境界そのものが外
側に含まれるものとした場合を考える。この場合には、
第12図に示した多角形1201を入力したとき、途中の経過
を省略するが、同様に前記の第8図または第9図の各々
の場合を適用して行くと、第14図に示したようになり、
クリッピングの結果として3つの頂点の列B,D,Aが重複
することなく出力され、前記の問題点がないかのように
思われる。しかし、クリッピング境界そのものが外側に
含まれるとした場合にも、やはりクリッピング境界上の
頂点を含む多角形を入力したときに、クリッピング境界
上にある頂点が重複して出力される例を第15図に示す。
第15図において、1501はクリッピングの対象となる多角
形ABCDを、1502はクリッピング境界を、1503はクリッピ
ング境界1502に対する内側を、1504はクリッピング境界
1502に対する外側を示し、頂点C1505がクリッピング境
界1502上にあるものとする。この場合には、多角形1501
を入力したとき、途中の経過を省略するが、同様に前記
の第8図または第9図の各々の場合を適用して行くと、
第16図に示したようになり、クリッピングの結果として
5つの頂点の列B,C,C,D,Aが出力され、頂点C1505が重複
して出力される。以上のように、クリッピング境界その
ものが内側または外側のいずれの方に含まれるとして
も、クリッピング境界上にある頂点を含む多角形を入力
したとき、この従来のクリッピング方法に基づくクリッ
ピング回路では、クリッピング境界上にある頂点が重複
して出力されることは避けられなかった。一般に、クリ
ッピングの処理は複数のクリッピング境界に対して行わ
れるため、1つのクリッピング境界に対して処理され出
力された多角形の頂点の列を、次のクリッピング境界に
対する処理の入力として用いる。従って、途中のクリッ
ピングの処理において重複して出力された頂点に対する
処理は、全く無駄な処理となる。このように、従来のク
リッピング回路では、クリッピング境界上にある頂点を
含む多角形が入力された場合に処理量が増加するという
問題点があった。本発明はかかる点に鑑み、クリッピン
グ境界上にある頂点を含む多角形に対しても、同一の頂
点を重複して出力せず、無駄な処理の増加を招かないよ
うなクリッピング回路を提供することを目的とする。However, in the clipping circuit based on the clipping processing method described above, when a polygon including vertices existing on the clipping boundary is input, the vertices on the clipping boundary are There was a problem of duplicate output. A specific description will be given using the polygon ABCD1201 shown in FIG. In FIG. 12, 1202 indicates a clipping boundary, 1203 indicates the inside of the clipping boundary 1202, and 1204 indicates the outside of the clipping boundary 1202. The clipping boundary 1202 itself is included in the inside 1203. It is also assumed that vertices B1206 and D1210 are on the clipping boundary 1202. In addition, polygon 12
The vertices of 01 are input in the order of A, B, C, D. First, the vertex A1205 is input. The apex A1205 is inside 1203. Next, the vertex B1206 is input. The vertex B1206 is a vertex on the clipping boundary 1202. Therefore, from the above assumption, since the vertex B1206 is also inside 1203, the line segment AB1207
The case of (a) in FIG. 8 or FIG. 9 is applied to, and the vertex B1206 is output. Next, the vertex C1208 is input. Since vertex C1208 is on the outer side 1204, line segment BC1209
The case of (C) in FIG. 8 or FIG. 9 is applied to the output, and the intersection of the line segment BC1209 and the clipping boundary 1202 is output. This intersection is equal to the vertex B1206, and again the vertex B12.
06 will be output. Next, the vertex D1210 is input. The vertex D1210 is a vertex on the clipping boundary 1202. Therefore, since the apex D1210 is also inside 1203 from the above assumption, the line segment CD1211 is shown in FIG.
The case of (d) in the figure is applied, the intersection of the line segment CD1211 and the clipping boundary 1202 is first output, and then the vertex D121.
0 is output, but this intersection is equal to vertex D1210. Therefore, two vertices D1210 are output in succession. Finally, referring to the inside / outside determination result of the vertex A1205 with respect to the clipping boundary 1202 held when the vertex A1205 is input again or the vertex A1205 is input first, the vertex A1205
Is inside 1203, the line segment DA1212 has
The case of Figure or (a) of Figure 9 is applied, and vertex A1205
Is output. As a result, five vertices B, B, D, D, A are formed as a row of vertices of the polygon obtained by removing the portion 1204 outside the clipping boundary 1202 with respect to the input polygon 1201.
Is output. Therefore, the vertices on the clipping boundary 1202
B1206 and vertex D1210 are output twice each. FIG. 13 shows a list of the above processing flow. In the above example, the clipping boundary itself is included inside. Conversely, consider the case where the clipping boundary itself is included outside. In this case,
When the polygon 1201 shown in FIG. 12 is input, the process in the middle is omitted, but if each case of FIG. 8 or FIG. 9 is applied in the same manner, it is shown in FIG. Becomes,
As a result of clipping, the sequence of three vertices B, D, A is output without duplication, and it seems that the above problem does not exist. However, even if the clipping boundary itself is included outside, when a polygon that also includes vertices on the clipping boundary is input, the vertices on the clipping boundary are output in duplicate. Shown in.
In FIG. 15, 1501 is the polygon ABCD to be clipped, 1502 is the clipping boundary, 1503 is the inside of the clipping boundary 1502, and 1504 is the clipping boundary.
The outside is shown for 1502 and the vertex C1505 is on the clipping boundary 1502. In this case, polygon 1501
When inputting, the process in the middle is omitted, but if each case of FIG. 8 or FIG. 9 is similarly applied,
As shown in FIG. 16, as a result of clipping, the sequence of five vertices B, C, C, D, and A is output, and the vertex C1505 is output in duplicate. As described above, regardless of whether the clipping boundary itself is included inside or outside, when a polygon that includes vertices on the clipping boundary is input, the clipping circuit based on this conventional clipping method uses the clipping boundary. It was unavoidable that the top vertices above were output in duplicate. In general, since clipping processing is performed on a plurality of clipping boundaries, a row of polygon vertices processed and output for one clipping boundary is used as an input for the processing for the next clipping boundary. Therefore, the processing for the vertices that are duplicately output in the clipping processing on the way is completely useless. As described above, the conventional clipping circuit has a problem that the processing amount increases when a polygon including vertices on the clipping boundary is input. In view of the above point, the present invention provides a clipping circuit that does not output the same vertices redundantly even for a polygon including vertices on a clipping boundary and does not cause unnecessary increase in processing. With the goal.
課題を解決するための手段 本発明は、前記の問題点を解決するために、入力され
た多角形の頂点の座標を保持する頂点レジスタと、クリ
ッピング領域を表す境界面または境界線の方程式を保持
する境界レジスタと、前記の境界レジスタの出力する境
界面または境界線の方程式と前記の入力された頂点の座
標とを入力としてその座標をもつ頂点が前記の境界面ま
たは境界線に対して内側に存在するか外側に存在するか
もしくは境界面または境界線の上に存在するかを判定す
る内外判定回路と、前記の頂点レジスタの保持する頂点
系列における1つ前の頂点に対して前記の内外判定回路
によって判定された結果を保持する内外判定結果レジス
タと、前記の内外判定回路の出力する第1の内外判定結
果と前記の内外判定結果レジスタに保持された第2の内
外判定結果を入力としクリッピングの結果として出力す
べき座標を判定するクリッピング判定回路と、前記の入
力された頂点の座標と前記の頂点レジスタの保持する座
標を2つの端点とする線分と前記の境界レジスタの出力
する境界面または境界線の方程式を入力として前記の線
分と前記の境界面または境界線との交点の座標を前記の
クリッピング判定回路の出力に応じて計算する交点計算
回路と、前記の入力された頂点の座標と前記の交点計算
回路の出力する交点の座標から0ないし2つの座標を前
記のクリッピング判定回路の出力に応じて選択し順序付
けて出力する頂点出力回路とを具備することを特徴とす
るクリッピング回路である。Means for Solving the Problems In order to solve the above problems, the present invention holds a vertex register that holds the coordinates of the vertices of an input polygon, and a boundary surface or boundary line equation that represents a clipping region. The boundary register and the equation of the boundary surface or boundary line output by the boundary register and the coordinates of the input vertex are input, and the vertex having that coordinate is inside the boundary face or boundary line. An inside / outside determination circuit for determining whether it exists, outside, or on a boundary surface or a boundary line, and the inside / outside determination for the previous vertex in the vertex series held by the vertex register An inside / outside determination result register that holds the result determined by the circuit, a first inside / outside determination result output from the inside / outside determination circuit, and a first / outside determination result register stored in the inside / outside determination result register. A clipping determination circuit that receives the inside / outside determination result of 2 and determines the coordinates to be output as a result of clipping, and a line segment that has the coordinates of the input vertex and the coordinates held by the vertex register as two end points. An intersection calculation circuit that receives the equation of the boundary surface or the boundary line output from the boundary register and calculates the coordinates of the intersection of the line segment and the boundary surface or the boundary line according to the output of the clipping determination circuit. And a vertex output circuit that selects and outputs 0 to 2 coordinates from the coordinates of the input vertex and the coordinates of the intersection point output from the intersection point calculation circuit according to the output of the clipping determination circuit and outputs them in sequence. A clipping circuit characterized by being provided.
作用 本発明は前記の構成により、入力された多角形の頂点
の座標と、クリッピング境界との位置関係を内外判定回
路によって、内側か外側かまたは境界上にあるかのいず
れであるか判定し、この判定結果と先に入力され頂点レ
ジスタに保持されている1つ前の頂点に対して得られ、
内外判定結果レジスタに保持されている内外判定結果と
を用いて、クリッピング判定回路によってこれら隣接す
る2つの頂点を結ぶ線分と前記のクリッピング境界との
位置関係を判定し、必要に応じて交点計算回路で算出さ
れた前記の線分とクリッピング境界との交点の座標と、
入力された頂点の座標を、それぞれの位置関係に応じて
頂点出力回路を介して出力することにより、クリッピン
グの処理を行う。The present invention has the above-mentioned configuration, and determines whether the coordinates of the vertices of the input polygon and the clipping boundary are inside, outside, or on the boundary by the inside / outside judging circuit. This judgment result and the previous vertex that was previously input and held in the vertex register are obtained,
Using the inside / outside judgment result held in the inside / outside judgment result register, the clipping judgment circuit judges the positional relationship between the line segment connecting these two adjacent vertices and the clipping boundary, and calculates the intersection point if necessary. Coordinates of the intersection of the line segment and the clipping boundary calculated by the circuit,
Clipping processing is performed by outputting the coordinates of the input vertices via the vertex output circuit according to the respective positional relationships.
実施例 第1図は、本発明のクリッピング回路の一実施例の構
成を示すブロック図である。第1図において101は順次
に入力される多角形の頂点の座標を、102は頂点レジス
タを、103は境界レジスタを、104は境界レジスタ103の
出力するクリッピング境界の方程式を、105は内外判定
回路を、106は内外判定回路105の出力する内外判定結果
を、107は内外判定結果105を保持する内外判定結果レジ
スタを、108は内外判定結果レジスタ107に保持されてい
る、頂点系列における1つ前の頂点に対する内外判定結
果を、109はクリッピング判定回路を、110はクリッピン
グ判定回路109の出力する制御信号を、111は頂点レジス
タ102に保持されている。頂点系列における1つ前の頂
点の座標を、112は交点計算回路を、113は交点計算回路
112の出力する交点の座標を、114は頂点出力回路を、11
5はクリッピング処理の結果として出力される頂点の座
標を示している。以上のように構成された本発明のクリ
ッピング回路の動作を以下に説明する。まず、多角形を
構成する頂点の座標が図示しない外部回路から順次1座
標ずつ入力される。入力された頂点の座標は頂点レジス
タ102に格納されるとともに、内外判定回路105、交点計
算回路112および頂点出力回路114に供給される。境界レ
ジスタ103は少なくとも現在処理の対象となっているク
リッピング境界を含む複数のクリッピング境界の方程式
を保持しており、現在処理の対象となっているクリッピ
ング境界の方程式104を出力し内外判定回路105および交
点計算回路112に供給する。内外判定回路105は入力され
た頂点の座標101と、クリッピング境界の方程式から幾
何学における公知の技術を用いて、その頂点とクリッピ
ング境界との位置関係を判定する。位置関係には第2図
の(a)〜(C)に示す3通りの場合がある。第2図
で、201はクリッピング境界を、202はクリッピング境界
201に対する内側を、203はクリッピング境界201に対す
る外側を、204は入力された頂点をそれぞれ示してい
る。但し、クリッピング境界201は内側202およ外側203
のいずれにも含まれないものとする。第2図の(a)は
頂点204がクリッピング境界201に対して内側202にある
場合を、(b)は頂点204がクリッピング境界201上にあ
る場合を、(C)は頂点204がクリッピング境界201に対
して外側203にある場合を、それぞれ示している。内外
判定回路105は前記の3通りのいずれであるかを示す信
号を判定結果106として出力し、内外判定結果レジスタ1
07に格納するとともに、クリッピング判定回路109に供
給する。クリッピング判定回路109は、入力された頂点1
01に対する内外判定結果106と、内外判定結果レジスタ1
07に保持されている。多角形の頂点系列において1つ前
の頂点に対する内外判定結果108を用いて、現在入力さ
れた頂点とその1つ前の頂点とを結ぶ線分と、クリッピ
ング境界との位置関係を判定し、クリッピング処理の結
果として出力すべき頂点の座標を決定し、頂点出力回路
114に対して制御信号110を供給する。このとき、前記の
線分とクリッピング境界との交点を出力すべきであると
判断した場合には、交点計算回路112に対しても交点113
の計算を指示する制御信号110を供給する。第3図の
(a)〜(i)に前記の線分とクリッピング境界との9
通りのすべての位置関係を示す。第3図において、201
〜203は、第2図と同一のものである。301は1つ前に入
力された頂点Pを、302は現在入力されている頂点Q
を、303は線分PQとクリッピング境界201との交点Rを、
それぞれ示している。第4図に、第3図の各々の場合に
対応して、入力された頂点の座標101に対する内外判定
結果106と、内外判定結果レジスタ107に保持されている
多角形の頂点系列において1つ前の頂点対する内外判定
結果108と、クリッピング判定回路109において出力すべ
きであると判定される頂点の関係を示す。第4図に示し
た関係は、前記の第9図に示した関係を完全に包含して
いるため、クリッピング境界上にない頂点については、
従来のクリッピング回路と同様に処理できることは保証
される。交点計算回路112は、入力された頂点の座標101
と、頂点レジスタ102に保持されている多角形の頂点系
列において1つ前の頂点の座標111と、境界レジスタ103
に保持されている。現在処理の対象となっているクリッ
ピング境界の方程式104を用いて、現在入力された頂点
とその1つ前の頂点とを結ぶ線分とクリッピング境界と
の交点の座標を、クリッピング判定回路109の判定結果
を示す制御信号110に応じて計算する。頂点出力回路114
は、クリッピング判定回路109の判定結果を示す制御信
号110に応じて(即ち第4図の関係に応じて)、交点計
算回路112で必要に応じて計算された交点の座標113と、
現在入力されている頂点の座標101から、0ないし2つ
の頂点の座標115を順序付けて出力する。前記の第10
図、第12図、および第15図の各々に示した多角形に対し
て、本発明のクリッピング回路を用いてクリッピング処
理を行った場合の処理の流れを一覧にして、それぞれ第
5図、第6図、および第7図に示す。前記の第10図の例
の多角形に対しては、4つの頂点の列B,E,F,Aが、第12
図の例の多角形に対しては3つの頂点の列B,D,Aが、第1
5図の例の多角形に対しては4つの頂点のB,C,D,Aが、そ
れぞれ頂点が重複することなく出力される。なお、本発
明の実施例の構成を示す際に用いた第1図では、各構成
要素(回路およびレジスタ)を独立したハードウエアと
して個別に表しているが、通常のCPU(中央処理装置)
を用いて、各回路の機能をソフトウエアによって実現し
てもよく、各レジスタを通常のメモリ装置やCPUのレジ
スタによって実現しても、本発明のクリッピング回路を
構成できることを付け加えておく。Embodiment FIG. 1 is a block diagram showing the configuration of an embodiment of the clipping circuit of the present invention. In FIG. 1, 101 is the coordinates of the vertices of polygons that are sequentially input, 102 is the vertex register, 103 is the boundary register, 104 is the clipping boundary equation output from the boundary register 103, and 105 is the inside / outside determination circuit. 106 is the inside / outside determination result output from the inside / outside determination circuit 105, 107 is the inside / outside determination result register that holds the inside / outside determination result 105, and 108 is the previous / one in the vertex sequence held in the inside / outside determination result register 107. The result of the inside / outside determination for the vertices is held by 109 for the clipping determination circuit, 110 for the control signal output from the clipping determination circuit 109, and 111 for the vertex register 102. The coordinates of the previous vertex in the vertex series, 112 is the intersection calculation circuit, and 113 is the intersection calculation circuit.
The coordinates of the intersection point output by 112, 114 the vertex output circuit, 11
Reference numeral 5 indicates the coordinates of the vertices output as a result of clipping processing. The operation of the clipping circuit of the present invention configured as above will be described below. First, the coordinates of the vertices forming the polygon are sequentially input one by one from an external circuit (not shown). The input coordinates of the vertex are stored in the vertex register 102, and are also supplied to the inside / outside determination circuit 105, the intersection calculation circuit 112, and the vertex output circuit 114. The boundary register 103 holds at least a plurality of clipping boundary equations including the clipping boundary currently being processed, outputs the clipping boundary equation 104 currently being processed, and outputs the inside / outside determination circuit 105 and It is supplied to the intersection calculation circuit 112. The inside / outside determination circuit 105 determines the positional relationship between the vertex and the clipping boundary from the input coordinate 101 of the vertex and the clipping boundary equation using a known technique in geometry. There are three positional relationships shown in FIGS. 2 (a) to (C). In FIG. 2, 201 is a clipping boundary and 202 is a clipping boundary.
The inside of 201, the outside 203 to the clipping boundary 201, and the input vertex 204 are shown. However, clipping boundary 201 is inside 202 and outside 203
It is not included in any of the above. 2A shows the case where the vertex 204 is inside 202 with respect to the clipping boundary 201, FIG. 2B shows the case where the vertex 204 is on the clipping boundary 201, and FIG. 2C shows the case where the vertex 204 has the clipping boundary 201. To the outer side 203, respectively. The inside / outside determination circuit 105 outputs a signal indicating which of the above three types as the determination result 106, and the inside / outside determination result register 1
The data is stored in 07 and supplied to the clipping determination circuit 109. The clipping determination circuit 109 receives the input vertex 1
Inside / outside judgment result 106 for 01 and inside / outside judgment result register 1
Holds on 07. Using the inside / outside determination result 108 for the previous vertex in the polygonal vertex sequence, the positional relationship between the clipping point and the line segment connecting the currently input vertex and the previous vertex is determined, and clipping is performed. Determine the coordinates of the vertices that should be output as a result of the processing, and then use the vertex output circuit.
The control signal 110 is supplied to 114. At this time, when it is determined that the intersection of the line segment and the clipping boundary should be output, the intersection 113 is also input to the intersection calculation circuit 112.
A control signal 110 that directs the calculation of 9 (a) to (i) of FIG.
Show all positional relationships in the street. In FIG. 3, 201
Reference numerals 203 to 203 are the same as those in FIG. 301 is the previous input vertex P, 302 is the currently input vertex Q
303 is the intersection R of the line segment PQ and the clipping boundary 201,
Shown respectively. FIG. 4 shows the inside / outside determination result 106 for the input vertex coordinates 101 and the previous one in the polygonal vertex sequence held in the inside / outside determination result register 107, corresponding to each case of FIG. The relationship between the inside / outside determination result 108 for the vertices and the vertices determined to be output by the clipping determination circuit 109 is shown. Since the relationship shown in FIG. 4 completely includes the relationship shown in FIG. 9 above, for vertices not on the clipping boundary,
It is guaranteed that it can be processed like a conventional clipping circuit. The intersection calculation circuit 112 calculates the coordinates 101 of the input vertex.
And the coordinates 111 of the previous vertex in the polygonal vertex series held in the vertex register 102 and the boundary register 103.
Held in. Using the clipping boundary equation 104 that is currently the target of processing, the clipping determination circuit 109 determines the coordinates of the intersection of the clipping boundary and the line segment connecting the currently input vertex and the immediately preceding vertex. It is calculated according to the control signal 110 indicating the result. Vertex output circuit 114
Is the coordinate 113 of the intersection calculated as required by the intersection calculation circuit 112 in response to the control signal 110 indicating the determination result of the clipping determination circuit 109 (that is, according to the relationship of FIG. 4),
From the currently input vertex coordinates 101, 0 or two vertex coordinates 115 are output in order. The tenth of the above
The polygons shown in each of FIGS. 12, 12, and 15 are listed in FIG. 5 and FIG. 5, respectively, showing the flow of processing when clipping processing is performed using the clipping circuit of the present invention. It is shown in FIG. 6 and FIG. 7. For the polygon in the example of FIG. 10 above, the sequence of four vertices B, E, F, A is
For the polygon in the example in the figure, the row of three vertices B, D, A
For the polygon in the example in Fig. 5, four vertices B, C, D, and A are output without overlapping vertices. In FIG. 1 used to show the configuration of the embodiment of the present invention, each component (circuit and register) is individually represented as independent hardware, but a normal CPU (central processing unit) is used.
It should be added that the function of each circuit may be realized by software by using, and the clipping circuit of the present invention can be configured even if each register is realized by an ordinary memory device or a register of a CPU.
発明の効果 以上に説明してきたように、本発明によれば、クリッ
ピング境界上にある頂点を含むような多角形が入力され
たときでも、同一の頂点を重複して出力することがない
ようなクリッピング回路が実現でき、無駄な処理の増大
を防ぐことができ、処理速度の向上が図れる。EFFECTS OF THE INVENTION As described above, according to the present invention, even when a polygon including vertices on a clipping boundary is input, the same vertices are not output in duplicate. A clipping circuit can be realized, useless processing can be prevented from increasing, and processing speed can be improved.
第1図は本発明のクリッピング回路の一実施例の構成を
示すブロック図、第2図は1つの頂点とクリッピング境
界の位置関係図、第3図は2つの頂点を結ぶ線分とクリ
ッピング境界の位置関係図、第4図は第3図に示す位置
関係と出力すべき頂点の関係を示す対応図、第5図は第
10図に示す多角形の例に対して本発明のクリッピング回
路を用いて処理した場合の処理の流れを示す図、第6図
は第12図に示す多角形の例に対して本発明のクリッピン
グ回路を用いて処理した場合の処理の流れを示す図、第
7図は第15図に示す多角形の例に対して本発明のクリッ
ピング回路を用いて処理した場合の処理の流れを示す
図、第8図は従来のクリッピング回路において用いてい
た線分とクリッピング境界の位置関係図、第9図は第8
図に示す位置関係と出力すべき頂点の関係を示す対応
図、第10図はクリッピングの対象となる多角形の例を示
す平面図、第11図は第10図に示す多角形の例に対して従
来のクリッピング回路を用いて処理した場合の処理の流
れを示す図、第12図はクリッピングの対象となる多角形
の例を示す平面図、第13図は第12図に示す多角形の例に
対して、クリッピング境界そのものが内側に含まれると
仮定した上で、従来のクリッピング回路を用いて処理し
た場合の処理の流れを示す図、第14図は第12図に示す多
角形の例に対して、クリッピング境界そのものが外側に
含まれると仮定した上で、従来のクリッピング回路を用
いて処理した場合の処理の流れを示す図、第15図はクリ
ッピングの対象となる多角形の例を示す平面図、第16図
は第15図に示す多角形の例に対して従来のクリッピング
回路を用いて処理した場合の処理の流れを示す図であ
る。 101……入力された頂点の座標、102……頂点レジスタ、
103……境界レジスタ、105……内外判定結果、107……
内外判定結果レジスタ、109……クリッピング判定回
路、112……交点計算回路、114……頂点出力回路。FIG. 1 is a block diagram showing a configuration of an embodiment of a clipping circuit of the present invention, FIG. 2 is a positional relationship diagram of one vertex and a clipping boundary, and FIG. 3 is a line segment connecting two vertices and a clipping boundary. The positional relationship diagram, FIG. 4 is a correspondence diagram showing the positional relationship shown in FIG. 3 and the relationship of the vertices to be output, and FIG.
FIG. 6 is a diagram showing the flow of processing when the clipping circuit of the present invention is applied to the polygonal example shown in FIG. 10, and FIG. 6 is the clipping of the present invention with respect to the polygonal example shown in FIG. FIG. 7 is a diagram showing the flow of processing when processing is performed using a circuit, and FIG. 7 is a diagram showing the flow of processing when processing is performed using the clipping circuit of the present invention for the polygonal example shown in FIG. FIG. 8 is a positional relationship diagram of a line segment and a clipping boundary used in a conventional clipping circuit, and FIG.
Correspondence diagram showing the relationship between the positional relationship shown in the figure and the vertices to be output, FIG. 10 is a plan view showing an example of a polygon to be clipped, and FIG. 11 is an example of the polygon shown in FIG. Fig. 12 is a plan view showing an example of a polygon to be clipped, and Fig. 13 is an example of the polygon shown in Fig. 12. On the other hand, assuming that the clipping boundary itself is included inside, a diagram showing the flow of processing when processing is performed using a conventional clipping circuit, FIG. 14 shows the polygon example shown in FIG. On the other hand, assuming that the clipping boundary itself is included outside, it is a diagram showing the flow of processing when processing is performed using a conventional clipping circuit, and FIG. 15 shows an example of a polygon to be clipped. Fig. 16 is a plan view and Fig. 16 is an example of the polygon shown in Fig. 15. On the other hand, it is a figure which shows the flow of a process when it processes using the conventional clipping circuit. 101 ... coordinates of the input vertex, 102 ... vertex register,
103 …… Boundary register, 105 …… Inside / outside judgment result, 107 ……
Inside / outside determination result register, 109 ... clipping determination circuit, 112 ... intersection calculation circuit, 114 ... vertex output circuit.
Claims (1)
頂点レジスタと、クリッピング領域を表す境界面または
境界線の方程式を保持する境界レジスタと、前記の境界
レジスタの出力する境界面または境界線の方程式と前記
の入力された頂点の座標とを入力としてその座標をもつ
頂点が前記の境界面または境界線に対して内側に存在す
るか外側に存在するかもしくは境界面または境界線の上
に存在するかを判定する内外判定回路と、前記の頂点レ
ジスタの保持する頂点系列における1つ前の頂点に対し
て前記の内外判定回路によって判定された結果を保持す
る内外判定結果レジスタと、前記の内外判定回路の出力
する第1の内外判定結果と前記の内外判定結果レジスタ
に保持された第2の内外判定結果を入力としクリッピン
グの結果として出力すべき座標を判定するクリッピング
判定回路と、前記の入力された頂点の座標と前記の頂点
レジスタの保持する座標を2つの端点とする線分と前記
の境界レジスタの出力する境界面または境界線の方程式
を入力として前記の線分と前記の境界面または境界線と
の交点の座標を前記クリッピング判定回路の出力に応じ
て計算する交点計算回路と、前記の入力された頂点の座
標と前記の交点計算回路の出力する交点の座標から0な
いし2つの座標を前記のクリッピング判定回路の出力に
応じて選択し順序付けて出力する頂点出力回路とを具備
することを特徴とするクリッピング回路。1. A vertex register that holds the coordinates of the vertices of an input polygon, a boundary register that holds the boundary surface or boundary line equation that represents a clipping region, and a boundary surface or boundary that the boundary register outputs. The line equation and the coordinates of the input vertex are input, and the vertex having the coordinates is inside or outside the boundary surface or the boundary line, or on the boundary surface or the boundary line. And an internal / external determination result register for holding the result determined by the internal / external determination circuit for the previous vertex in the vertex sequence held by the vertex register, and The first inside / outside judgment result output from the inside / outside judgment circuit and the second inside / outside judgment result held in the inside / outside judgment result register are input and output as a clipping result. A clipping determination circuit that determines the coordinates to be processed, a line segment having the coordinates of the input vertex and the coordinates held by the vertex register as two end points, and a boundary surface or a boundary line output by the boundary register. An intersection calculation circuit that calculates the coordinates of the intersection of the line segment and the boundary surface or the boundary line according to the output of the clipping determination circuit using an equation as an input, and the coordinates of the input vertex and the intersection A clipping circuit, comprising: a vertex output circuit that selects 0 or 2 coordinates from the coordinates of the intersections output by the calculation circuit according to the output of the clipping determination circuit, and outputs them in sequence.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1142513A JPH0821085B2 (en) | 1989-06-05 | 1989-06-05 | Clipping circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1142513A JPH0821085B2 (en) | 1989-06-05 | 1989-06-05 | Clipping circuit |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH036785A JPH036785A (en) | 1991-01-14 |
| JPH0821085B2 true JPH0821085B2 (en) | 1996-03-04 |
Family
ID=15317103
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1142513A Expired - Fee Related JPH0821085B2 (en) | 1989-06-05 | 1989-06-05 | Clipping circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0821085B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB2343602B (en) * | 1998-11-06 | 2003-03-19 | Videologic Ltd | Shading 3-dimensional computer generated images |
-
1989
- 1989-06-05 JP JP1142513A patent/JPH0821085B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH036785A (en) | 1991-01-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH0687267B2 (en) | Wire frame graphic display generation method and device and hidden line removal system | |
| EP0329101B1 (en) | Three-dimensional graphic processing apparatus | |
| JPH0821085B2 (en) | Clipping circuit | |
| JP3504935B2 (en) | Figure processing method | |
| KR910012997A (en) | Shading Apparatus and Method for Computer Graphics | |
| JP2667949B2 (en) | Pick event processing method and processing apparatus | |
| US7286139B2 (en) | Partial guardband clipping | |
| JPH01193980A (en) | clipping circuit | |
| JP3139431B2 (en) | Connection determination device, method and recording medium | |
| JP3681240B2 (en) | Three-dimensional shape display method and three-dimensional CAD system using the method | |
| JP3337955B2 (en) | How to define a broken line | |
| JPH08287286A (en) | Plane image mapping method | |
| US6489959B1 (en) | Method for converting three-dimensional polygon data into quad edge data structure | |
| JPH01166177A (en) | Thick line drawing system for dda circuit | |
| JPS6114514B2 (en) | ||
| JPH0664618B2 (en) | Clipping circuit | |
| JPH04153893A (en) | Figure clipping device | |
| JPH01134673A (en) | Method and device for displaying data of block chart | |
| JPS63118890A (en) | System for processing polygonal image with painting surface | |
| JPH0638267B2 (en) | Design support device | |
| JPS62237584A (en) | Scissoring processing system | |
| JPS6330983A (en) | Graphic processor | |
| JPH05274393A (en) | Three-dimensional cad system | |
| JPH045767A (en) | Method for preparing radar covering area figure | |
| JPS61265677A (en) | System for calculating and processing hidden outline and hidden surface |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |