JPH02239381A - Graphic processing system - Google Patents

Graphic processing system

Info

Publication number
JPH02239381A
JPH02239381A JP5973489A JP5973489A JPH02239381A JP H02239381 A JPH02239381 A JP H02239381A JP 5973489 A JP5973489 A JP 5973489A JP 5973489 A JP5973489 A JP 5973489A JP H02239381 A JPH02239381 A JP H02239381A
Authority
JP
Japan
Prior art keywords
polygon
axis
changes
convex polygon
convex
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
JP5973489A
Other languages
Japanese (ja)
Inventor
Giichi Akita
秋田 義一
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.)
NEC Solution Innovators Ltd
Original Assignee
NEC Solution Innovators 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 NEC Solution Innovators Ltd filed Critical NEC Solution Innovators Ltd
Priority to JP5973489A priority Critical patent/JPH02239381A/en
Publication of JPH02239381A publication Critical patent/JPH02239381A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

PURPOSE:To shorten a painting-out time by moving along the sides of a polygon, projecting the respective sides on X and Y axes, and deciding a convex polygon based on the number of times of changes in the moving direction on the axis. CONSTITUTION:A process move along a polygon 1 in the sequence of apexes P1, P2, P3,... PN, and P1, and the respective sides are projected on the X and Y axes. Next the number of times of changes in the moving direction of the sides projected on the X and Y axes is checked, when the number of times of the changes is, for example, <=2 for the both X axis and Y axis, the graphic is decided as the convex polygon in the painting-out processing. Thus by checking only the number of times of the changes in the side direction and deciding the convex polygon without executing a multiplying processing, the painting-out processing time can be shortened.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、コンピュータによる図形処理方式に関し、特
に所定の多角形から塗シつぶし処理における凸多角形を
判定する図形処理方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a graphic processing method using a computer, and more particularly to a graphic processing method for determining a convex polygon for fill-in processing from a predetermined polygon.

〔従来の技術〕[Conventional technology]

従来、図形の塗りつぶし処理において、塗りつぶしを高
速化するために塗りつぶし処理の前処理として凸多角形
を判定するようにしていた。第4図はこの種の凸多角形
の判定の仕方を説明する九めの図であり、従来では、辺
に沿ったベクトルのP,P4との外積,・・・を順次求
めていき、そのz軸方向成分の符号が最後まで同一なら
ば凸多角形と判定し、そうでなければ凹多角形と判定す
るようにしてい友。
Conventionally, in the filling process of a figure, convex polygons have been determined as preprocessing for the filling process in order to speed up the filling process. Figure 4 is the ninth diagram explaining how to determine this type of convex polygon. Conventionally, the cross product of vectors along the sides with P, P4, etc. If the signs of the z-axis direction components are the same until the end, it is determined to be a convex polygon, otherwise it is determined to be a concave polygon.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

しかしながら、上述した従来の処理方式は,多角形の頂
点数だけ外積を求めるため、多角形の頂点数が多い場合
は、計算時間のかかる乗算演算が影響し、凸多角形の判
定速度が遅くなるという欠点がらクた。
However, the conventional processing method described above calculates the outer product for the number of vertices of a polygon, so when the number of vertices of a polygon is large, the multiplication operation takes a long calculation time, which slows down the determination speed of convex polygons. There are a lot of drawbacks.

本発明はこのような従来の欠点を改善し九もので、その
目的は凸多角形の判定速度を早くし処理時間を大幅に短
縮することの可能な図形処理方式を提供することにある
The present invention has been made to overcome these conventional drawbacks, and its purpose is to provide a graphic processing method capable of increasing the speed of determining convex polygons and significantly shortening the processing time.

〔課題を解決するための手段〕[Means to solve the problem]

本発明は、多角形の辺に沿っての移動を行ない、各辺を
X軸,Y軸上投影し、各軸上における移動方向の変化回
数に基づいて塗りつぶし処理における凸多角形を判定す
るようになっている。
The present invention moves along the sides of a polygon, projects each side onto the X-axis and Y-axis, and determines a convex polygon in filling processing based on the number of changes in the movement direction on each axis. It has become.

〔作用〕[Effect]

多角形の辺に沿って移動し、各辺t−X軸,Y軸上に投
影する。次いでX軸,Y軸上に投影した辺の移動方向の
変化回数を調べ、この変化回数がX軸.,Y軸ともに例
えば″″2”以下のときに塗りつぶし処理における凸多
角形として判定する。
Move along the sides of the polygon and project each side onto the t-X and Y axes. Next, the number of changes in the moving direction of the side projected on the X-axis and Y-axis is checked, and this number of changes is calculated as the X-axis. , and the Y axis are, for example, less than ``2'', the polygon is determined to be a convex polygon in the filling process.

