JPH036785A - Clipping circuit - Google Patents
Clipping circuitInfo
- Publication number
- JPH036785A JPH036785A JP1142513A JP14251389A JPH036785A JP H036785 A JPH036785 A JP H036785A JP 1142513 A JP1142513 A JP 1142513A JP 14251389 A JP14251389 A JP 14251389A JP H036785 A JPH036785 A JP H036785A
- Authority
- JP
- Japan
- Prior art keywords
- vertex
- clipping
- boundary
- coordinates
- circuit
- 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.)
- Granted
Links
Landscapes
- Controls And Circuits For Display Device (AREA)
- Image Generation (AREA)
Abstract
Description
【発明の詳細な説明】
産業上の利用分野
本発明はグラフィック・デイスプレィ装置のクリッピン
グ回路に関し 特に多角形を表す頂点の座標系列を入力
とし クリッピング領域外部に存在する部分を除去し
内部に存在する部分のみからなる新たな多角形を構成す
る頂点の座標系列を出力するクリッピング回路に関すも
従来の技術
グラフィック・デイスプレィ装置において物体を表示す
る暇 ビューボートを越えて図形が現れる場合が生じつ
る。この場合表示図形がビューボート内に収まるように
物体のはみ出した部分を切り取る必要があム この処理
はクリッピングと呼ばれ 切り取るための境界はクリッ
ピング境界と呼ばれ 一般11:l−、表示物体が2次
元物体であるときはクリッピング境界は複数の2次元直
線で構成され 表示物体が3次元物体であるときはクリ
ッピング境界は複数の3次元平面で構成される。DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a clipping circuit for a graphic display device, and particularly to a clipping circuit that receives as input a coordinate series of vertices representing a polygon and removes portions existing outside the clipping area.
The clipping circuit that outputs the coordinate series of the vertices constituting a new polygon consisting only of internal parts is also conventional technology. A new vine. In this case, it is necessary to cut out the protruding part of the object so that the displayed figure fits within the view boat. This process is called clipping, and the boundary for cutting is called the clipping boundary. General 11: l-, the displayed object is 2 When the display object is a dimensional object, the clipping boundary is composed of a plurality of two-dimensional straight lines, and when the display object is a three-dimensional object, the clipping boundary is composed of a plurality of three-dimensional planes.
人 表示物体は2次元物体の場合でも3次元物体の場合
でも多角形の集合として近似的に表現されることが多(
〜 従って、クリッピングの処理は物体を構成する各々
の多角形の不要な部分を複数のクリッピング境界面また
は境界線に対して切り取るという処理であると考えられ
る(以後、クリッピング境界面とクリッピング境界線を
まとめて「クリッピング境界」と呼ぶものとする)。こ
のクリッピング処理に対する有力な解法として(よ ア
イ・イー・サザーランドとジー・ダブリュー・ホッジマ
ン(1,E、5uther−1ancl anci G
、W、Hod geman)による「リエントラントボ
リゴンクリッピング」コミュニケーションズ・オブ・ジ
・エイ・シー・工な 第17@ 第1号(’Reen
trant Pol ygon CC11p−pin、
’CACM、 Vol、 17. No、 1)、p
p32−42.1974=L で示されている方法が
挙げられも この方法では クリッピングの対象となる
多角形を頂点の列として人力し クリッピング境界を構
成する直線または平面の1つの境界についてクリッピン
グ処理を行(X、1つの境界についての処理が終わると
、その処理結果として出力される頂点の列で構成される
多角形を新たな人力として次の境界についてのクリッピ
ング処理を行う。この方法の特徴は前記の1つ1つのク
リッピング境界ごとに順次処理を行うことに加えて、多
角形を頂点の系列と考えて2つの隣接する頂点を結ぶ線
分に対してクリッピング処理を行うということであム
ある1つのクリッピング境界と多角形を構成する2つの
隣接する頂点の位置関係を第8図に示す。第8図の(a
)〜(d)において801はクリッピング境界を、80
2はクリッピング境界801に対する内側を、803は
クリッピング境界801に対する外側を示す。な抵 ク
リッピング境界801そのもの(′!S 内側802ま
たは外側803のいずれか一方に含まれるものとすム
頂点P804と頂点Q805C& 先に頂点P804
が入力されその次に頂点Q805が入力されたものとす
も 第8図の(a)It2つの頂点P804とQ805
がともに内側802にある場合を示していも この場合
、線分PQ806もまた内側802にあム 第8図の(
b)(よ 2つの頂点P804とQ805がともに外側
803にある場合を示していも この場合、線分PQ8
06もまた外側にあム 第8図の(C)(表 頂点P8
04が内側802にありQ805が外側803にある場
合を示していも この場合、線分PQ806とクリッピ
ング境界801との交点をR807とすると線分PR8
08が内側にあム 第8図の(d)It 頂点Q80
5が内側802にありR804が外側803にある場合
を示していもこの場合、線分PQ806とクリッピング
境界801との交点をR807とすると線分RQ809
が内側にあム 従って第8図の各々の場合に応じて不要
な部分を切り取ることにより、入力された多角形の頂点
の系列に対するクリッピングされた多角形の頂点の系列
が生成されも 第9図へ 第8図の(a)〜(d)の各
々の場合に応じて出力すべき頂点を示す。順次入力され
たすべての頂点について、隣接する2つの頂点とクリッ
ピング境界との位置関係を判定し第9図に従って入力さ
れた頂点および/または交点の座標を出力することによ
り、そのクリッピング境界に対する1つの多角形のクリ
ッピング処理が完了すa 第10図に示した多角形A
B CD 1001について前記の方法を適用した場合
の具体的な処理の流れを以下に説明する。第10図にお
いて、1001はクリッピングの対象となる多角形AB
CDを、1002はクリッピング境界を、1003はク
リッピング境界1002に対する内側を、1004はク
リッピング境界1002に対する外側を示す。な耘 多
角形1001の頂点はA、B、C,Dの順に入力される
ものとすムまず最初に頂点A 1005が入力される。Whether a displayed object is a two-dimensional object or a three-dimensional object, it is often expressed approximately as a set of polygons (
~ Therefore, clipping processing can be considered to be a process of cutting out unnecessary parts of each polygon that makes up an object with respect to multiple clipping boundary surfaces or boundary lines (hereinafter, clipping boundary surfaces and clipping boundary lines will be referred to as clipping boundary surfaces and clipping boundary lines). (collectively referred to as the "clipping boundary"). As a promising solution to this clipping process, I.E. Sutherland and G.W.
``Reentrant Borigon Clipping'' by W.
trant Polygon CC11p-pin,
'CACM, Vol, 17. No, 1), p
The method shown in p.32-42.1974=L can be cited. In this method, the polygon to be clipped is manually set as a row of vertices, and the clipping process is performed on one boundary of a straight line or plane that constitutes the clipping boundary. Row (X) When the processing for one boundary is completed, the polygon composed of the row of vertices output as the processing result is used as a new human power to perform clipping processing for the next boundary.The characteristics of this method are In addition to sequentially processing each clipping boundary as described above, it is also possible to consider a polygon as a series of vertices and perform clipping processing on line segments connecting two adjacent vertices.
FIG. 8 shows the positional relationship between one clipping boundary and two adjacent vertices forming a polygon. Figure 8 (a
) to (d), 801 indicates the clipping boundary, 80
2 indicates the inside of the clipping boundary 801, and 803 indicates the outside of the clipping boundary 801. If the clipping boundary 801 itself ('!S is included in either the inside 802 or the outside 803)
Vertex P804 and Vertex Q805C & Vertex P804 first
Assume that the input is input and the vertex Q805 is input next.(a) It has two vertices P804 and Q805 in Fig. 8.
In this case, the line segment PQ806 is also located inside 802.
b) (Yo) Even if the two vertices P804 and Q805 are both on the outside 803, in this case, the line segment PQ8
06 is also on the outside (C) in Figure 8 (table vertex P8
04 is on the inside 802 and Q805 is on the outside 803. In this case, if the intersection of line segment PQ806 and clipping boundary 801 is R807, line segment PR8
08 is inside Am Figure 8 (d) It Vertex Q80
5 is on the inside 802 and R804 is on the outside 803. In this case, if the intersection of line segment PQ806 and clipping boundary 801 is R807, line segment RQ809
is on the inside. Therefore, by cutting out unnecessary parts according to each case in Figure 8, a series of clipped polygon vertices can be generated for the series of input polygon vertices. The vertices to be output are shown in each case of (a) to (d) in FIG. For all vertices input in sequence, the positional relationship between two adjacent vertices and the clipping boundary is determined, and the coordinates of the input vertex and/or intersection point are output according to Fig. 9. Polygon clipping process is completed a Polygon A shown in Figure 10
A specific process flow when the above method is applied to the B CD 1001 will be described below. In Fig. 10, 1001 is the polygon AB to be clipped.
1002 indicates the clipping boundary, 1003 indicates the inside of the clipping boundary 1002, and 1004 indicates the outside of the clipping boundary 1002. It is assumed that the vertices of the polygon 1001 are input in the order of A, B, C, and D. First, the vertex A 1005 is input.
頂点A 1005は内側1003にあム 次に頂点B
1006が入力されも頂点B 1006もまた内側10
03にあることか技 線分A B 1007には前記の
第8図または第9図の(a)の場合が適用され 頂点B
1006が出力されも 次に頂点C1008が人力さ
れも 頂点C1008は外側1004にあることか技
線分B C1009には前記の第8図または第9図の(
C)の場合が適用され 線分BC1009とクリッピン
グ境界1002との交点E 1010が出力され4 次
に頂点D 1011が入力されム 頂点D 1011は
外側1004にあることか収 線分CD 1012には
前記の第8図または第9図の(b)の場合が適用され頂
点は出力されな(−最後ζζ 再度頂点A 1005が
人力される力\ または最初に頂点A10Q5が入力さ
れたときに保持していたクリッピング境界1002に対
する頂点A1005の内外判定結果を参照すると、頂点
A 1005は内側1003にあることか仮 線分DA
1013には前記の第8図または第9図の(d)の場合
が適用され 線分D A 1013とクリッピング境界
1002との交点F 1014かまず出力され その後
に頂点A1005が出力されも 以上の結果 入力され
た多角形1001に対してクリッピング境界1002の
外側1004にある部分を取り除いた多角形の頂点の列
として、4つの頂点B、E、F、Aが出力される。な抵
第11図に以上の処理の流れを一覧にして示す。第1
1図において「位置関係」の欄(戴 「1つ前に人力さ
れた頂点」と「(今、)人力された頂点」でできる線分
とクリッピング境界1002との位置関係に対して、前
記の第8図または第9図の4通りのいずれの場合が適用
されたかを示していも
発明が解決しようとする課題
しかしなか収 以上に述べたクリッピング処理の方法に
基づくクリッピング回路において法 クリッピング境界
上に存在するような頂点を含んだ多角形を入力したとき
ベ クリッピング境界上の頂点が重複して出力されると
いう問題があっ九第12図に示す多角形A B CD
1201を用いて具体的に説明すも 第12図において
、1202はクリッピング境界を、1203はクリッピ
ング境界1202に対する内側を、1204はクリッピ
ング境界1202に対する外側を示も な抵 クリッピ
ング境界1202そのものは内側1203に含まれるも
のとすム また頂点B1206およびD 1210はク
リッピング境界1202上にあるものとナム な抵 多
角形1201の頂点はA、B、C1Dの順に入力される
ものとすム まず最初に頂点Al2O5が入力されも
頂点A 1205は内側1203ニあム 次に頂点B
1206が入力されも 頂点B 1206はクリッピン
グ境界1202上の頂点であa 従って、先の仮定から
頂点B 1206もまた内側1203にあることか技
線分A B 1207には前記の第8図または第9図の
(a)の場合が適用され 頂点B1206が出力される
。次に頂点C1208が゛入力されも 頂点C1208
は外側1204にあることか社 線分B C1209に
は前記の第8図または第9図の(C)の場合が適用さべ
線分B C1209とクリッピング境界1202との交
点が出力される力(この交点は頂点B 1206に等し
く、再度頂点B1206が出力されることになム 次に
頂点D1210が入力されも 頂点D 1210はクリ
ッピング境界1202上の頂点であム 従って、先の仮
定から頂点D 1210もまた内側1203にあること
か仮 線分CD 1211には前記の第8図または第9
図の(d)の場合が適用され 線分CD I211とク
リッピング境界1202との交点がまず出力され その
後に頂点D1210が出力される力士 この交点は頂点
D1210に等しく〜 従って、頂点D 1210が2
つ続けて出力されム 最後艮 再度頂点A 1205が
入力される力\ または最初に頂点A 1205が入力
されたときに保持していたクリッピング境界1202に
対する頂点A 1205の内外判定結果を参照すると、
頂点A 1205は内側1203にあることか仮 線分
D A 1212には前記の第8図または第9図の(a
)の場合が適用され 頂点Al2O5が出力されも 以
上の結果 入力された多角形1201に対してクリッピ
ング境界1202の外側I204にある部分を取り除い
た多角形の頂点の列として、5つの頂点B、B、D、D
、Aが出力されも 従って、クリッピング境界1202
上の頂点B 1206および頂点DI210が各々2度
ずつ出力されたことになも 第13図に以上の処理の流
れを一覧にして示九 以上の例で1よ クリッピング境
界そのものを内側に含まれるものとしてい九 逆にクリ
ッピング境界そのものが外側に含まれるものとした場合
を考えもこの場合に(上 第12図に示した多角形12
01を入力したとき、途中の経過を省略する力士 同様
に前記の第8図または第9図の各々の場合を適用して行
くと、第14図に示したようになり、クリッピングの結
果として3つの頂点の列B、D、Aが重複することなく
出力され 前記の問題点がないかのように思われる。し
かし クリッピング境界そのものが外側に含まれるとし
た場合にL やはりクリッピング境界上の頂点を含む多
角形を人力したとき(ミ クリッピング境界上にある頂
点が重複して出力される例を第15図に示も 第15図
において、1501はクリッピングの対象となる多角形
ABCDを、1502はクリッピング境界を、1503
はクリッピング境界1502に対する内側を、1504
はクリッピング境界l502に対する外側を示し 頂点
C1505がクリッピング境界1502上にあるものと
すム この場合に(よ 多角形1501を入力したとき
、途中の経過を省略する力士 同様に前記の第8図また
は第9図の各々の場合を適用して行くと、第16図に示
したようになり、クリッピングの結果として5つの頂点
の列B、C,C,D、Aが出力され 頂点C1505が
重複して出力されも 以上のようペ クリッピング境界
そのものが内側または外側のいずれの方に含まれるとし
て耘 クリッピング境界上にある頂点を含む多角形を入
力したとき、 この従来のクリッピング方法に基づくク
リッピング回路では クリッピング境界上にある頂点が
重複して出力されることは避けられなかっ九 一般鳳
クリッピングの処理は複数のクリッピング境界に対して
行われるたべ 1つのクリッピング境界に対して処理さ
れ出力された多角形の頂点の列を、次のクリッピング境
界に対する処理の入力として用いも 従って、途中のク
リッピングの処理において重複して出力された頂点に対
する処理(友 全く無駄な処理上なも このようζζ
従来のクリッピング回路で1よりリッピング境界上にあ
る頂点を含む多角形が入力された場合に処理量が増加す
るという問題点かあっ九 本発明はかかる点に鑑へ ク
リッピング境界上にある頂点を含む多角形に対してL
同一の頂点を重複して出力せず、無駄な処理の増加を招
かないようなりリッピング回路を提供することを目的と
すム
課題を解決するための手段
本発明は 前記の問題点を解決するために 人力された
多角形の頂点の座標を保持する頂点レジスタと、クリッ
ピング領域を表す境界面または境界線の方程式を保持す
る境界レジスタと、前記の境界レジスタの出力する境界
面または境界線の方程式と前記の入力された頂点の座標
とを入力としてその座標をもつ頂点が前記の境界面また
は境界線に対して内側に存在するか外側に存在するかも
しくは境界面または境界線の上に存在するかを判定する
内外判定回路と、前記の頂点レジスタの保持する頂点系
列における1つ前の頂点に対して前記の内外判定回路に
よって判定された結果を保持する内外判定結果レジスタ
と、前記の内外判定回路の出力する第1の内外判定結果
と前記の内外判定結果レジスタに保持された第2の内外
判定結果を入力としクリッピングの結果として出力すべ
き座標を判定するクリッピング判定回路と、前記の入力
された頂点の座標と前記の頂点レジスタの保持する座標
を2つの端点とする線分と前記の境界レジスタの出力す
る境界面または境界線の方程式を入力として前記の線分
と前記の境界面または境界線との交点の座標を前記のク
リッピング判定回路の出力に応じて計算する交点計算回
路と、前記の入力された頂点の座標と前記の交点計算回
路の出力する交点の座標から0ないし2つの座標を前記
のクリッピング判定回路の出力に応じて選択し順序付け
て出力する頂点出力回路とを具備することを特徴とする
クリッピング回路である。Vertex A 1005 is inside 1003 Next vertex B
1006 is input, vertex B 1006 is also inside 10
03 The case of (a) in Figure 8 or Figure 9 above is applied to the line segment A B 1007, and the vertex B
Even if 1006 is output and then vertex C1008 is manually input, vertex C1008 is on the outside 1004.
Line segment B C1009 has (
Case C) is applied, and the intersection point E 1010 between the line segment BC 1009 and the clipping boundary 1002 is output, and the vertex D 1011 is input next. The case of (b) in Fig. 8 or Fig. 9 is applied, and the vertex is not output (-Last Referring to the inside/outside determination result of vertex A 1005 with respect to clipping boundary 1002, vertex A 1005 is located inside 1003.
The case of (d) in Figure 8 or Figure 9 above is applied to 1013, and the intersection point F 1014 between the line segment D A 1013 and the clipping boundary 1002 is output first, and then the vertex A 1005 is output. Four vertices B, E, F, and A are output as a sequence of vertices of a polygon obtained by removing the portion outside 1004 of the clipping boundary 1002 from the input polygon 1001. Figure 11 shows a list of the flow of the above processing. 1st
In Figure 1, in the "Positional Relationship" column (Dai), the above-mentioned Even if it is shown which of the four cases shown in FIG. 8 or FIG. When inputting a polygon that includes vertices that exist, there is a problem that duplicate vertices on the clipping boundary are output.
In FIG. 12, 1202 indicates the clipping boundary, 1203 indicates the inside of the clipping boundary 1202, and 1204 indicates the outside of the clipping boundary 1202. However, the clipping boundary 1202 itself is inside 1203. It is assumed that the vertices B1206 and D 1210 are on the clipping boundary 1202. The vertices of polygon 1201 are input in the order of A, B, and C1D. Even if input
Vertex A 1205 is inside 1203 Next vertex B
Even if 1206 is input, vertex B 1206 is a vertex on the clipping boundary 1202. Therefore, from the previous assumption, it can be concluded that vertex B 1206 is also inside 1203.
The case of (a) in FIG. 8 or FIG. 9 is applied to the line segment A B 1207, and the vertex B 1206 is output. Next, if vertex C1208 is input, vertex C1208
The case of (C) in FIG. 8 or FIG. 9 above is applied to line segment B C1209.The intersection of line segment B C1209 and clipping boundary 1202 is the output force ( This intersection is equal to vertex B 1206, and vertex B 1206 will be output again. Even if vertex D 1210 is input next, vertex D 1210 is a vertex on clipping boundary 1202. Therefore, from the previous assumption, vertex D 1210 The provisional line segment CD 1211 is also located inside 1203.
Case (d) in the figure is applied, and the intersection of the line segment CD I211 and the clipping boundary 1202 is first output, and then the vertex D1210 is output.This intersection is equal to the vertex D1210~ Therefore, the vertex D1210 is 2
The force that causes vertex A 1205 to be input again is output one after another. Or, referring to the inside/outside determination result of vertex A 1205 with respect to the clipping boundary 1202 that was maintained when vertex A 1205 was first input,
The apex A 1205 is on the inside 1203. The tentative line segment D A 1212 has the shape (a
) is applied, and the vertex Al2O5 is output.The above result is a sequence of vertices of a polygon obtained by removing the part outside I204 of the clipping boundary 1202 from the input polygon 1201, and the five vertices B and B are ,D,D
, A are output. Therefore, the clipping boundary 1202
The above vertex B 1206 and vertex DI 210 are each output twice. Figure 13 shows a list of the above processing flow. Conversely, consider the case where the clipping boundary itself is included on the outside (the polygon 12 shown in Figure 12 above).
When inputting 01, the sumo wrestler omit the intermediate progress. Similarly, applying each of the cases in Figure 8 or Figure 9 above, it becomes as shown in Figure 14, and the result of clipping is 3. It seems as if the above-mentioned problem does not exist because the rows of vertices B, D, and A are output without duplication. However, if the clipping boundary itself is included on the outside, then when a polygon that includes vertices on the clipping boundary is manually generated (M), an example in which vertices on the clipping boundary are output duplicated is shown in Figure 15. In Fig. 15, 1501 indicates the polygon ABCD to be clipped, 1502 indicates the clipping boundary, and 1503
is inside the clipping boundary 1502, 1504
indicates the outside of the clipping boundary l502, and it is assumed that the vertex C1505 is on the clipping boundary 1502. By applying each case in Figure 9, the result will be as shown in Figure 16, and as a result of clipping, a string of five vertices B, C, C, D, and A will be output, with vertex C1505 being duplicated. The output is as shown above. When inputting a polygon that includes vertices on the clipping boundary, assuming that the clipping boundary itself is included either inside or outside, the clipping circuit based on this conventional clipping method calculates the clipping boundary. It is unavoidable that the vertices above are duplicated.
Clipping processing is performed on multiple clipping boundaries. The sequence of polygon vertices processed and output for one clipping boundary can be used as input for processing on the next clipping boundary. Therefore, intermediate clipping Processing for the vertices that were output redundantly in the processing of ζζ
In conventional clipping circuits, there is a problem in that the amount of processing increases when a polygon that includes vertices on the clipping boundary is input. L for polygon
An object of the present invention is to provide a ripping circuit that does not output the same vertex redundantly and does not increase unnecessary processing. A vertex register that holds the coordinates of the vertices of the human-entered polygon, a boundary register that holds the equation of the boundary surface or boundary line representing the clipping area, and the equation of the boundary surface or boundary line output by the boundary register. Input the coordinates of the input vertex and determine whether the vertex with the coordinates exists inside or outside the boundary surface or boundary line, or exists on the boundary surface or boundary line. an inside/outside determination circuit for determining the inside/outside determination circuit; an inside/outside determination result register for retaining the result determined by the inside/outside determination circuit for the previous vertex in the vertex series held by the vertex register; and the inside/outside determination circuit. a clipping judgment circuit which receives as input the first inside/outside judgment result outputted by the above-mentioned inside/outside judgment result and the second inside/outside judgment result held in the above-mentioned inside/outside judgment result register and judges the coordinates to be output as a result of clipping; A line segment whose two end points are the coordinates of the vertex and the coordinates held in the vertex register, and the equation of the boundary surface or boundary line output from the boundary register are input, and the line segment and the boundary surface or boundary line are input. an intersection calculation circuit that calculates the coordinates of the intersection according to the output of the clipping determination circuit; and 0 to 2 coordinates from the coordinates of the input vertex and the coordinates of the intersection output from the intersection calculation circuit. The present invention is a clipping circuit characterized by comprising a vertex output circuit that selects, orders, and outputs outputs according to the output of the clipping determination circuit.
作用
本発明は前記の構成により、入力された多角形の頂点の
座標と、クリッピング境界との位置関係を内外判定回路
によって、内側か外側かまたは境界上にあるかのいずれ
であるか判定し この判定結果と先に入力され頂点レジ
スタに保持されている1つ前の頂点に対して得られ 内
外判定結果レジスタに保持されている内外判定結果とを
用いて、クリッピング判定回路によってこれら隣接する
2つの頂点を結ぶ線分と前記のクリッピング境界との位
置関係を判定し 必要に応じて交点計算回路で算出され
た前記の線分とクリッピング境界との交点の座標と、入
力された頂点の座標を、それぞれの位置関係に応じて頂
点出力回路を介して出力することにより、クリッピング
の処理を行う。According to the above-described configuration, the present invention determines whether the coordinates of the vertices of the input polygon and the positional relationship with the clipping boundary are inside, outside, or on the boundary using an inside/outside determination circuit. Using the judgment result and the inside/outside judgment result obtained for the previous vertex input earlier and held in the vertex register and held in the inside/outside judgment result register, the clipping judgment circuit calculates the difference between these two adjacent vertices. Determine the positional relationship between the line segment connecting the vertices and the clipping boundary, and if necessary, calculate the coordinates of the intersection between the line segment and the clipping boundary calculated by the intersection calculation circuit and the coordinates of the input vertex, Clipping processing is performed by outputting via the vertex output circuit according to the respective positional relationships.
実施例
第1図(よ 本発明のクリッピング回路の一実施例の構
成を示すブロック図であも 第1図において101は順
次に入力される多角形の頂点の座標を、102は頂点レ
ジスタを、103は境界レジスタを、104は境界レジ
スタ103の出力するクリッピング境界の方程式を、1
05は内外判定回路を、106は内外判定回路105の
出力する内外判定結果を、107は内外判定結果105
を保持する内外判定結果レジスタを、108は内外判定
結果レジスタ107に保持されていゑ頂点系列における
1つ前の頂点に対する内外判定結果を、109はクリッ
ピング判定回路を、110はクリッピング判定回路10
9の出力する制御信号を、111は頂点レジスタ102
に保持されていべ 頂点系列における1つ前の頂点の座
標を、112は交点計算回路を、113は交点計算回路
112の出力する交点の座標を、114は頂点出力回路
を、115はクリッピング処理の結果として出力される
頂点の座標を示していも 以上のように構成された本発
明のクリッピング回路の動作を以下に説明する。まず、
多角形を構成する頂点の座標が図示しない外部回路から
順次1座標ずつ入力されも 入力された頂点の座標は頂
点レジスタ102に格納されるとともに 内外判定回路
105.交点計算回路112および頂点出力回路114
に供給されも 境界レジスタ103は少なくとも現在処
理の対象となっているクリッピング境界を含む複数のク
リッピング境界の方程式を保持しており、現在処理の対
象となっているクリッピング境界の方程式104を出力
し内外判定回路105および交点計算回路112に供給
すム 内外判定回路105は入力された頂点の座標10
1と、クリッピング境界の方程式から幾何学における公
知の技術を用いて、その頂点とクリッピング境界との位
置関係を判定すa 位置関係には第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
として出力し 内外判定結果レジスタ107に格納する
ととも置 クリッピング判定回路109に供給すム ク
リッピング判定回路1091:L 入力された頂点1
01に対する内外判定結果106と、内外判定結果レジ
スタ107に保持されていム 多角形の頂点系列におい
て1つ前の頂点に対する内外判定結果108を用いて、
現在入力された頂点とその1つ前の頂点とを結ぶ線分と
、クリッピング境界との位置関係を判定し クリッピン
グ処理の結果として出力すべき頂点の座標を決定し 頂
点出力回路114に対して制御信号110を供給すム
このとき、前記の線分とクリッピング境界との交点を出
力すべきであると判断した場合に(上 交点計算回路1
12に対しても交点113の計算を指示する制御信号1
10を供給すム 第3図の(a)〜(i)に前記の線分
とクリッピング境界との9通りのすべての位置関係を示
す。第3図において、201〜203(よ 第2図と同
一のものであム 301は1つ前に入力された頂点Pを
、302は現在人力f7いる頂点Qを、303は線分P
Qとクリッピング境界201との交点Rを、それぞれ示
していも 第4図番へ 第3図の各々の場合に対応し
て、入力された頂点の座標101に対する内外判定結果
106と、内外判定結果レジスタ107に保持されてい
る多角形の頂点系列において1つ前の頂点に対する内外
判定結果108と、クリッピング判定回路109におい
て出力すべきであると判定される頂点の関係を示す。第
4図に示した関係(戴 前記の第9図に示した関係を完
全に包含しているた教 クリッピング境界上にない頂点
については 従来のクリッピング回路と同様に処理でき
ることは保証される。交点計算回路112 にj入力さ
れた頂点の座標101と、頂点レジスタ102に保持さ
れている多角形の頂点系列において1つ前の頂点の座標
111と、境界レジスタ103に保持されてい& 現在
処理の対象となっているクリッピング境界の方程式10
4を用いて、現在入力された頂点とその1つ前の頂点と
を結ぶ線分とクリッピング境界との交点の座標を、クリ
ッピング判定回路■09の判定結果を示す制御信号11
0に応じて計算すム頂点出力回路114fi クリッ
ピング判定回路109の判定結果を示す制御信号110
に応じて(即ち第4図の関係に応じて)、交点計算回路
112で必要に応じて計算された交点の座標113と、
現在入力されている頂点の座標101か=0ないし2つ
の頂点の座標115を順序付けて出力すム 前記の第1
0@ 第12@および第15図の各々に示した多角形
に対して、本発明のクリッピング回路を用いてクリッピ
ング処理を行った場合の処理の流れを一覧にして、それ
ぞれ第5@ 第6@ および第7図に示す。前記の第1
0図の例の多角形に対して(友 4つの頂点の列B、E
、F、A力交 第12図の例の多角形に対しては3つの
頂点の列B、D、Aカ(第15図の例の多角形に対して
は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. 103 is the boundary register, 104 is the clipping boundary equation output from the boundary register 103, and 1
05 is the inside/outside judgment circuit, 106 is the inside/outside judgment result outputted from the inside/outside judgment circuit 105, and 107 is the inside/outside judgment result 105.
108 is the inside/outside determination result register for the previous vertex in the vertex series held in the inside/outside determination result register 107; 109 is the clipping determination circuit; 110 is the clipping determination circuit 10;
9 outputs a control signal, 111 outputs a control signal from the vertex register 102
112 is the coordinate of the previous vertex in the vertex series, 112 is the intersection calculation circuit, 113 is the coordinate of the intersection output by the intersection calculation circuit 112, 114 is the vertex output circuit, and 115 is the clipping process. The operation of the clipping circuit of the present invention configured as above will be described below. first,
Even if the coordinates of the vertices constituting the polygon are input one by one from an external circuit (not shown), the input coordinates of the vertices are stored in the vertex register 102 and the inside/outside determination circuit 105. Intersection calculation circuit 112 and vertex output circuit 114
The boundary register 103 holds equations of a plurality of clipping boundaries including at least the clipping boundary currently being processed, and outputs the equation 104 of the clipping boundary currently being processed. The inside/outside determination circuit 105 supplies the coordinates 10 of the input vertex to the determination circuit 105 and the intersection calculation circuit 112.
1 and the equation of the clipping boundary using a well-known technique in geometry to determine the positional relationship between the vertex and the clipping boundary.
) In Fig. 2, 201 indicates the clipping boundary, 202 indicates the inside of the clipping boundary 201, 203 indicates the outside of the clipping boundary 201, and 204 indicates the input vertex. However, it is assumed that the clipping boundary 201 is not included in either the inside 202 or the outside 203. In FIG. 204 is on the clipping boundary 201, (C) is the vertex 204
The inside/outside determination circuit 105 uses the determination result 106 as a signal indicating which of the three types is present.
The input vertex 1 is output as follows and stored in the inside/outside judgment result register 107. Also supplied to the clipping judgment circuit 109. Clipping judgment circuit 1091:L Input vertex 1
Using the inside/outside judgment result 106 for 01 and the inside/outside judgment result 108 for the previous vertex in the vertex series of the polygon held in the inside/outside judgment result register 107,
Determines the positional relationship between the line segment connecting the currently input vertex and the previous vertex and the clipping boundary, determines the coordinates of the vertex to be output as a result of clipping processing, and controls the vertex output circuit 114. A module that supplies signal 110
At this time, if it is determined that the intersection between the line segment and the clipping boundary should be output (above intersection calculation circuit 1
Control signal 1 instructs to calculate the intersection point 113 also for 12
FIG. 3(a) to (i) show all nine positional relationships between the line segment and the clipping boundary. In FIG. 3, 201 to 203 (the same as in FIG.
The intersection point R between Q and the clipping boundary 201 is shown in Fig. 4. Corresponding to each case in Fig. 3, the inside/outside judgment result 106 and the inside/outside judgment result register for the input vertex coordinates 101 are shown. The relationship between the inside/outside determination result 108 for the previous vertex in the polygon vertex series held in 107 and the vertex determined to be output by the clipping determination circuit 109 is shown. If the relationship shown in Figure 4 is completely included in the relationship shown in Figure 9 above, it is guaranteed that vertices that are not on the clipping boundary can be processed in the same way as the conventional clipping circuit. The coordinates 101 of the vertex input to the calculation circuit 112, the coordinates 111 of the previous vertex in the polygon vertex series held in the vertex register 102, and the coordinates 111 of the previous vertex held in the boundary register 103 & the target of current processing Equation 10 of the clipping boundary is
4, the coordinates of the intersection of the clipping boundary and the line segment connecting the currently input vertex and the previous vertex are determined using the control signal 11 indicating the determination result of the clipping determination circuit ■09.
A control signal 110 indicating the judgment result of the clipping judgment circuit 109
(i.e., according to the relationship shown in FIG. 4), the coordinates 113 of the intersection calculated as necessary by the intersection calculation circuit 112,
The currently input vertex coordinates 101 or = 0 or the coordinates 115 of two vertices are output in order.
0 @ Figure 12 @ and Figure 15 respectively show the processing flow when performing clipping processing using the clipping circuit of the present invention on the polygons shown in Figures 5 @ 6 @ and shown in FIG. The first
For the example polygon in figure 0,
, F, A For the example polygon in Figure 12, there are three vertices B, D, A (for the example polygon in Figure 15, there are four vertices B, C). , D, and A (respectively, the vertices are output without overlapping). -The sword is expressed individually as software.Using a normal CPU (Central Processing Unit),
The functions of each circuit may be realized by software,
It should be added that the clipping circuit of the present invention can be constructed by realizing each register using a normal memory device or a CPU register.
発明の効果
以上に説明してきたように 本発明によればクリッピン
グ境界上にある頂点を含むような多角形が入力されたと
きでk 同一の頂点を重複して出力することがないよう
なりリッピング回路が実現でき、無駄な処理の増大を防
ぐことができ、処理速度の向上が図れもEffects of the Invention As explained above, according to the present invention, when a polygon including vertices on the clipping boundary is input, the ripping circuit does not output the same vertices twice. It is possible to realize this, prevent unnecessary increases in processing, and improve processing speed.
第1図は本発明のクリッピング回路の一実施例の構成を
示すブロックは 第2図は1つの頂点とクリッピング境
界の位置関係@ 第3図は2つの頂点を結ぶ線分とクリ
ッピング境界の位置関係は第4図は第3図に示す位置関
係と出力すべき頂点の関係を示す対応云 第5図は第1
0図に示す多角形の例に対して本発明のクリッピング回
路を用いて処理した場合の処理の流れを示す@ 第6図
は第12図に示す多角形の例に対して本発明のクリッピ
ング回路を用いて処理した場合の処理の流れを示す医
第7図は第15図に示す多角形の例に対して本発明のク
リッピング回路を用いて処理した場合の処理の流れを示
す諷 第8図は従来のクリッピング回路において用いて
いた線分とクリッピング境界の位置関係医 第9図は第
8図に示す位置関係と出力すべき頂点の関係を示す対応
は 第10図はクリッピングの対象となる多角形の例を
示す平面は 第11図は第10図に示す多角形の例に対
して従来のクリッピング回路を用いて処理した場合の処
理の流れを示すに 第12図はクリッピングの対象とな
る多角形の例を示す平面@ 第13図は第12図に示す
多角形の例に対して、クリッピング境界そのものが内側
に含まれると仮定した上で、従来のクリッピング回路を
用いて処理した場合の処理の流れを示す文 第14図は
第12図に示す多角形の例に対して、クリッピング境界
そのものが外側に含まれると仮定した上で、従来のクリ
ッピング回路を用いて処理した場合の処理の流れを示す
又第15図はクリッピングの対象となる多角形の例を示
す平面@ 第16図は第15図に示す多角形の例に対し
て従来のクリッピング回路を用いて処理した場合の処理
の流れを示す図であム
101・・・・入力された頂点のJIHI 102・
・・・頂点レジス久 103・・・・境界レジス久 1
05・・・・内外判定口a107・・・・内外判定結果
レジス久 109・・・・クリッピング判定同区112
・・・・交点計算同区114・・・・頂点出力回胤Figure 1 is a block diagram showing the configuration of an embodiment of the clipping circuit of the present invention. Figure 2 is the positional relationship between one vertex and the clipping boundary. Figure 3 is the positional relationship between the line segment connecting two vertices and the clipping boundary. Figure 4 shows the correspondence between the positional relationship shown in Figure 3 and the relationship between the vertices to be output.
Figure 6 shows the processing flow when the polygon example shown in Figure 1 is processed using the clipping circuit of the present invention. A medical diagram showing the processing flow when processing using
Figure 7 shows the processing flow when the polygon example shown in Figure 15 is processed using the clipping circuit of the present invention. Figure 8 shows the line segments and clipping used in the conventional clipping circuit. Figure 9 shows the correspondence between the positional relationship shown in Figure 8 and the relationship between the vertices to be output. Figure 10 shows the plane showing an example of a polygon to be clipped. Figure 12 is a plane showing an example of a polygon to be clipped; Figure 13 is a plane showing an example of a polygon to be clipped; Figure 14 shows the flow of processing when a conventional clipping circuit is used to process the example polygon shown in the figure, assuming that the clipping boundary itself is included inside. Figure 15 shows the processing flow when using a conventional clipping circuit to process the polygon example shown, assuming that the clipping boundary itself is included on the outside. Plane showing an example of a polygon @ Fig. 16 is a diagram showing the flow of processing when the polygon example shown in Fig. 15 is processed using a conventional clipping circuit. The peak of JIHI 102.
... Apex Regis Hisa 103... Boundary Regis Hisa 1
05...Inside/outside judgment port a107...Inside/outside judgment result Regis Ku 109...Clipping judgment same area 112
... Intersection calculation same section 114 ... Vertex output regeneration
Claims (1)
と、クリッピング領域を表す境界面または境界線の方程
式を保持する境界レジスタと、前記の境界レジスタの出
力する境界面または境界線の方程式と前記の入力された
頂点の座標とを入力としてその座標をもつ頂点が前記の
境界面または境界線に対して内側に存在するか外側に存
在するかもしくは境界面または境界線の上に存在するか
を判定する内外判定回路と、前記の頂点レジスタの保持
する頂点系列における1つ前の頂点に対して前記の内外
判定回路によって判定された結果を保持する内外判定結
果レジスタと、前記の内外判定回路の出力する第1の内
外判定結果と前記の内外判定結果レジスタに保持された
第2の内外判定結果を入力としクリッピングの結果とし
て出力すべき座標を判定するクリッピング判定回路と、
前記の入力された頂点の座標と前記の頂点レジスタの保
持する座標を2つの端点とする線分と前記の境界レジス
タの出力する境界面または境界線の方程式を入力として
前記の線分と前記の境界面または境界線との交点の座標
を前記のクリッピング判定回路の出力に応じて計算する
交点計算回路と、前記の入力された頂点の座標と前記の
交点計算回路の出力する交点の座標から0ないし2つの
座標を前記のクリッピング判定回路の出力に応じて選択
し順序付けて出力する頂点出力回路とを具備することを
特徴とするクリッピング回路。a vertex register that holds the coordinates of the vertices of the input polygon; a boundary register that holds the equation of the boundary surface or boundary line representing the clipping area; and the equation of the boundary surface or boundary line output from the boundary register and the The input coordinates of the vertex are input to determine whether the vertex with the coordinates exists inside or outside the boundary surface or boundary line, or exists on the boundary surface or boundary line. an inside/outside determination circuit for determining; an inside/outside determination result register for retaining a result determined by the inside/outside determination circuit for the previous vertex in the vertex series held by the vertex register; and an inside/outside determination result register for the inside/outside determination circuit. a clipping determination circuit that receives as input a first inside/outside determination result to be output and a second inside/outside determination result held in the inside/outside determination result register and determines coordinates to be output as a result of clipping;
A line segment whose two end points are the coordinates of the input vertex and the coordinates held in the vertex register, and the equation of the boundary surface or boundary line output from the boundary register are input, and the line segment and the coordinates held by the vertex register are input. an intersection calculation circuit that calculates the coordinates of the intersection with the boundary surface or the boundary line according to the output of the clipping determination circuit; and 0 from the coordinates of the input vertex and the coordinates of the intersection output from the intersection calculation circuit. or a vertex output circuit that selects, orders and outputs two coordinates according to the output of the clipping determination circuit.
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 true JPH036785A (en) | 1991-01-14 |
| JPH0821085B2 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) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002529868A (en) * | 1998-11-06 | 2002-09-10 | イマジネイション テクノロジーズ リミテッド | Shading of 3D computer generated images |
-
1989
- 1989-06-05 JP JP1142513A patent/JPH0821085B2/en not_active Expired - Fee Related
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002529868A (en) * | 1998-11-06 | 2002-09-10 | イマジネイション テクノロジーズ リミテッド | Shading of 3D computer generated images |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0821085B2 (en) | 1996-03-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Sheng et al. | Triangulation of trimmed surfaces in parametric space | |
| EP0240557B1 (en) | Computer graphics, parametric patch parallel subdivision processor | |
| US5488692A (en) | System and method for representing and manipulating three-dimensional objects on massively parallel architectures | |
| JP2004038630A (en) | Numerical analysis device using mixed grid type solution adaptive grid method | |
| JPH036785A (en) | Clipping circuit | |
| JP3337608B2 (en) | Analysis simulation device | |
| JPH01193980A (en) | clipping circuit | |
| JP2734649B2 (en) | Intersection calculation method between curved surface and straight line | |
| JPH03209499A (en) | Forming method for outline font and drawing device for the same | |
| JP3302768B2 (en) | Finite element splitting device | |
| JP2734644B2 (en) | Intersection calculation method between free-form surfaces | |
| JPS63118982A (en) | Arithmetic processing method for deciding whether points are inside or outside on polygon | |
| JPH10240790A (en) | Instructions for creating fillet surface | |
| JP2734643B2 (en) | Intersection calculation method between free curves | |
| JP3139431B2 (en) | Connection determination device, method and recording medium | |
| JP3886293B2 (en) | Set calculation method of 3D curved surface shape | |
| JP3057797B2 (en) | Fuzzy arithmetic unit | |
| JPH1049652A (en) | Method for calculating intersection of b-spline curve and straight line in three-dimensional cad | |
| JPH05120430A (en) | Crossing judgment and intersection calculation system for polygon and straight line | |
| JP2879831B2 (en) | Graphic element extraction method | |
| JPS6081604A (en) | Method for specifying pattern of numerical control tape | |
| JP3681240B2 (en) | Three-dimensional shape display method and three-dimensional CAD system using the method | |
| JPH08287286A (en) | Plane image mapping method | |
| JP2001092992A (en) | Three-dimensional shape processing method and recording medium storing a program for executing the method | |
| JPH01175682A (en) | Inter-polygon intersection line calculation system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |