JPH01154294A - Polygon drawing system - Google Patents

Polygon drawing system

Info

Publication number
JPH01154294A
JPH01154294A JP31214087A JP31214087A JPH01154294A JP H01154294 A JPH01154294 A JP H01154294A JP 31214087 A JP31214087 A JP 31214087A JP 31214087 A JP31214087 A JP 31214087A JP H01154294 A JPH01154294 A JP H01154294A
Authority
JP
Japan
Prior art keywords
boundary
code
boundary code
intersection
clipping
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.)
Pending
Application number
JP31214087A
Other languages
Japanese (ja)
Inventor
Toshiya Mima
美間 俊哉
Yuji Nakagawa
裕治 中川
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP31214087A priority Critical patent/JPH01154294A/en
Publication of JPH01154294A publication Critical patent/JPH01154294A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

PURPOSE:To make a polygon being free from an unnecessary line by suppressing unnecessary edge generated at the time of generating plural polygons by clipping process. CONSTITUTION:With regard to each of the respective apexes of plural polygons obtained by clipping, whether an intersection with each borderline of a clip frame exists of not is described by a boundary code Cp, and based on this boundary code Cp, a boundary code C of the intersection of each side of plural polygons and a scan line, and a boundary code Cs between each adjacent intersection on the scan line are derived successively, and when all bit codes in this obtained boundary code Cs are a code '0', a vector for face painting is generated between the intersections corresponding to its boundary code Cs. On the other hand, when a code '1' exists in a bit train of said boundary code Cs, the generation of a vector required for face painting is suppressed between the intersections corresponding to its boundary code Cs.

Description

【発明の詳細な説明】 〔概 要〕 クリッピング処理と面塗り処理を用いる多角形の描画方
式に関し、 クリッピング処理によって複数の多角形を生成する際に
発生する擬像エツジの描画を抑制することを目的とし、 クリッピングにより生成された複数の多角形の各頂点の
それぞれについて、その頂点と上記クリップ枠の各境界
線との交差の有無を、クリップ枠の境界線の総数に等し
いビット数を有しかつ各ビットをクリップ枠の各境界線
に1対1に対応させたビット列からなる境界コードによ
り記述し、上記複数の多角形の各辺とスキャンラインと
の各交点について、その交点の交わっている辺の両端の
頂点の上記境界コードの間でその対応するビットごとに
論理積演算を行うことにより各交点の境界コードを求め
、 スキャンライン上で隣り合う交点同士の間で上記境界コ
ードの対応するビットごとに論理積演算を行うことによ
り各交点間の境界コードを求め、この得られた境界コー
ドの符号状態によってその交点間を塗り潰すためのベク
トルの生成を制御するように構成する。
[Detailed Description of the Invention] [Summary] Regarding a polygon drawing method that uses clipping processing and surface painting processing, the present invention aims to suppress the drawing of pseudo-image edges that occur when multiple polygons are generated by clipping processing. For each vertex of a plurality of polygons generated by clipping, determine whether or not that vertex intersects each boundary line of the clipping frame with a number of bits equal to the total number of boundaries of the clipping frame. And each bit is described by a boundary code consisting of a bit string in one-to-one correspondence with each boundary line of the clip frame, and each intersection of each side of the plurality of polygons and the scan line is Find the boundary code of each intersection by performing a logical AND operation for each corresponding bit between the boundary codes of the vertices at both ends of the edge, and calculate the correspondence of the boundary codes between adjacent intersections on the scan line. The boundary code between each intersection point is obtained by performing a logical AND operation for each bit, and the generation of a vector for filling in the area between the intersection points is controlled based on the code state of the obtained boundary code.

〔産業上の利用分野〕[Industrial application field]

クリッピング処理と面塗り処理を用いる描画方式におけ
る多角形の描画方式に関する。
This invention relates to a polygon drawing method in a drawing method that uses clipping processing and surface painting processing.

〔従来の技術〕[Conventional technology]