〔実施例〕〔Example〕

次に、本発明の一実施例について図面1k参照して説明
する。
Next, an embodiment of the present invention will be described with reference to FIG. 1k.

第1図は本実施例の図形処理方式を説明する九めの図で
あって、多角形1を頂点P,からP2 * P3+・・
・,PMIP,の順に沿って移動し、各辺P,P2, 
P2P,,・・・,p7,をX軸,Y軸上に投影した様
子が示され本実施例では、X軸,Y軸上に上記のように
投影する際に、投影された辺の移動方向の変化回数をX
軸,Y軸のそれぞれで求めるようになクている。
FIG. 1 is the ninth diagram for explaining the graphic processing method of this embodiment, in which polygon 1 is transformed from vertex P to P2 * P3+...
・, PMIP, and each side P, P2,
The projection of P2P, ..., p7, onto the X and Y axes is shown. In this example, when projecting on the X and Y axes as described above, the movement of the projected sides The number of changes in direction is
It is calculated as required for each axis and Y axis.

き、またPM−2PN−1からpN−;pシに移動する
ときに移動方向の変化が認められ、変化回数は合計2回
に移動するときに移動方向の変化が認められる。
Also, a change in the direction of movement is observed when moving from PM-2PN-1 to pN-;p, and a change in the direction of movement is observed when the number of changes is 2 times in total.

第2図(.) , (b)はそれぞれ塗シつぶし処理に
おける凸多角形の一例を示す図であり、第2図(C)は
凹多角形の一例を示す図である。なお第2図(.)は内
角の和が180°よシも小さい幾何学上の凸多角形を示
しており、第2図(b)は内角の和が1800よりも大
きいので幾何学上は凹多角形であるが、水平線Hと多角
形の交点が12“となるので本実施例では第2図(b)
のような多角形をも含めて塗シつぶし処理における凸多
角形と定義する。
FIGS. 2(.) and 2(b) are diagrams each showing an example of a convex polygon in the filling process, and FIG. 2(C) is a diagram showing an example of a concave polygon. Note that Figure 2 (.) shows a geometrically convex polygon in which the sum of the interior angles is smaller than 180°, and Figure 2 (b) shows a geometrically convex polygon in which the sum of the interior angles is greater than 1800. Although it is a concave polygon, the intersection of the horizontal line H and the polygon is 12", so in this example, it is shown in Fig. 2 (b).
It is defined as a convex polygon in the filling process, including polygons such as .

第2図(a) l (b)からわかるように、塗シつぶ
し処理における凸多角形は,X軸,Y軸上に投影した各
辺の移動方向の変化回数が@2′以下となっている。従
って、この移動方向の変化回数に基づいて凸多角形か否
かを判定することができる。第1図の例では、X軸上で
の移動回数が”2’,Y軸上での移動回数が“1mとな
ったので、多角形1を塗シつぶし処理における凸多角形
と判定することができる。なお一般的な多角形の塗りつ
ぶし処理に比べ、凸多角形の判定を行なうと塗りつぶし
処理を高速に行なうことが可能となる。
As can be seen from Figures 2(a) and 1(b), the convex polygon in the filling process is such that the number of changes in the moving direction of each side projected onto the X and Y axes is @2' or less. There is. Therefore, it is possible to determine whether the polygon is a convex polygon based on the number of changes in the moving direction. In the example shown in Figure 1, the number of movements on the X-axis is "2" and the number of movements on the Y-axis is "1m," so polygon 1 is determined to be a convex polygon for filling processing. I can do it. Note that, compared to general polygon filling processing, if a convex polygon is determined, the filling processing can be performed faster.

第3図は本実施例における凸多角形の判定処理の流れを
示すフローチャートであり、以下ではこのフローチャー
トに基づいて塗りつぶし処理における凸多角形の判定の
仕方を説明する。第3図のステッデS1では、移動方向
の変化回数CNTを@0”に初期設定し、ステップS2
では、辺の番号を゛1″に初期設定する。ステップS3
では、X軸上での投影を行ないレジスタWKIにPi+
1−P1を記憶し、レジスタWK2にP1+2−Pi+
,を記憶し、ステップS4ではWKIとWK2とが同符
号か否かを判定する.同符号のときにはX軸上で移動方
向の変化がないのでステップS5に進み、辺の番号1を
@11だけ歩進し、ステップS6で辺の番号iがNか否
かすなわち最後の辺まで移動したか否かを判定する。最
後の辺まで移動していないときにはステップS3に再び
戻る。
FIG. 3 is a flowchart showing the flow of the convex polygon determination process in this embodiment, and below, based on this flowchart, how to determine a convex polygon in the filling process will be explained. In step S1 of FIG. 3, the number of changes in the moving direction CNT is initially set to @0'', and step S2
Now, initialize the side number to "1". Step S3
Now, perform projection on the X axis and write Pi+ in register WKI.
1-P1 is stored and P1+2-Pi+ is stored in register WK2.
, and in step S4 it is determined whether WKI and WK2 have the same sign. When the signs are the same, there is no change in the moving direction on the X axis, so proceed to step S5, step the side number 1 by @11, and in step S6 check whether the side number i is N or not, that is, move to the last side. Determine whether or not. If it has not moved to the last side, the process returns to step S3.