第4図はクリッピング処理と面塗り処理を用いる従来の
多角形の描画方式を示すもので、図形データとして与え
られた第4図(a)に示すような被処理多角形1を座標
軸に平行な四角形のクリップ枠2を用いてクリッピング
して同図(b)に示すような多角形3を生成し、次いで
この生成された多角形3の内部を塗り潰すためのベクト
ル4を面塗り処理により生成し、このベクトル列に従っ
てラスクスキャンすることにより同図(C)に示すよう
な内部を面塗りした多角形3をCRTデイスプレィなど
に表示していた。
Figure 4 shows a conventional polygon drawing method that uses clipping processing and fill processing. A polygon 3 as shown in the figure (b) is generated by clipping using a rectangular clipping frame 2, and then a vector 4 for filling the inside of the generated polygon 3 is generated by area painting processing. By performing rask scanning according to this vector sequence, a polygon 3 whose interior is painted as shown in FIG. 2C is displayed on a CRT display or the like.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上記した従来の描画方式によるときは、第5図(a)に
示すような辺A、B、Cを有する被処理多角形1をクリ
ップ枠2によりクリッピングして複数の多角形を生成す
る場合、このクリッピングによって同図(ロ)に示すよ
うな3つの多角形5,6.7が生成されると同時に、ク
リップ枠2の境界線による擬似エツジ8.9も図形の一
部として抽出されてしまう。
When using the conventional drawing method described above, when a polygon to be processed 1 having sides A, B, and C as shown in FIG. 5(a) is clipped with a clip frame 2 to generate a plurality of polygons, As a result of this clipping, three polygons 5, 6.7 as shown in FIG. .

従来、スキャンラインに平行な水平方向の擬似エツジ9
については描画時にこれを抑制する手段が存在したが、
スキャンラインと直交あるいは交差する方向の擬似エツ
ジ8については抑制手段がなく、面塗り処理後の画面に
は同図(C)のように擬似エツジ9がそのまま描画され
てしまうという問題があった。
Conventionally, a horizontal pseudo edge parallel to the scan line 9
There was a way to suppress this when drawing, but
There is no means for suppressing the pseudo edges 8 in the direction perpendicular to or intersecting the scan line, and there is a problem in that the pseudo edges 9 are drawn as they are on the screen after the surface painting process, as shown in FIG. 3(C).

本発明は、クリッピング処理によって複数の多角形を生
成する際に発生する擬似エツジの描画を抑制することを
目的とする。
An object of the present invention is to suppress the drawing of pseudo edges that occur when a plurality of polygons are generated by clipping processing.

〔問題点を解決するための手段] 第1図に処理のフローチャートを示すように、被処理多
角形の図形データをクリップ枠でクリッピングすること
により複数の多角形を生成し、この複数の多角形の内部
を面塗り処理によって面塗りすることにより描画するよ
うにした多角形の描画方式において、上記クリッピング
により生成された複数の多角形の各頂点のそれぞれにつ
いて、その頂点と上記クリップ枠の各境界線との交差の
有無を、クリップ枠の境界線の総数に等しいビット数を
有しかつ各ビットをクリップ枠の各境界線に1対1に対
応させたビット列からなる境界コードC2により記述し
、上記複数の多角形の各辺とスキャンラインとの各交点
について、その交点の交わっている辺の両端の頂点の上
記境界コードC9の間でその対応するビットごとに論理
積演算を行うことにより各交点の境界コードcoを求め
、スキャンライン上で隣り合う交点同士の間で上記境界
コードCcの対応するビットごとに論理積演算を行うこ
とにより各交点間の境界コードCsを求め、この得られ
た境界コードC8の符号状態によってその交点間を塗り
潰すためのベクトルの生成を制御するようにした。
[Means for solving the problem] As shown in the processing flowchart in Figure 1, a plurality of polygons are generated by clipping the figure data of the polygon to be processed with a clip frame, and In a polygon drawing method in which the interior of the polygon is drawn by filling the inside of the polygon with fill processing, for each of the vertices of the plurality of polygons generated by the above clipping, the border between that vertex and the above clipping frame is The presence or absence of intersection with a line is described by a boundary code C2 consisting of a bit string having a number of bits equal to the total number of boundaries of the clip frame and each bit corresponding to each boundary line of the clip frame on a one-to-one basis, For each intersection between each side of the plurality of polygons and the scan line, a logical AND operation is performed for each corresponding bit between the boundary codes C9 of the vertices at both ends of the sides where the intersections intersect. Find the boundary code co of the intersection, and perform an AND operation for each corresponding bit of the boundary code Cc between adjacent intersections on the scan line to find the boundary code Cs between each intersection. The generation of a vector for filling in between the intersection points is controlled by the code state of the boundary code C8.

〔作 用〕[For production]

クリッピングによって得られた複数の多角形の各頂点の
それぞれについてクリップ枠の各境界線との交差の有無
を境界コードC9により記述し、この境界コードC2を
基礎として、複数の多角形の各辺とスキャンラインとの
交点の境界コードCと、スキャンライン上の隣り合う交
点同士の間の境界コードC5を順次求め、この得られた
境界コードCs中のすべてのビットが符号0°゛である
場合にはその境界コードCsに対応する交点間は面塗り
のためのベクトルを発生する。
For each vertex of a plurality of polygons obtained by clipping, the presence or absence of intersection with each boundary line of the clip frame is described by a boundary code C9, and based on this boundary code C2, each side of a plurality of polygons and The boundary code C at the intersection with the scan line and the boundary code C5 between adjacent intersections on the scan line are sequentially obtained, and when all bits in the obtained boundary code Cs are code 0°, generates a vector for filling between the intersection points corresponding to the boundary code Cs.

一方、上記境界コードCsのビット列中に符号“1°′
が存在する場合にはその境界コードC3に対応する交点
間は面塗りのためのベクトルの発生を抑制する。
On the other hand, in the bit string of the boundary code Cs, the code "1°'"
If there is, the generation of vectors for surface painting is suppressed between the intersections corresponding to the boundary code C3.

したがって、クリッピングによって発生した擬似エツジ
部分では面塗りのためのベクトルの発生が抑制され、擬
似エツジが画面に描画されることがなくなる。
Therefore, generation of vectors for fill-in is suppressed in the pseudo edge portion generated by clipping, and pseudo edges are no longer drawn on the screen.

〔実施例〕〔Example〕

第2図は本発明を適用して構成した描画装置の一実施例
を示すもので、セグメント管理部21はホストコンピュ
ータとの間で被処理多角形などの図形データや必要な情
報の送受信とセグメントバッファ22の管理をおこなう
回路、セグメントバッファ22はホストコンピュータか
ら送られてくる図形データやその属性データを保持記憶
するメモリ、座標変換部23はセグメント管理部21か
ら送られてくる座標変換行列に基づいて図形データをワ
ールド座標系からスクリーン座標系などに座標変換する
回路、クリッピング処理部24は第3図(a)に示すよ
うな図形データとして与えられる被処理多角形1をクリ
ップ枠2によって任意の位置でクリッピングする回路、
面塗り処理部25はクリッピング処理により生成された
多角形の内部を面塗りするためのベクトル列を発生する
回路、26は面塗り処理部25から送られてくるベクト
ル列をラスクスキャンによる描画のためのドツトパター
ンに変換する回路、フレームバッファ27はCRTデイ
スプレィ28に表示する上記ドツトパターンデータを一
時記憶するメモリである。
FIG. 2 shows an embodiment of a drawing device configured according to the present invention, in which a segment management unit 21 sends and receives graphic data such as polygons to be processed and necessary information to and from a host computer, and segments The segment buffer 22 is a circuit that manages the buffer 22. The segment buffer 22 is a memory that holds and stores graphic data sent from the host computer and its attribute data.The coordinate conversion unit 23 converts data based on the coordinate conversion matrix sent from the segment management unit 21. The clipping processing unit 24, which is a circuit that converts the coordinates of graphic data from the world coordinate system to the screen coordinate system, converts the polygon 1 to be processed given as graphic data as shown in FIG. Circuit clipping at position,
The fill processing unit 25 is a circuit that generates a vector sequence for filling the inside of a polygon generated by clipping processing, and the circuit 26 is a circuit for drawing the vector sequence sent from the fill processing unit 25 by rask scanning. The frame buffer 27 is a memory that temporarily stores the dot pattern data to be displayed on the CRT display 28.