ステップS4においてWKIとWK2とが同符号でない
ときには、X軸上で移動方向の変化が生じたのでステッ
プS7に進んで、変化回数CNTを″″1”だけ歩進す
る。次いでステツ7#S8では変化回数CNTが12”
以上となクたか否かを調べ、゜21以上なったときには
ステップS9に進み凹多角形であると判別し、また′″
21以下のときには、ステップS5に進む。
If WKI and WK2 do not have the same sign in step S4, a change in the movement direction has occurred on the The number of changes CNT is 12”
It is checked whether the polygon is greater than or equal to ゜21, and when it is greater than ゜21, the process proceeds to step S9, where it is determined that it is a concave polygon.
When the number is 21 or less, the process advances to step S5.

このようにして、ステッ7’S6において辺の番号1が
Nよりも大きくなクたと判断されたときには、X軸上で
の移動方向の変化回数CNTが@2”以下であることを
意味するので、次にY軸上での移動方向の変化回数を調
べるためにステップ810乃至818の処理に進む。
In this way, when it is determined in step 7'S6 that side number 1 is larger than N, it means that the number of changes CNT in the moving direction on the X axis is less than @2''. Then, the process proceeds to steps 810 to 818 to check the number of changes in the moving direction on the Y axis.

ステッデ810では、変化回数CNTを101に初期設
定し、ま九辺の番号lt−″″11に初期設定する。次
いでステップ811では、Y軸上での投[−行ないレゾ
スタWKI Ic Pl+,−P,を記憶し、レジスタ
wK2ニPτ+2−P1′+,f記憶し、ステツ7’s
12において、WKIとWK2とが同符号か否かを判定
する。同符号のときには、Y軸上で移動方向の変化がな
いので、ステッ7’S13に進み、辺の番号1を@1#
だけ歩進し、ステップ814で辺の番号1がNか否かす
なわち最後の辺まで移動しかか否かを判定する。最後の
辺まで移動していないときにはステップSllIII−
再び戻る。
In step 810, the number of changes CNT is initialized to 101, and the number of nine sides lt-'''' is initialized to 11. Next, in step 811, the throw on the Y axis [- is performed, the register WKI Ic Pl+, -P, is stored, the register wK2 Pτ+2-P1'+, f is stored, and the step 7's is stored.
In step 12, it is determined whether WKI and WK2 have the same sign. When the signs are the same, there is no change in the movement direction on the Y axis, so proceed to step 7'S13 and change the side number 1 to @1#
In step 814, it is determined whether side number 1 is N or not, that is, whether or not the movement has only reached the last side. If it has not moved to the last side, step SllIII-
Back again.

ステップ812においてWKIとWK2とが同符号でな
いときには、Y軸上で移動方向の変化が生じたので、ス
テップS15に進んで、変化回数CNTを@1′だけ歩
進する。次いでステップS16では変化回数CNTが“
2″以上となったか否かを調べ、“2“以上となクたと
きにはステップ817に進み凹多角形であると判別し、
′″2′以下のときにはステッグ813に進む。
If WKI and WK2 do not have the same sign in step 812, a change in the movement direction has occurred on the Y-axis, so the process proceeds to step S15, where the number of changes CNT is incremented by @1'. Next, in step S16, the number of changes CNT is “
It is checked whether the polygon is 2" or more, and when it is 2" or more, the process proceeds to step 817 and it is determined that it is a concave polygon.
When the value is ``2'' or less, the process proceeds to step 813.

このようにしてステッfs 1 4において辺の番号i
がNよりも大きくなクたと判断されたときには、Y軸上
での移動方向の変化回数CNTも″″2”以下であるこ
とを意味するので、ステップ818で凸多角形であると
判別することができる。
In this way, in steps fs 1 4, the side number i
When it is determined that CNT is larger than N, it means that the number of changes CNT in the moving direction on the Y axis is also less than ""2", so it is determined in step 818 that it is a convex polygon. I can do it.

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

以上説明したように本発明は、乗算を行わずにX軸,Y
軸上における多角形の辺の方向の変化回数だけで、塗シ
つぶし処理における凸多角形を判定するようにしている
ので、従来に比べて大幅に処理時間を短縮できるという
効果がある。
As explained above, in the present invention, the X-axis, Y-axis
Since a convex polygon in filling processing is determined only by the number of changes in the direction of the polygon's sides on the axis, the processing time can be significantly reduced compared to the conventional method.

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

第1図は本発明の図形処理方式の一例を説明するための
図,第2図(a) , (b)は塗りつぶし処理におけ
る凸多角形の一例を示す図、第2図(c)は凹多角形の
一例を示す図、第3図は凸多角形の判定処理の流れを示
すフローチャート、第4図は従来の図形処理方式を説明
する念めの図である。 図において 1・・・多角形、P1乃至PN・・・多角形の頂点であ
る。 代理人 弁理士 山 下 穣 平
Figure 1 is a diagram for explaining an example of the graphic processing method of the present invention, Figures 2 (a) and (b) are diagrams showing an example of a convex polygon in filling processing, and Figure 2 (c) is a diagram for explaining an example of a convex polygon in filling processing. FIG. 3 is a flowchart showing a process for determining a convex polygon, and FIG. 4 is a diagram illustrating a conventional graphic processing method. In the figure, 1 is a polygon, and P1 to PN are vertices of the polygon. Agent Patent Attorney Johei Yamashita

Claims (1)

【特許請求の範囲】[Claims] 多角形の辺に沿っての移動を行ない、各辺をX軸、Y軸
上に投影し、各軸上における移動方向の変化回数に基づ
いて塗りつぶし処理における凸多角形を判定するように
なっていることを特徴とする図形処理方式。
It moves along the sides of the polygon, projects each side onto the X and Y axes, and determines the convex polygon in the filling process based on the number of changes in the movement direction on each axis. A graphic processing method characterized by
JP5973489A 1989-03-14 1989-03-14 Graphic processing system Pending JPH02239381A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5973489A JPH02239381A (en) 1989-03-14 1989-03-14 Graphic processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5973489A JPH02239381A (en) 1989-03-14 1989-03-14 Graphic processing system

Publications (1)

Publication Number Publication Date
JPH02239381A true JPH02239381A (en) 1990-09-21

Family

ID=13121736

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5973489A Pending JPH02239381A (en) 1989-03-14 1989-03-14 Graphic processing system

Country Status (1)

Country Link
JP (1) JPH02239381A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6274165A (en) * 1985-09-27 1987-04-04 Daikin Ind Ltd Discriminating system for kind of polygon

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6274165A (en) * 1985-09-27 1987-04-04 Daikin Ind Ltd Discriminating system for kind of polygon

Similar Documents

Publication Publication Date Title
US6504541B1 (en) Warping geometric objects
US6708142B1 (en) Automatic motion modeling of rigid bodies using collision detection
US6862026B2 (en) Process and device for collision detection of objects
JPS6074003A (en) Shape creating device
US6593927B2 (en) Squash and stretch three-dimensional rendering
US6798415B2 (en) Rendering collisions of three-dimensional models
US11790593B2 (en) Ray-tracing multi-sample anti-aliasing
US6573894B1 (en) Systems, methods and computer program products for converting image data to nonplanar image data
JP2022510804A (en) Intersection of a triangle with a tight ray without double precision
US10706609B1 (en) Efficient data path for ray triangle intersection
Glaeser et al. Open Geometry: OpenGL®+ Advanced Geometry
JP3526605B2 (en) Three-dimensional object deformation method and modeling system
JP3410079B2 (en) 3D skeleton data error absorption device
Benallegue et al. Fast C 1 proximity queries using support mapping of sphere-torus-patches bounding volumes
JPH02239381A (en) Graphic processing system
CN102156773A (en) Method of storing entity data including shape and physical properties
JP2870397B2 (en) How to fill the drawing
Docampo-Sánchez et al. A regularization approach for automatic quad mesh generation
US20240212285A1 (en) Processing three-dimensional model based only on visible model region
JP3823596B2 (en) Data compression method for motion simulation
KR100710620B1 (en) Apparatus and method for clipping
US20010055033A1 (en) Reduction processing method and computer readable storage medium having program stored thereon for causing computer to execute the method
Worrall et al. Dynamic discontinuities for radiosity
US20230206541A1 (en) Common circuitry for triangle intersection and instance transformation for ray tracing
Larsson An efficient ellipsoid-OBB intersection test