第3図は上記実施例による描画例を示すもので、第5図
(a)に示したと同一形状の被処理多角形lを同一形状
のクリップ枠2により同一箇所でクリッピングして描画
した場合を例に採って示したものである。
FIG. 3 shows an example of drawing according to the above embodiment, in which a polygon l having the same shape as shown in FIG. This is shown as an example.

セグメント管理部21はホストコンピュータから送られ
てきた図形データをセグメントバッファ22から読み出
して座標変換部23に送り、座標変換部23はこの図形
データをワールド座標系からスクリーン座標系に座標変
換してクリッピング処理部24に送る。
The segment management section 21 reads the graphic data sent from the host computer from the segment buffer 22 and sends it to the coordinate conversion section 23, which converts the coordinates of this graphic data from the world coordinate system to the screen coordinate system and performs clipping. It is sent to the processing section 24.

クリッピング処理部24は上記図形データにより与えら
れる第3図(a)に示す被処理多角形1をクリップ枠2
により辺A、B、Cの位置でクリッピングし、第3図(
b)に示す3つの多角形5.6.7を生成する。
The clipping processing unit 24 converts the processed polygon 1 shown in FIG. 3(a) given by the graphic data into a clip frame 2.
Clip at the positions of sides A, B, and C using Figure 3 (
Generate the three polygons 5.6.7 shown in b).

クリッピング処理部24には、クリッピング枠2を形成
する4つの境界線X、〜X4の数に等しい4つのビット
B、〜B4からなりかつ各ビットBl””B4を各境界
線X、〜X4のそれぞれに1対1に対応させた境界コー
ドC−−(Bl、BZ、B3゜B、)が予め用意されて
おり、上記のようにして生成された3つの多角形5,6
.7の各頂点P1〜P、のそれぞれに上記境界コードC
Pを付与する。
The clipping processing unit 24 consists of four bits B, ~B4 equal to the number of the four boundary lines Boundary codes C--(Bl, BZ, B3°B,) are prepared in advance in a one-to-one correspondence with each other, and the three polygons 5 and 6 generated as described above are
.. The above boundary code C is applied to each of the vertices P1 to P of 7.
Give P.

そして、クリッピング処理部24は上記各頂点P l”
= P 9のそれぞれについて、その頂点がクリップ枠
2のどの境界線X1−x4と交差しているか否かを判別
し、その交差状態を上記境界コードC,= (B、、B
、、B、、B、)により符号化して記述する。
Then, the clipping processing unit 24
For each of = P 9, it is determined whether or not the vertex intersects with which border line X1-x4 of the clip frame 2, and the crossing state is determined using the above border code C, = (B,,B
,,B,,B,).

すなわち、第3図(a)に示すように、頂点P1はクリ
ップ枠2の境界線XI−Xaのいずれとも交差していな
いので、境界コードC2中の境界線X+に対応するピッ
)B、=“′0”、境界線X2に対応するとッ)Bz=
“0”境界線X3に対応するピッ)B、=“O”、境界
線x4に対応するビットBa =“°0”となり、頂点
P1の境界コードC2は(0,0,0,0)となる。
That is, as shown in FIG. 3(a), since the vertex P1 does not intersect with any of the boundary lines XI-Xa of the clip frame 2, the peak corresponding to the boundary line X+ in the boundary code C2 is "'0", which corresponds to the boundary line X2)Bz=
“0” B corresponding to boundary line X3 = “O”, bit Ba = “°0” corresponding to boundary line Become.

また、頂点P2はクリップ枠2の境界線X3とのみ交差
しているのでこの境界線X3に対応するビットB3のみ
が“1゛°、他のビットB、、B2.B4は“′0“と
なり、その境界コードCPは(0,0゜1.0)となる
Also, since the vertex P2 intersects only the boundary line X3 of the clip frame 2, only the bit B3 corresponding to this boundary line , its boundary code CP is (0,0°1.0).

同様にして、各頂点P3〜P、についてもその頂点と交
差する境界線に対応するビットが“l”に、また交差し
ない境界線に対応するi′フット“′0”にそれぞれセ
ットされ、すべての頂点P。
Similarly, for each vertex P3 to P, the bit corresponding to the boundary line that intersects with that vertex is set to "l", and the bit corresponding to the boundary line that does not intersect is set to i' foot "'0", and all The vertex P of

〜P9についての境界コードCI、が求められる。The boundary code CI for ~P9 is determined.

このようにして得られた複数の多角形5,6゜7の各頂
点P、−P、の境界コードcpは次のようになる。
The boundary code cp of each vertex P, -P of the plurality of polygons 5, 6°7 thus obtained is as follows.

P、の境界:] −トC,= (0,0,0,0>P2
(7)境界ニア−1”Cp= (0,0,1,0)P3
の境界コードCP= (0,0,1,0’)P4の境界
コードC,= (0,1,0,0)P5の境界コードC
P= (0,1,0,0)P6の境界コードCp= (
0,0,0,O)P7の境界コードCp= (0,1,
0,0)P8の境界コードC,= (0,1,1,0)
P、の境界]  (Cp=(0,0,t、0 )上記境
界コードC2は多角形5,6.7についての図形データ
とともに面塗り処理部25へ送られ、面塗り処理部25
では次ぎに述べるような処理を実行して面塗りのための
ベクトル列を生成する。
Boundary of P:] −toC,= (0,0,0,0>P2
(7) Boundary near-1”Cp= (0,0,1,0)P3
boundary code CP = (0,0,1,0') boundary code C of P4, = (0,1,0,0) boundary code C of P5
P= (0,1,0,0) P6 boundary code Cp= (
0,0,0,O) P7 boundary code Cp= (0,1,
0,0) P8 boundary code C,= (0,1,1,0)
Boundary of P] (Cp=(0,0,t,0) The above boundary code C2 is sent to the fill processing section 25 along with the graphic data for polygons 5, 6.7,
Next, perform the processing described below to generate a vector sequence for surface painting.

先ず、第3図(C)に示すように、面塗りを行うための
スキャンライン!と各多角形5,6.7との交点a、b
、c、dのそれぞれについて、その交点が交わっている
多角形の辺の両端の2つの頂点の境界コードC9の間で
対応するビットごとに論理積(AND)演算を行い、各
交点a、b、c。
First, as shown in Figure 3 (C), scan lines for surface painting! and the intersections a and b with each polygon 5, 6.7
, c, and d, a logical product (AND) operation is performed for each corresponding bit between the boundary codes C9 of the two vertices at both ends of the polygon side where the intersection points intersect, and each intersection point a, b ,c.

dの境界コードC0を求める。なお、同図(C)中の交
点Cは頂点P4とP、を結ぶ辺とスキャンライン2との
交点、また交点dは頂点P7とPIlを結ぶ辺とスキャ
ンラインlとの交点であって、この2つの交点Cとdが
重なっているものとして考える。
Find the boundary code C0 of d. Note that the intersection C in the same figure (C) is the intersection of the scan line 2 and the side connecting the vertices P4 and P, and the intersection d is the intersection of the scan line 1 and the side connecting the vertices P7 and PI1, It is assumed that these two intersection points C and d overlap.

交点aは多角形5の頂点P、とP、とを結ぶ辺と交わっ
ているので、この辺の両端に位置する頂点P、の境界コ
ードC,= (0,0,0,0)と頂点P9の境界コー
ドC,= (0,0,1,0)との間でその対応するビ
ットごとに論理積演算を行い、交点aの境界コードCc
 = (0,0,0,0)を求める。
Since the intersection a intersects the side connecting the vertices P and P of polygon 5, the boundary code C,= (0,0,0,0) of the vertex P located at both ends of this side and the vertex P9 The boundary code C, = (0, 0, 1, 0) of the intersection point a is calculated by performing an AND operation for each corresponding bit.
Find = (0, 0, 0, 0).

同様にして、交点すについては頂点P+ とP2の境界
コードCP、交点Cについては頂点P4とP5の境界コ
ードCI、、交点dについては頂点P。
Similarly, the boundary code CP between vertices P+ and P2 is used for the intersection point , the boundary code CI between the vertices P4 and P5 is used for the intersection point C, and the boundary code CI is used for the intersection point d.

とPllの境界コードC2を用い、それぞれの交点す、
c、dの境界コードC6を求める。
Using the boundary code C2 of and Pll, find the intersection point of each
Find the boundary code C6 of c and d.

このようにした得られた各交点a % dの境界コード
Ccは次のようになる。
The boundary code Cc of each intersection point a%d thus obtained is as follows.

交点aの境界コードCc= (0,0,0,0)交点す
の境界コードCc = (0,O,O,O)交点Cの境
界コードCc = (0,1,O,O)交点dの境界コ
ードC,= (0,1,0,0)次いで、面塗り処理部
25は上記交点a −y dの境界コードCcを基にス
キャンライン!上で隣り合う交点aとb、交点Cとdの
間でその境界コードC6の対応するビットごとに論理積
演算を行い、下記のような交点間の境界コードC8を求
める。
Boundary code of intersection a Cc = (0,0,0,0) Boundary code of intersection Cc = (0,O,O,O) Boundary code of intersection C Cc = (0,1,O,O) Intersection d Boundary code C, = (0,1,0,0) Next, the surface painting processing unit 25 scans the scan line! based on the boundary code Cc of the intersection a-yd. An AND operation is performed for each corresponding bit of the boundary code C6 between the adjacent intersections a and b, and the intersections C and d, to obtain a boundary code C8 between the intersections as shown below.

交点(a−b)間の境界:2−)’ Cs =(0,0
,0,0)交点(c−d)間の境界コードC,=(0,
1,0,0)そして、面塗り処理部25はこの得られた
各境界コードC3のそれぞれについてそのコード中の各
ビットの符号状態を調べ、境界コードCs中のすべての
ビットが“0゛となっている交点(a −b)間につい
ては面塗りのためのベクトル4を発生し、また境界コー
ドCsのビット列中に“1”が含まれている交点(c−
d)間については面塗りのためのベクトルの発生を抑制
する。
Boundary between intersection (a-b): 2-)' Cs = (0,0
,0,0) Boundary code C,=(0,0) between the intersection (c-d)
1, 0, 0) Then, the filling processing unit 25 examines the sign state of each bit in each of the obtained boundary codes C3, and determines that all bits in the boundary code Cs are “0”. For the intersections (a-b) where
d) Suppress the generation of vectors for filling the space between spaces.

面塗り処理部25は上述の処理を画面上のすべてのスキ
ャンラインについて実行し、すべての交点間についての
面塗りためのベクトル4を求め、得られたベクトル列を
DDA26に送る。
The surface painting processing unit 25 executes the above-mentioned processing for all scan lines on the screen, obtains vectors 4 for surface painting between all intersection points, and sends the obtained vector sequence to the DDA 26.

DDA26は面塗り処理部25から送られてきた上記ベ
クトル列をドツトパターンに展開し、得られたドツトパ
ターンデータをフレームバッファ27に格納し、CRT
デイスプレィ28はこのドツトパターンデータを用いて
ラスクスキャンにより多角形5,6.7を面塗り表示す
る。
The DDA 26 develops the vector sequence sent from the surface painting processing unit 25 into a dot pattern, stores the obtained dot pattern data in the frame buffer 27, and outputs the data to the CRT.
The display 28 uses this dot pattern data to display the polygons 5, 6, and 7 by rask scanning.

これによってCRTデイスプレィ28の画面には3つの
多角形5,6.7のみが第3図(d)に示すように描図
され、従来のようにtd(Uエツジ8(第5図(C))
が描画されることがなくなる。
As a result, only the three polygons 5, 6, and 7 are drawn on the screen of the CRT display 28 as shown in FIG. )
will no longer be drawn.

なお、上記多角形の外周線を内部とは異なる別の色で縁
取り表示したい場合には、多角形5,6゜7の各辺の両
端に位置する頂点の境界コード09間でそのピントごと
に論理積演算を行い、得られたコード中のすべてのビッ
トが“0“となる辺についてのみ外周線を描図すればよ
い。これにより頂点P1〜P2、P3〜Pa、Ps〜P
6、P6〜P?、P9〜P3間を結ぶ外周線が縁取り表
示される。
In addition, if you want to display the outer periphery of the polygon as a border in a different color from the inside, set the boundary code 09 of the vertices located at both ends of each side of the polygon 5, 6゜7 for each focus. It is sufficient to perform a logical product operation and draw an outer peripheral line only for the side where all bits in the obtained code are "0". As a result, vertices P1-P2, P3-Pa, Ps-P
6.P6~P? , P9 to P3 are displayed with an outline.

上記実施例は2次元図形の場合を例に採って説明したが
、本発明は3次元図形にも拡張可能であって、3次元図
形の描画の場合には上述したクリッピングのためのクリ
ップ枠は線分ではなく面により形成される。したがって
、本発明における「境界線」の用語の概念中には境界線
と境界面の両者を当然に包含するものである。
Although the above embodiment has been explained using a two-dimensional figure as an example, the present invention can be extended to a three-dimensional figure, and in the case of drawing a three-dimensional figure, the clip frame for clipping described above is It is formed by surfaces rather than line segments. Therefore, the concept of the term "boundary line" in the present invention naturally includes both a boundary line and a boundary surface.

さらに、上記実施例はクリップ枠2として最も−i的な
四角形枠を用いた場合を例に採って説明したが、四角形
枠に限らず任意の多角形枠を採用できることは当然であ
る。
Furthermore, although the above embodiment has been described with reference to the case where the most -i rectangular frame is used as the clip frame 2, it goes without saying that the clip frame 2 is not limited to the rectangular frame and any polygonal frame can be used.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、クリッピング処理によって複数の多角
形を生成する際に生じる擬似エツジの描画を面塗り処理
時に抑制することができ、不要な線のない多角形図形を
描画できるという格別の効果を達成することができる。
According to the present invention, it is possible to suppress the drawing of pseudo edges that occur when a plurality of polygons are generated by clipping processing, and it is possible to suppress the drawing of pseudo edges during filling processing, and it is possible to obtain the special effect of being able to draw polygonal figures without unnecessary lines. can be achieved.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の処理の原理を示すフローチャート、 第2図は本発明の実施例を示す図、 第3図は本発明による描画例を示す図、第4図は従来方
式の説明図、 ′第5図は従来方式の問題点の説明図である。 1・・・被処理多角形、2・・・クリップ枠、5〜6・
・・多角形、X l” X 4・・・クリップ枠の境界
線、Cp・・・多角形の頂点の境界コード、Cc・・・
スキャンラインと多角形の辺の交点の境界コード、C3
・・・交点間の境界コード、!・・・スキャンラインで
ある。
FIG. 1 is a flowchart showing the principle of processing of the present invention, FIG. 2 is a diagram showing an embodiment of the present invention, FIG. 3 is a diagram showing an example of drawing according to the present invention, FIG. 4 is an explanatory diagram of the conventional method, 'FIG. 5 is an explanatory diagram of the problems of the conventional method. 1...Polygon to be processed, 2...Clip frame, 5-6.
...Polygon, X l"
Boundary code of intersection of scan line and polygon side, C3
...Boundary code between intersection points,! ...This is a scan line.

Claims (1)

【特許請求の範囲】[Claims] 被処理多角形の図形データをクリップ枠でクリッピング
することにより複数の多角形を生成し、この複数の多角
形の内部を面塗り処理によって面塗りすることにより描
画するようにした多角形の描画方式において、上記クリ
ッピングにより生成された複数の多角形の各頂点のそれ
ぞれについて、その頂点と上記クリップ枠の各境界線と
の交差の有無を、クリップ枠の境界線の総数に等しいビ
ット数を有しかつ各ビットをクリップ枠の各境界線に1
対1に対応させたビット列からなる境界コード(C_p
)により記述し、上記複数の多角形の各辺とスキャンラ
インとの各交点について、その交点の交わっている辺の
両端の頂点の上記境界コード(C_p)の間でその対応
するビットごとに論理積演算を行うことにより各交点の
境界コード(C_c)を求め、スキャンライン上で隣り
合う交点同士の間で上記境界コード(C_c)の対応す
るビットごとに論理積演算を行うことにより各交点間の
境界コード(C_s)を求め、この得られた境界コード
(C_s)の符号状態によってその交点間を塗り潰すた
めのベクトルの生成を制御するようにしたことを特徴と
する多角形の描画方式
A polygon drawing method in which multiple polygons are generated by clipping the graphic data of the polygon to be processed with a clip frame, and the interior of the multiple polygons is drawn by filling the inside of the multiple polygons with fill processing. , for each of the vertices of the plurality of polygons generated by the clipping, the presence or absence of intersection between the vertex and each border line of the clip frame is determined using a number of bits equal to the total number of borders of the clip frame. and set each bit to 1 on each border of the clipping frame.
Boundary code (C_p
), and for each intersection between each side of the plurality of polygons and the scan line, logic is written for each corresponding bit between the boundary code (C_p) of the vertices at both ends of the side where the intersection intersects. The boundary code (C_c) of each intersection is obtained by performing a product operation, and the boundary code (C_c) between each intersection is calculated by performing an AND operation for each corresponding bit of the boundary code (C_c) between adjacent intersections on the scan line. A polygon drawing method characterized in that the boundary code (C_s) of the boundary code (C_s) obtained is determined, and the generation of a vector for filling in between the intersection points is controlled based on the code state of the obtained boundary code (C_s).
JP31214087A 1987-12-11 1987-12-11 Polygon drawing system Pending JPH01154294A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31214087A JPH01154294A (en) 1987-12-11 1987-12-11 Polygon drawing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31214087A JPH01154294A (en) 1987-12-11 1987-12-11 Polygon drawing system

Publications (1)

Publication Number Publication Date
JPH01154294A true JPH01154294A (en) 1989-06-16

Family

ID=18025733

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31214087A Pending JPH01154294A (en) 1987-12-11 1987-12-11 Polygon drawing system

Country Status (1)

Country Link
JP (1) JPH01154294A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5414448A (en) * 1991-09-03 1995-05-09 Hitachi, Ltd. Character/pattern generator and information processing system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5414448A (en) * 1991-09-03 1995-05-09 Hitachi, Ltd. Character/pattern generator and information processing system

Similar Documents

Publication Publication Date Title
EP0356103B1 (en) Scan-conversion process and processor
US4975976A (en) Image transformation method and device
JP2612260B2 (en) Texture mapping equipment
US6791569B1 (en) Antialiasing method using barycentric coordinates applied to lines
US6774897B2 (en) Apparatus and method for drawing three dimensional graphics by converting two dimensional polygon data to three dimensional polygon data
EP0644509A2 (en) Method and apparatus for filling polygons
EP0425187A2 (en) Drawing 'polygon with edge'-type primitives in a computer graphics display system
JPH01154294A (en) Polygon drawing system
JPH1125286A (en) Shadowing method
JPH0350686A (en) Graphic processing system
JP2903514B2 (en) High-speed drawing method
JP2611599B2 (en) Computer graphics data processing method and apparatus
JP3724340B2 (en) Image generating apparatus and method
EP0288629A1 (en) Gouraud shading on graphics display apparatus
JPH0822548A (en) Method and device for graphic processing
JPH02132572A (en) Picture display device
JPS63115280A (en) Display system
JP3098092B2 (en) Simulated view generator
JPS6326773A (en) Display processing method for graphic information
JP3718888B2 (en) Three-dimensional polygon drawing method and apparatus
JP2583379B2 (en) Pseudo three-dimensional image synthesizing apparatus and image synthesizing method
JPH09319893A (en) Method and device for image display
JP2780496B2 (en) Clipping method for drawing equipment
JP2001209813A (en) Method and device for generating two-dimensional pattern
JPH06231274A (en) Method and device for three-dimensional simulation