JPH0477882A - Method and device for plotting triangle polygone - Google Patents

Method and device for plotting triangle polygone

Info

Publication number
JPH0477882A
JPH0477882A JP2185631A JP18563190A JPH0477882A JP H0477882 A JPH0477882 A JP H0477882A JP 2185631 A JP2185631 A JP 2185631A JP 18563190 A JP18563190 A JP 18563190A JP H0477882 A JPH0477882 A JP H0477882A
Authority
JP
Japan
Prior art keywords
point
polygon
color data
value
triangular
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
JP2185631A
Other languages
Japanese (ja)
Inventor
Takanari Nishiguchi
西口 隆也
Kenji Nagashima
長島 健二
Yasuhiro Oshime
安弘 押目
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.)
Daikin Industries Ltd
Original Assignee
Daikin Industries 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 Daikin Industries Ltd filed Critical Daikin Industries Ltd
Priority to JP2185631A priority Critical patent/JPH0477882A/en
Publication of JPH0477882A publication Critical patent/JPH0477882A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To improve plotting quality by attaining plotting a grid point located in the internal part of a ridgeline obtained virtually except a case that the ridgeline obtained virtually is coincident with the grid point. CONSTITUTION:The depth value of a direction orthogonal with a scanning line and the inclination of color data or a luminance value are calculated, after that, the depth value and the color data or the luminance value are obtained with the grid point of a polygon internal part nearest to a point on a plotting starting side ridgeline obtained virtually as a plotting starting point based on the inclination of the both directions and plane coordinates are obtained with the grid point of the polygon internal part nearest to the point on a plotting ending side ridgeline as a plotting ending point. Space from the plotting starting point to the plotting ending point is interpolated and plotted with the obtained inclination, the depth value of a plotting point and the color data or the luminance value as a initial value. Here, only the grid point located in the internal part of the ridgeine obtained virtually is plotted except a case that the ridgeline obtained virtually is coincident with the grid point. Thus, plotting quality can be improved.

Description

【発明の詳細な説明】 〈産業上の利用分野〉 この発明は三角形ポリゴン描画方法およびその装置に関
し、さらに詳細にいえば、三角形ポリゴンの勾配を算出
しておき、この勾配に基づいて描画始終点間を直線補間
して奥行き値、輝度値等を得、得られた奥行き値、輝度
値等に基づいて三角形ポリゴンをぬりつぶし描画する三
角形ポリゴン描画方法およびその装置に関する。
[Detailed Description of the Invention] <Industrial Application Field> The present invention relates to a method and apparatus for drawing triangular polygons, and more specifically, the slope of the triangular polygon is calculated in advance, and the starting and ending points of drawing are determined based on this slope. The present invention relates to a method and apparatus for drawing triangular polygons in which depth values, brightness values, etc. are obtained by linear interpolation between the gaps, and triangular polygons are filled in and drawn based on the obtained depth values, brightness values, etc.

〈従来の技術〉 従来から三角形ポリゴンの平面性に着目してポラインの
スキャン・ライン方向の勾配を予め算出しておくととも
に、描画始点側の稜線について補間演算を行なうことに
より3次元座標値および色データまたは輝度値を算出し
、描画終了側の稜線について補間演算を行なうことによ
り平面座標値のみを算出しておき、始点側の補間演算値
に対してポリゴンのスキャン・ライン方向の勾配を考慮
して格子点上の点の3次元座標値および色データまたは
輝度値を算出して描画開始点を得、得られた描画開始点
、描画終了側の平面座標およびポリゴンのスキャン・ラ
イン方向の勾配に基づいて補間演算を行ない、ぬりつぶ
し描画を行なう方法が提案されている。
<Conventional technology> Conventionally, the slope of the polyline in the scan line direction is calculated in advance by focusing on the flatness of triangular polygons, and three-dimensional coordinate values and colors are calculated by performing interpolation calculations on the edge line on the drawing start point side. Calculate the data or brightness value and perform interpolation on the edge line at the end of drawing to calculate only the plane coordinate values, and then consider the slope of the polygon in the scan line direction with respect to the interpolated value on the start point side. The drawing start point is obtained by calculating the three-dimensional coordinate value and color data or brightness value of the point on the grid point, and the obtained drawing start point, the plane coordinates of the drawing end side, and the gradient in the scan line direction of the polygon are A method has been proposed in which interpolation calculations are performed based on the above-mentioned information to perform fill-in drawing.

第7図(A)に示す三角形の描画を例にとってさらに詳
細に説明する。但し、三角形の3つの頂点の平面座標が
PO(xO,yO,zO)、 PI(xl、yl。
A more detailed explanation will be given by taking as an example the drawing of a triangle shown in FIG. 7(A). However, the plane coordinates of the three vertices of the triangle are PO (xO, yO, zO) and PI (xl, yl.

zl)、  P2(x2.Y2.z2)であり、PO,
P2を結ぶ稜線が描画開始側である。
zl), P2(x2.Y2.z2), and PO,
The ridgeline connecting P2 is the drawing start side.

この場合における描画開始側稜線(以下、左稜線と称す
る)の3次元空間における傾きは、d x02/ d 
y02= (x2−xO)/(y2−yO)、d z 
02/ d y 02= (z 2−z’o)/(y 
2−y O)であり、また、右稜線の平面における傾き
は、 dxo1/d yo1= (xi−xo)/(yl−y
O)、d xl、2/d y12= (x2−xl、)
/(y2−yl、)である。
In this case, the slope of the drawing start side edge line (hereinafter referred to as the left edge line) in the three-dimensional space is d x02/ d
y02= (x2-xO)/(y2-yO), d z
02/d y 02= (z 2-z'o)/(y
2-y O), and the inclination of the right ridgeline in the plane is dxo1/d yo1= (xi-xo)/(yl-y
O), d xl, 2/d y12= (x2-xl,)
/(y2-yl,).

そして、左稜線の補間を行なう場合には、スキャン・ラ
インに沿う描画が行なわれるのであるから、X座標は1
ずつインクリメントし、X座標、2座標、色データまた
は輝度値は、それぞれの増分値を累積加算すればよい。
When interpolating the left edge, drawing is performed along the scan line, so the X coordinate is 1.
For the X coordinate, two coordinates, color data, or brightness value, the respective increment values may be cumulatively added.

但し、以下の説明においでは色データまたは輝度値に関
する部分は省略するが、2座標値と同様の処理を行なえ
ばよい。
However, in the following explanation, parts related to color data or brightness values will be omitted, but the same processing as for two coordinate values may be performed.

したがって、左稜線のm番目に補間された点PL(m)
 fxL(m)、  yL(m)、  zL(m))は
、x L(m) −x L(m−1)+ d x 02
/ d y 02y L(lN) −y L(+n−1
) + 1z L(a) −z L(al−1)+ d
 z 02/ d y 02但し、mはX座標の最小値
からのスキャン・ライン数、x L(0)−x O,y
 L(0)−y O,z L(0)−z Oである。ま
た、右稜線のm番目に補間された点PR(翔) [xR
(+n)、  yIi(m)l は、x R(m) −
x R(+n刊)→−d x [11,/ d y 0
1y1、(m)= y R(■−1)→−1但し、x 
R(0)−x O,y Iン(0)−yOである。(同
図(B)参照)尚、該当する点が頂点PL、P2の間で
ある場合には増分値が異なるだけで同様に算出される。
Therefore, the mth interpolated point PL(m) on the left edge
fxL(m), yL(m), zL(m)) is x L(m) −x L(m-1)+ d x 02
/ d y 02y L(lN) -y L(+n-1
) + 1z L(a) −z L(al-1)+ d
z 02/ d y 02 However, m is the number of scan lines from the minimum value of the X coordinate, x L (0) - x O, y
L(0)-y O,z L(0)-z O. In addition, the mth interpolated point PR (Sho) [xR
(+n), yIi(m)l is x R(m) −
x R (+n edition) → −d x [11, / d y 0
1y1, (m) = y R (■-1) → -1 However, x
R(0)-xO,yIn(0)-yO. (See (B) in the same figure) Note that if the corresponding point is between the vertices PL and P2, the calculations are made in the same way, except that the increment value is different.

次いで、得られた点P L(m) (x L(Ill)
、  y I、(m)。
Then, the obtained point P L(m) (x L(Ill)
, y I, (m).

zl、(In)l およびポリゴンのスキャン・ライン
方向の勾配を考慮してxl、(m)の小数点成分dxに
対応させてzL(m)を補正し、描画始点Ss  (x
s、ys。
Considering zl, (In)l and the slope of the polygon in the scan line direction, zL(m) is corrected in correspondence with the decimal point component dx of xl, (m), and the drawing starting point Ss (x
s, ys.

zs)を得る(同図(C)参照)。尚、図中白丸がSs
を示し、黒丸がPI、(m)を示し、三角が2値補正を
行なわない場合に描画されるZ値を示し、四角が2値補
正を行なった場合に描画されるZ値を示している。また
、右稜線については、xR(Ill)の小数点成分を切
り捨てることにより描画終点S c(x e、 y c
)を得る。
zs) (see figure (C)). In addition, the white circle in the figure is Ss
The black circle indicates PI (m), the triangle indicates the Z value drawn when no binary correction is performed, and the square indicates the Z value drawn when binary correction is performed. . In addition, for the right edge line, the drawing end point S c (x e, y c
).

その後、スキャン・ラインに沿って描画始点Ssから描
画終点Seまでピクセル単位で補間を行ない、得られた
z値を四捨五入することにより該当するピクセルの2値
を得る。尚、同様に色データまたは輝度値も得られる。
Thereafter, interpolation is performed pixel by pixel from the drawing start point Ss to the drawing end point Se along the scan line, and the obtained z value is rounded off to obtain the binary value of the corresponding pixel. Note that color data or brightness values can also be obtained in the same way.

したがって、得られた2値、色データまたは輝度値に基
づいて描画を行なうことにより、同図(D)に示すよう
に、三角形ポリゴン内部の格子点のみが描画されること
になる。
Therefore, by performing drawing based on the obtained binary values, color data, or brightness values, only the lattice points inside the triangular polygon are drawn, as shown in FIG. 3D.

〈発明が解決しようとする課題〉 上記三角形ポリゴン描画方法においては、描画始終点を
四捨五入により得ているのであるから、第8図(A)に
示すように図形が折り返されている場合に、表面側を描
画すべき三角形ポリゴンと裏面側を描画すべき三角形ポ
リゴンとの付き合せ部において同一ピクセルを2度描画
することに起因して裏面側の描画すべき三角形のエツジ
・ラインが描画され(同図(B)参照)、著しく画像品
質を低下させてしまうという不都合がある。
<Problems to be Solved by the Invention> In the above-described triangular polygon drawing method, since the drawing start and end points are obtained by rounding off, when the figure is folded back as shown in FIG. 8(A), the surface Because the same pixel is drawn twice at the intersection of the triangular polygon whose side should be drawn and the triangular polygon whose back side should be drawn, the edge line of the triangle to be drawn on the back side is drawn (same (see Figure (B)), there is a disadvantage that the image quality is significantly degraded.

また、第9図(A)に示すように著しく接近した2つの
三角形ポリゴンが存在する場合に、モデリング座標系、
グラフィック・パイプライン中等においてはポリゴンの
頂点座標が浮動小数点データであるから離れた面として
把握されているのであるが、クリップ後に整数値化され
た頂点座標に基づいて補間演算を行なう従来の描画方法
においでは同図(B)に示すように交差面として把握さ
れてしまい、著しく画像品質を低下させてしまうという
不都合もある。
In addition, when there are two triangular polygons that are extremely close to each other as shown in FIG. 9(A), the modeling coordinate system,
In graphics pipelines, etc., polygon vertex coordinates are floating point data, so they are understood as separate surfaces, but conventional drawing methods perform interpolation calculations based on vertex coordinates converted to integer values after clipping. In the case of odor, it is recognized as an intersecting plane, as shown in FIG. 5(B), and there is also the problem that the image quality is significantly degraded.

〈発明の目的〉 この発明は上記の問題点に鑑みてなされたものであり、
裏面ポリゴンのエツジ・ラインの描画頻度を著しく低下
させて画像品質を高めることかできる三角形ポリゴン描
画方法およびその装置を提供することを第1の目的とし
、座標値の丸め毎に起因する不都合を解消して画像品質
を高めることができる三角形ポリゴン描画方法およびそ
の装置を提供することを第2の目的としている。
<Object of the invention> This invention was made in view of the above problems,
The first object of the present invention is to provide a method and device for drawing triangular polygons that can significantly reduce the frequency of drawing edge lines of back polygons and improve image quality, thereby eliminating the inconvenience caused by each rounding of coordinate values. A second object of the present invention is to provide a method and apparatus for drawing triangular polygons that can improve image quality.

く課題を解決するための手段〉 上記第1の目的を達成するための、この発明の三角形ポ
リゴン描画方法は、三角形ポリゴンについてスキャンラ
イン方向の奥行き値および色デー向または輝度値の勾配
を算出するとともに、スキャンラインと直交する方向の
奥行き値および色データまたは輝度値の勾配を算出し、
三角形ポリゴンの両方向の勾配に基づいて、仮想的に得
られる描画開始側稜線上の点に最も近いポリゴン内部の
格子点を描画始点として奥行き値および色データまたは
輝度値を得るとともに、描画終了側稜線上の点に最も近
いポリゴン内部の格子点を描画終点として平面座標のみ
を得、得られた勾配、描画始点の奥行き値および色デー
タまたは輝度値を初期値として、描画始点から描画終点
までの間を補間して描画する方法である。
Means for Solving the Problems> In order to achieve the first object, the triangular polygon drawing method of the present invention calculates the depth value in the scan line direction and the gradient of the color direction or brightness value for the triangular polygon. At the same time, calculate the gradient of the depth value and color data or brightness value in the direction perpendicular to the scan line,
Based on the gradients in both directions of the triangular polygon, the depth value and color data or brightness value are obtained using the grid point inside the polygon closest to the point on the virtually obtained drawing start side ridgeline as the drawing start point, and the depth value and color data or brightness value are obtained from the drawing end side ridgeline. Obtain only the plane coordinates with the grid point inside the polygon closest to the upper point as the drawing end point, and use the obtained slope, depth value, and color data or brightness value of the drawing start point as initial values, from the drawing start point to the drawing end point. This is a method of interpolating and drawing.

上記第1の目的を達成するための、この発明の三角形ポ
リゴン描画装置は、三角形ポリゴンについてスキャンラ
イン方向の奥行き値および色データまたは輝度値の勾配
を算出する第1勾配算出手段と、スキャンラインと直交
する方向の奥行き値および色データまたは輝度値の勾配
を算出する第2勾配算出手段と、稜線上の点の平面座標
を算出する平面座標算出手段と、三角形ポリゴンの両方
の勾配を考慮して、仮想的に得られる描画開始側稜線上
の点に最も近いポリゴン内部の格子点を描画始点として
奥行き値および色データまたは輝度値を得る描画開始点
算出手段と、描画終了側稜線上の点に最も近いポリゴン
内部の格子点の平面座標を得る描画終点算出手段と、得
られた勾配、描画始点の奥行き値および色データまたは
輝度値を初期値として、描画始点から描画終点までの間
を補間して描画する描画手段とを含んでいる。
In order to achieve the above first object, the triangular polygon drawing device of the present invention includes a first gradient calculating means for calculating the gradient of the depth value and color data or brightness value in the scan line direction for the triangular polygon; A second gradient calculation means that calculates the gradient of the depth value and the color data or the brightness value in orthogonal directions, a plane coordinate calculation means that calculates the plane coordinates of the point on the edge line, and a second gradient calculation means that calculates the gradient of the depth value and color data or brightness value in orthogonal directions; , a drawing start point calculation means for obtaining a depth value and color data or a brightness value using a grid point inside a polygon closest to a point on the drawing start side ridgeline obtained virtually as a drawing start point; A drawing end point calculation means that obtains the plane coordinates of the grid point inside the nearest polygon, and interpolates between the drawing start point and the drawing end point using the obtained slope, depth value and color data or brightness value of the drawing start point as initial values. and a drawing means for drawing.

上記第2の目的を達成するための、この発明の三角形ポ
リゴン描画方法は、描画開始側稜線上の点に最も近いポ
リゴン内部の格子点を得るに先立って、小数点成分を含
む三角形ポリゴンの頂点データを受け取り、受け取った
頂点データに基づいて補間演算の基準となる頂点に対応
する三角形ポリゴン内部の格子点を頂点として奥行き値
および色データまたは輝度値を得、その後、第1の発明
と同様の処理を行なうものである。
In order to achieve the above second object, the triangular polygon drawing method of the present invention uses vertex data of the triangular polygon including decimal point components before obtaining the grid point inside the polygon that is closest to the point on the drawing start side edge line. is received, and based on the received vertex data, the depth value and color data or brightness value are obtained using the lattice points inside the triangular polygon corresponding to the vertices as the reference for interpolation calculation as vertices, and then the same processing as in the first invention is performed. This is what we do.

上記第2の目的を達成するための、この発明の三角形ポ
リゴン描画装置は、第2の発明に加えて、小数点成分を
含む三角形ポリゴンの頂点データを受け取り、受け取っ
た頂点データに基づいて補間演算の基準となる頂点に対
応する三角形ポリゴン内部の格子点を頂点として奥行き
値および色データまたは輝度値を得る基準点算出手段を
さらに含んでいるとともに、描画開始点算出手段が、算
出された基準点および三角形ポリゴンの両方向の勾配を
考慮して、仮想的に得られる描画開始側稜線上の点に最
も近いポリゴン内部の格子点を描画始点として奥行き値
および色データまたは輝度値を得るものである。
In order to achieve the above second object, the triangular polygon drawing device of the present invention, in addition to the second invention, receives vertex data of a triangular polygon including a decimal point component, and performs an interpolation operation based on the received vertex data. The drawing start point calculation means further includes reference point calculation means for obtaining a depth value and color data or brightness value using a grid point inside a triangular polygon corresponding to the reference vertex as the vertex, and the drawing start point calculation means calculates the calculated reference point and Taking into account the gradients in both directions of the triangular polygon, depth values and color data or brightness values are obtained by using the grid point inside the polygon closest to the virtually obtained point on the ridgeline on the drawing start side as the drawing starting point.

く作用〉 以上の第1の発明の三角形ポリゴン描画方法であれば、
三角形ポリゴンについてスキャンライン方向のみならず
、スキャンラインと直交する方向の奥行き値および色デ
ータまたは輝度値の勾配を算出しておいて、両方向の勾
配に基づいて、仮想的に得られる描画開始側稜線上の点
に最も近いポリゴン内部の格子点を描画始点として奥行
き値および色データまたは輝度値を得るとともに、描画
終了側稜線上の点に最も近いポリゴン内部の格子点を描
画終点として平面座標のみを得、得られた勾配、描画始
点の奥行き値および色データまたは輝度値を初期値とし
て、描画始点から描画終点までの間を補間して描画する
のであるから、仮想的に得られる稜線が格子点と一致し
ている場合を除いて、仮想的に得られる稜線の内部に位
置する格子点のみが描画される。したがって、表面が描
画される三角形ポリゴンと裏面が描画される三角形ポリ
ゴンとの稜線が一致している場合であっても、仮想的に
得られる稜線が格子点と一致する点のみについて裏面ポ
リゴンの色データまたは輝度値に基づく描画が行なわれ
る可能性があるだけであり、しかも仮想的に得られる稜
線が格子点と一致する可能性は著しく低いのであるから
、三角形ポリゴンの描画品質を著しく向上させることが
できる。
Effects〉 If the triangular polygon drawing method of the first invention is as described above,
Calculate the gradient of the depth value and color data or brightness value for the triangular polygon not only in the scan line direction but also in the direction orthogonal to the scan line, and then based on the gradients in both directions, a drawing start side ridgeline that is virtually obtained Depth values and color data or brightness values are obtained using the grid point inside the polygon closest to the upper point as the drawing start point, and only plane coordinates are obtained using the grid point inside the polygon closest to the point on the drawing end edge as the drawing end point. Since the obtained slope, the depth value of the drawing starting point, and the color data or brightness value are used as initial values, the area from the drawing starting point to the drawing ending point is interpolated and drawn, so the virtually obtained edge line is a grid point. Unless they match, only grid points located inside the virtually obtained edge are drawn. Therefore, even if the edges of the triangular polygon on which the front side is drawn and the triangular polygon on which the back side is drawn match, the color of the back side polygon will change only at the point where the virtually obtained edge line matches the grid point. Since there is only a possibility that drawing is performed based on data or brightness values, and there is a very low possibility that a virtually obtained edge line will coincide with a grid point, it is necessary to significantly improve the drawing quality of triangular polygons. I can do it.

第2の発明の三角形ポリゴン描画装置であれば、第1勾
配算出手段および第2勾配算出手段により、三角形ポリ
ゴンについてスキャンライン方向のみならずスキャンラ
インと直交する方向の奥行き値および色データまたは輝
度値の勾配を算出しておいて、平面座標算出手段により
稜線上の点の平面座標を算出し、描画開始点算出手段に
より、描画開始側稜線上の点の平面座標および三角形ポ
リゴンの両方向の勾配に基づいて、仮想的に得られる描
画開始側稜線上の点に最も近いポリゴン内部の格子点を
描画始点として奥行き値および色データまたは輝度値を
得る。そして、描画終点算出手段により、描画終了側稜
線上の点に最も近いポリゴン内部の格子点を描画終点と
して平面座標のみを得、得られた勾配、描画始点の奥行
き値および色データまたは輝度値を初期値として、描画
手段により、描画始点から描画終点までの間を補間して
描画するのであるから、仮想的に得られる稜線が格子点
と一致している場合を除いて、仮想的に得られる稜線の
内部に位置する格子点のみが描画される。したがって、
第1の発明と同様に描画品質を著しく向上させることが
できる。
In the triangular polygon drawing device of the second invention, the first gradient calculating means and the second gradient calculating means calculate the depth value and color data or brightness value of the triangular polygon not only in the scan line direction but also in the direction orthogonal to the scan line. The plane coordinate calculation means calculates the plane coordinates of a point on the edge line, and the drawing start point calculation means calculates the plane coordinates of the point on the drawing start side edge line and the slope of the triangular polygon in both directions. Based on this, the depth value and color data or brightness value are obtained by setting the grid point inside the polygon closest to the virtually obtained point on the drawing start side ridgeline as the drawing start point. Then, the drawing end point calculating means obtains only plane coordinates with the grid point inside the polygon closest to the point on the drawing end side ridgeline as the drawing end point, and calculates the obtained gradient, depth value, and color data or brightness value of the drawing starting point. As an initial value, the drawing means interpolates and draws from the drawing start point to the drawing end point, so unless the virtually obtained edge line coincides with a grid point, it can be virtually obtained. Only grid points located inside the edges are drawn. therefore,
Similar to the first invention, the drawing quality can be significantly improved.

第3の発明の三角形ポリゴン描画方法であれば、描画開
始側稜線上の点に最も近いポリゴン内部の格子点を得る
に先立って、小数点成分を含む三角形ポリゴンの頂点デ
ータを受け取り、受け取った頂点データに基づいて補間
演算の基準となる頂点に対応する三角形ポリゴン内部の
格子点を頂点として奥行き値および色データまたは輝度
値を得、その後、第1の発明と同様の処理を行なうので
あるから、補間演算の基準となる頂点として三角形ポリ
ゴンの内部に位置する点を得ることができる。
In the triangular polygon drawing method of the third invention, before obtaining the grid point inside the polygon that is closest to the point on the drawing start side edge line, vertex data of the triangular polygon including decimal point components is received, and the received vertex data Based on this, depth values and color data or brightness values are obtained using the lattice points inside the triangular polygon corresponding to the vertices that are the reference for interpolation calculations as vertices, and then the same processing as in the first invention is performed. Points located inside the triangular polygon can be obtained as vertices that serve as a reference for calculation.

したがって、隣合う三角形ポリゴンが近接している場合
であっても、補間演算の基準となる頂点を異なる点とし
て得ることができ、交差ポリゴンとして描画してしまう
という不都合を確実に解消して描画品質を著しく向上さ
せることができる。
Therefore, even if adjacent triangular polygons are close to each other, the vertices that serve as the reference for interpolation calculations can be obtained as different points, reliably eliminating the inconvenience of drawing as intersecting polygons and improving the drawing quality. can be significantly improved.

第4の発明の三角形ポリゴン描画装置であれば、第2の
発明に加えて、基準点算出手段により、小数点成分を含
む三角形ポリゴンの頂点データを受け取るとともに、受
け取った頂点データに基づいて補間演算の基準となる頂
点に対応する三角形ポリゴン内部の格子点を頂点として
奥行き値および色データまたは輝度値を得、描画開始点
算出手段において、算出された基準点および三角形ポリ
ゴンの両方向の勾配を考慮して、仮想的に得られる描画
開始側稜線上の点に最も近いポリゴン内部の格子点を描
画始点として奥行き値および色データまたは輝度値を得
るのであるから、補間演算の基準となる頂点として三角
形ポリゴンの内部に位置する点を得ることができる。し
たがって、隣合う三角形ポリゴンが近接している場合で
あっても、補間演算の基準となる頂点を異なる点として
得ることができ、交差ポリゴンとして描画してしまうと
いう不都合を確実に解消1.て描画品質を著しく向上さ
せることができる。
In the triangular polygon drawing device of the fourth invention, in addition to the second invention, the reference point calculation means receives vertex data of the triangular polygon including a decimal point component, and performs an interpolation operation based on the received vertex data. Depth values and color data or brightness values are obtained using the lattice points inside the triangular polygon corresponding to the reference vertices as vertices, and the drawing start point calculation means takes into account the gradients in both directions of the calculated reference point and the triangular polygon. Since the depth value, color data, or brightness value is obtained by using the grid point inside the polygon closest to the virtually obtained point on the drawing start side edge line as the drawing start point, the triangular polygon's vertices are used as the reference vertices for interpolation calculations. You can get points located inside. Therefore, even if adjacent triangular polygons are close to each other, the vertices that serve as the reference for interpolation calculations can be obtained as different points, reliably eliminating the inconvenience of drawing as intersecting polygons.1. The drawing quality can be significantly improved.

〈実施例〉 以下、実施例を示す添付図面によって詳細に説明する。<Example> Hereinafter, embodiments will be described in detail with reference to the accompanying drawings showing examples.

第1図はこの発明の三角形ポリゴン描画方法の一実施例
を示すフローチャートであり、ステップ■において頂点
座標値が供給されるまで待ってから、ステップ■におい
て三角形ポリゴンの角稜線の傾きd x / d Yを
算出し、ステップ■において三角形ポリゴンのスキャン
ライン方向(以下、X方向と称する)およびスキャンラ
インと直交する方向(以下、X方向と称する)の勾配d
 z / d X %d z / d Yを算出し、ス
テップ■において描画開始側稜線上の点(以下、スパン
始点と称する)を算出するための増分値nzSnz+を
算出し、ステップ■において稜線の補間を行なって描画
方向(以下、スパンと称する)の始終点を算出し、ステ
ップ■において始終点間の全ての格子点の2座標値を算
出して描画を行ない、ステップ■において、該当する三
角形ポリゴンの描画が終了したか否かを判別し、終了し
ていないと判別された場合には再びステップ■の処理を
行なうが、終了したと判別された場合には一連の処理を
終了する。尚、色データまたは輝度値についても、2値
の補間と同様であるからこの実施例においては省略しで
ある。
FIG. 1 is a flowchart showing an embodiment of the triangular polygon drawing method of the present invention, in which step (2) waits until vertex coordinate values are supplied, and then step (2) calculates the inclination d x / d of the corner edge of the triangular polygon. Y is calculated, and in step (2), the gradient d of the triangular polygon in the scan line direction (hereinafter referred to as the X direction) and in the direction orthogonal to the scan line (hereinafter referred to as the X direction) is calculated.
z / d to calculate the start and end points in the drawing direction (hereinafter referred to as span), and in step (2) calculate the two coordinate values of all grid points between the start and end points and perform drawing, and in step (2), calculate the corresponding triangular polygon. It is determined whether or not the drawing has been completed, and if it is determined that the drawing has not been completed, the process of step (2) is performed again, but if it is determined that the drawing has been completed, the series of processes is terminated. Note that color data or brightness values are also omitted in this embodiment since they are the same as binary interpolation.

例えば、第2図(A)に示すように、頂点座標がPO(
xO,yO,zO)、 PI  (xl、yl、、zl
)、 P2  (x2.y2.z2)の三角形ポリゴン
が与えられ、y座標値がyo <yt <y2であり、
頂点P1が頂点POP2を結ぶ稜線よりも右側に位置す
る場合を例にとってさらに詳細に説明する。
For example, as shown in FIG. 2(A), the vertex coordinates are PO(
xO, yO, zO), PI (xl, yl,, zl
), P2 (x2.y2.z2) is given as a triangular polygon, and the y coordinate value is yo < yt < y2,
A more detailed explanation will be given by taking as an example a case where the vertex P1 is located on the right side of the ridge line connecting the vertex POP2.

この場合には、ステップ■において各頂点を結ぶ稜線の
傾きが d xlO/ d ylO= (xl −xO)/ (
yl−yO)、dx20/dy20− (x、2−xO
)/ (y2−yO)、d x21/d y2+ −(
x2−xl、)/ (y2−yl、)として算出され(
第2図(B)参照)、ステップ■において三角形ポリゴ
ンのX方向およびX方向の勾配が d z/d x −((yl−yO)(z2−zO) 
−(y2−yO)(zl−zO)] / ((yl−y
O)(x2−xO)(Y 2−y O)(x 1−x 
O)l、d z/d y= ((x2−xo)(zl−
zO) −(xl−xOHz2−zo)l / ((y
l−yO)(x2−xO)(V 2−y O)(x l
−x O)]として算出される。即ち、三角形の内部に
おいてX方向に1ピクセル変化すれば2座標値はdz/
dxだけ変化し、X方向に1ビクセル変化すれば2座標
値はd z / d yだけ変化することが分る。
In this case, the slope of the edge line connecting each vertex in step ■ is d xlO/d ylO= (xl - xO)/ (
yl-yO), dx20/dy20- (x, 2-xO
)/(y2-yO), d x21/d y2+ -(
x2-xl, )/(y2-yl,) is calculated as (
(See Figure 2 (B)), and in step 2, the X direction and the gradient in the X direction of the triangular polygon are d z / d x - ((yl-yO) (z2-zO)
-(y2-yO)(zl-zO)] / ((yl-y
O)(x2-xO)(Y2-y O)(x1-x
O) l, d z/d y= ((x2-xo)(zl-
zO) −(xl-xOHz2-zo)l/((y
l-yO)(x2-xO)(V2-yO)(xl
−x O)]. In other words, if there is a change of one pixel in the X direction inside the triangle, the two coordinate values will be dz/
It can be seen that if the value changes by dx and by 1 pixel in the X direction, the two coordinate values will change by dz/dy.

ステップ■においては、スパン始点を算出するだめの増
分値nz02、nz02+を nz02−a02dz/dx+dz/dyn z02+
 −(a02±1. ) d z / d x 十d、
 z / d y(但し、a02はdx02/dy02
を越えない最大の整数、士は、a02が正の場合に十が
、負の場合にかそれぞれ選択される) の演算を行なうことにより算出する。そして、ステップ
■においては、スパンがX方向に1だけ増加した場合に
スパン始点のX座標値に小数点以下からの桁上げがある
かないかに基づいて増分値nz02+またはnz02を
選択して稜線補間を行なう(第2図<C>参照)。した
がって、稜線補間により得られた2座標値は三角形ポリ
ゴンの内部の値となる。
In step ■, the increment values nz02 and nz02+ for calculating the span start point are set as nz02-a02dz/dx+dz/dyn z02+
-(a02±1.) d z / d x 10 d,
z / dy (however, a02 is dx02/dy02
The largest integer not exceeding a02 is calculated by performing the following calculation: ten is selected when a02 is positive, and ten is selected when a02 is negative. Then, in step (2), when the span increases by 1 in the X direction, the increment value nz02+ or nz02 is selected based on whether or not there is a carry from the decimal point to the X coordinate value of the span start point, and ridgeline interpolation is performed. (See Figure 2 <C>). Therefore, the two coordinate values obtained by edge interpolation become values inside the triangular polygon.

その後は、ステップ■において算出されたスパン始終点
間の全ての格子点の値を補間演算により算出して描画を
行なう。
Thereafter, the values of all the grid points between the start and end points of the span calculated in step (2) are calculated by interpolation and drawn.

この結果、隣合う三角形ポリゴンの描画を行な1 つ う場合に、たまたま稜線が格子点と一致した場合にのみ
該当する格子点が2度描画されるだけであり、他の場合
には格子点が2度描画されることはないのである。そし
て、たまたま稜線と格子点とが一致する可能性は、スパ
ン始終点の2座標値を四捨五入した場合に隣接する三角
形ポリゴンの境界において一致する格子点の発生頻度と
比較して著しく低いのであるから、同一格子点を2度描
画することに伴なう画像品質の低下を大rlJに抑制で
きる。
As a result, when drawing adjacent triangular polygons, the corresponding grid point is drawn twice only if the edge line happens to coincide with the grid point, and in other cases the grid point is It is never drawn twice. Furthermore, the possibility that a ridge line and a grid point coincide by chance is significantly lower than the frequency of occurrence of matching grid points at the boundaries of adjacent triangular polygons when the two coordinate values of the span start and end points are rounded off. , the deterioration in image quality caused by drawing the same grid point twice can be suppressed to a large extent rlJ.

〈実施例2〉 第3図はこの発明の三角形ポリゴン描画装置の一実施例
を示すブロック図であり、図示しない上位プロセッサか
ら供給される頂点座標を保持する頂点座標レジスタ(1
)と、頂点座標に基づいて稜線の傾きを算出するエツジ
・スロープ算出部(2)と、頂点座標に基づいて三角形
ポリゴンのX方向およびX方向の勾配を算出するポリゴ
ン・スロープ算出部(3)と、稜線の傾きおよび三角形
ポリゴンの勾配に基づいてスパン始点を算出するための
増分値を算出するスパン始点増分算出部(4)と、これ
ら算出された値に基づいて稜線の補間演算を行なう稜線
補間部(5)と、稜線補間結果に基づいてスパン方向の
補間演算を行なうスパン補間部(7)とを有している。
<Embodiment 2> FIG. 3 is a block diagram showing an embodiment of the triangular polygon drawing device of the present invention, in which a vertex coordinate register (1
), an edge/slope calculation unit (2) that calculates the slope of the edge line based on the vertex coordinates, and a polygon slope calculation unit (3) that calculates the X direction and the slope in the X direction of the triangular polygon based on the vertex coordinates. a span start point increment calculation unit (4) that calculates an increment value for calculating the span start point based on the slope of the ridgeline and the slope of the triangular polygon; It has an interpolation section (5) and a span interpolation section (7) that performs interpolation calculations in the span direction based on the edge line interpolation results.

尚、この実施例においては、色データまたは輝度値に対
応する部分は、2座標値に対応する部分の構成と同様で
あるから、省略しである。
In this embodiment, the portions corresponding to color data or brightness values are omitted because they have the same structure as the portions corresponding to two coordinate values.

この発明の最も要旨とするスパン始点増分算出部(4)
は、 n z −a d z / d x + d z / 
d ynz4j=(a±1)dz/dx+dz/dy(
但し、aはdx/d’/を越えない最大の整数、±は、
aが正の場合に十が、負の場合に−がそれぞれ選択され
る) の演算を行なって2種類の増分値nzSnz十を算出す
るものである。
Span start point increment calculation unit (4) which is the main point of this invention
is nz −adz / dx + dz /
d ynz4j=(a±1)dz/dx+dz/dy(
However, a is the largest integer that does not exceed dx/d'/, ± is,
10 is selected when a is positive, and - is selected when a is negative) to calculate two types of increment values nzSnz1.

上記稜線補間部(5)は、頂点座標レジスタ(1)に保
持されているX座標値に対して増分値1を累積加算する
ための、セレクタ(51)、加算器(52)および累加
算レジスタ(53)からなるX座標補間部と、頂2 〕 点座標レジスタ(1)に保持されているX座標値に対し
てエツジ・スロープ算出部(2)により算出された稜線
の傾きを増分値として累積加算するための、セレクタ(
54Lエツジ・スロープ・レジスタ(55〉、加算器(
56)および累加算レジスタ(57)からなるX座標補
間部と、この発明の最も要旨とする2座標補間部とを有
している。この2座標補間部は、スパン始点増分算出部
(4)により算出された2つの増分値nz、nz+を保
持する1対のレジスタ(58)(59)と、上記加算器
(5B)から出力されるキャリー信号に基づいて制御さ
れることにより何れかのレジスタの内容を増分値として
選択するセレクタ(60)と、座標補間のために通常用
いられるセレクタ(e+)、加算器(62)および累加
算レジスタ(63)とを有している。
The edge line interpolation unit (5) includes a selector (51), an adder (52), and a cumulative addition register for cumulatively adding an increment value of 1 to the X coordinate value held in the vertex coordinate register (1). (53) and the slope of the edge calculated by the edge slope calculation unit (2) with respect to the X coordinate value held in the point coordinate register (1) as an increment value. Selector (
54L edge slope register (55>, adder (
56) and an accumulation register (57), and a two-coordinate interpolation section which is the most essential aspect of the present invention. This two-coordinate interpolation unit includes a pair of registers (58) and (59) that hold the two increment values nz and nz+ calculated by the span start point increment calculation unit (4), and the output from the adder (5B). a selector (60) that selects the contents of one of the registers as an increment value by being controlled based on a carry signal, a selector (e+) normally used for coordinate interpolation, an adder (62), and an accumulator. It has a register (63).

上記スパン補間部(7)は、X座標補間部により得られ
たX座標値を保持するレジスタ(71)と、X座標補間
部により得られたX座標値に対して増分値1を累積加算
するための、セレクタ(72)、加算器(73)および
累加算レジスタ(74)と、2座標補間部により得られ
た2座標値に対してポリゴン・スロプ算出部(3)によ
り得られたスキャンライン方向の勾配dz/dxを累積
加算するための、セレクタ(75)、レジスタ<76)
、加算器(77)および累加算レジスタ(78)とを有
している。
The span interpolation section (7) cumulatively adds an increment value of 1 to the register (71) that holds the X coordinate value obtained by the X coordinate interpolation section and the X coordinate value obtained by the X coordinate interpolation section. The selector (72), adder (73) and cumulative addition register (74) for Selector (75), register <76) for cumulatively adding directional gradient dz/dx
, an adder (77), and an accumulation register (78).

」ニ紀の構成の三角形ポリゴン描画装置の動作は次のと
おりである。
The operation of the triangular polygon drawing device with the second configuration is as follows.

上位プロセッサから三角形の頂点座標が供給されれば、
これら頂点座標に基づいてエツジ−スロープ算出部(2
)により稜線の傾きが算出されるとともに、ポリゴン・
スロープ算出部(3)により三角形ポリゴンのX方向お
よびX方向の勾配が算出される。そして、稜線の傾きお
よび三角形ポリゴンの勾配に基づいてスパン始点増分算
出部(4)により2種類の増分値nz、nz+が算出さ
れる。
If the coordinates of the triangle vertices are supplied from the upper processor,
Based on these vertex coordinates, the edge slope calculation unit (2
) calculates the slope of the ridgeline, and also calculates the polygon
The slope calculation unit (3) calculates the X direction and the slope in the X direction of the triangular polygon. Then, two types of increment values nz and nz+ are calculated by the span start point increment calculation unit (4) based on the slope of the ridgeline and the slope of the triangular polygon.

以上のように初期設定が行なわれた後は、基準となる頂
点のX座標値を、セレクタ(51)、加算器(52)お
よび累加算レジスタ(53〉により1ずつインクリメン
トシ、同時にセレクタ(54)、エツジ・スロープ・レ
ジスタ(55)、加算器(56)および累加算レジスタ
(57)により、基準となる頂点のX座標値に稜線の傾
きを累積加算する。また、X座標値およびX座標値の累
積加算と同時に2座標値も累積加算されるのであるが、
上記加算器(56)から、小数点以下からの桁上げがあ
るか否かを示すキャリー信号により制御されるセレクタ
(60)と、上記増分値nZ%nZ+をそれぞれ保持す
る1対のレジスタ(58)(59)とを有しているので
あるから、セレクタ(61)、加算器(62)および累
加算Iノジスタ(63)により、基準となる頂点の2座
標値に対して増分値を累積加算する場合に、常時はnz
を増分値として選択し、小数点以下からの桁上げがあっ
た場合のみnz+を増分値として選択する。したがって
、稜線補間により得られる2座標値は三角形ポリゴンの
内部の値となる。
After the initial settings have been made as described above, the X coordinate value of the reference vertex is incremented by 1 by the selector (51), adder (52), and cumulative addition register (53), and at the same time the selector (54) ), the edge slope register (55), the adder (56), and the cumulative addition register (57) cumulatively add the slope of the edge to the X coordinate value of the reference vertex. At the same time as the cumulative addition of values, the two coordinate values are also cumulatively added,
A selector (60) controlled by a carry signal from the adder (56) indicating whether there is a carry from the decimal point or not, and a pair of registers (58) each holding the increment value nZ%nZ+. (59), the selector (61), the adder (62), and the cumulative addition I register (63) cumulatively add the incremental value to the two coordinate values of the reference vertex. In case, always nz
is selected as the increment value, and nz+ is selected as the increment value only when there is a carry from the decimal point. Therefore, the two coordinate values obtained by edge interpolation are values inside the triangular polygon.

以上のようにして稜線の補間が行なわれれば、スパン始
終点が得られるので、スパン補間部(7)によりスパン
始終点間の補間演算を行なえばよく、三角形ポリゴンの
内部をぬりつぶすためのx、y。
If the ridgeline is interpolated as described above, the span start and end points are obtained, so the span interpolation unit (7) only needs to perform interpolation calculations between the span start and end points. y.

2座標値が得られる。Two coordinate values are obtained.

この結果、隣合う三角形ポリゴンの描画を行なう場合に
、たまたま稜線が格子点と一致した場合にのみ該当する
格子点が2度描画されるだけであり、他の場合には格子
点が2度描画されることはないのである。そして、たま
たま稜線と格子点とが一致する可能性は、スパン始終点
の2座標値を四捨五入した場合に隣接する三角形ポリゴ
ンの境界において一致する格子点の発生頻度と比較して
著しく低いのであるから、同一格子点を2度描画するこ
とに伴なう画像品質の低下を大l]に抑制できる。
As a result, when drawing adjacent triangular polygons, only if the edge line happens to coincide with a grid point, the corresponding grid point is drawn twice; in other cases, the grid point is drawn twice. It will never happen. Furthermore, the possibility that a ridge line and a grid point coincide by chance is significantly lower than the frequency of occurrence of matching grid points at the boundaries of adjacent triangular polygons when the two coordinate values of the span start and end points are rounded off. , the deterioration in image quality caused by drawing the same grid point twice can be suppressed to a large extent.

〈実施例3〉 第4図はこの発明の三角形ポリゴン描画方法の他の実施
例を示すフローチャートであり、第1図のフローチャー
トと異なる点は、ステップ■において小数点以下の成分
を持つ頂点座標値を受け取る点、ステップ■とステップ
■との間に、描画開始頂点に最も近い三角形ポリゴン内
部の点(以下、ベース・ポインタと称する)の座標値を
算出するステップ■を介挿した点、および得られたベー
ス・ポインタに基づいてステップ■以下の処理を行なう
点のみである。
<Embodiment 3> FIG. 4 is a flowchart showing another embodiment of the triangular polygon drawing method of the present invention. The difference from the flowchart in FIG. The received point, the point where step ■ is inserted between step ■ and step ■ to calculate the coordinate value of the point inside the triangular polygon closest to the drawing start vertex (hereinafter referred to as the base pointer), and the obtained point. The only point is that the following steps are performed based on the base pointer.

上記ステップ■の処理を詳細に説明すると、ベース・ポ
インタBPOは、描画開始頂点が最小のX座標値を持つ
頂点である場合には、描画開始頂点から上側の最初のス
キャン・ライン上に位置する格子点になる。ここで、描
画開始頂点とベース・ポインタBPOとのX方向の間隔
をdyo、X方向の間隔をdxO(第5図参照)とすれ
ば、ベース・ポインタBPOのX座標値dxBPO1y
座標値dyBPo、z座標値d z BPOは、それぞ
れd x BPO−x O+ d x 01dyBPO
−yO+dyO1 dzBPo−zO+ f(dz/dx) Xdxol 
十((dz/dy)Xdyo 1 の演算を行なうことにより簡単に得ることができる。即
ち、従来方法のように上位プロセッサから整数座標系に
丸め込まれた頂点座標を受け取る場合には、丸め込み処
理の結果、頂点座標が三角形ポリゴンの内部に位置する
保証がなく、隣合う三角形ポリゴンの描画を行なう場合
に頂点座標が必ず一致していたのであるが、この実施例
においては、隣合う三角形ポリゴンのベース会ポインタ
が一致するのは、たまたま頂点が格子点と一致した場合
のみになり、他の場合にはベース・ポインタが一致する
ことはないのである。
To explain in detail the processing in step (2) above, if the drawing start vertex is the vertex with the minimum X coordinate value, the base pointer BPO is located on the first scan line above the drawing start vertex. It becomes a grid point. Here, if the distance in the X direction between the drawing start vertex and the base pointer BPO is dyo, and the distance in the X direction is dxO (see Figure 5), then the X coordinate value of the base pointer BPO dxBPO1y
The coordinate value dyBPo and the z coordinate value d z BPO are respectively d x BPO-x O+ d x 01dyBPO
-yO+dyO1 dzBPo-zO+ f(dz/dx) Xdxol
It can be easily obtained by performing the operation of 10 ((dz/dy) As a result, there is no guarantee that the vertex coordinates are located inside the triangular polygon, and when drawing adjacent triangular polygons, the vertex coordinates always match, but in this example, the base of the adjacent triangular polygon The meeting pointers will match only if the vertex happens to match the grid point, and the base pointers will not match in any other case.

以上のように三角形ポリゴンの内部に位置するベース・
ポインタが得られた後は、第1図の実施例と同様に稜線
補間およびスパン補間を行なって三角形ポリゴンの内部
に位置する格子点のみをぬりつぶすことができる。
As shown above, the base/base located inside the triangular polygon
After the pointer is obtained, edge interpolation and span interpolation are performed in the same manner as in the embodiment of FIG. 1 to fill in only the grid points located inside the triangular polygon.

この結果、著しく接近した2つ以上の三角形ポリゴンが
存在する場合であっても、これら三角形ポリゴンを非交
差面として描画でき、描画品質を高めることができる。
As a result, even if there are two or more triangular polygons that are very close to each other, these triangular polygons can be drawn as non-intersecting planes, and the drawing quality can be improved.

〈実施例4〉 第6図はこの発明の三角形ポリゴン描画装置の他の実施
例を示すブロック図であり、第3図のブロック図と異な
る点は、上位プロセッサがら小数点以下の成分を持つ頂
点座標の供給を受けて頂点座標レジスタ(1)に保持す
る点、小数点以下の成分を持つ頂点座標に基づいてベー
ス・ポインタBPOのX座標値、X座標値および2座標
値を算出するベース・ポインタ算出部(81)(82)
 (83)をさらに有している点のみである。
<Embodiment 4> FIG. 6 is a block diagram showing another embodiment of the triangular polygon drawing device of the present invention. The difference from the block diagram of FIG. Base pointer calculation that calculates the X coordinate value, Part (81) (82)
The only point is that it further has (83).

ベース・ポインタ算出部(81)は、 d xBPO=xO+d x。The base pointer calculation unit (81) d xBPO=xO+d x.

の演算を行なうことにより整数化されたX座標値を算出
するものであり、ベース・ポインタ算出部(82)は、 dyBPO−yQ 十dy。
The base pointer calculation unit (82) calculates the X coordinate value converted into an integer by performing the calculation: dyBPO-yQ 10dy.

の演算を行なうことにより整数化されたX座標値を算出
するものであり、ベース・ポインタ算出部(82)は、 clzBPO−zO+ ((dz/dx)xdxol 
+f (d z / d y ) X d y 01の
演算を行なうことによりx、X座標値における2座標値
を算出するものである。
The base pointer calculation unit (82) calculates the X coordinate value converted into an integer by performing the calculation: clzBPO−zO+ ((dz/dx)xdxol
Two coordinate values in the x and X coordinate values are calculated by performing the calculation +f (d z / d y ) X d y 01.

上記の構成の三角形ポリゴン描画装置の動作は次のとお
りである。
The operation of the triangular polygon drawing device having the above configuration is as follows.

上位プロセッサから小数点以下の成分を持つ頂点座標が
供給され、頂点座標に基づいてエツジ・スロープ算出部
(2)により稜線の傾きが算出されるとともに、ポリゴ
ン・スロープ算出部(3)により三角形ポリゴンのX方
向およびX方向の勾配が算出される。また、ベース・ポ
インタ算出部(81)により、描画開始頂点とベース・
ポインタBPOとのX方向の間隔をdyoを算出し、d
ynpo−yo+dyOの演算を行なってベース・ポイ
ンタBPOのy座標値dynpoを算出する。同様に、
ベース・ポインタ算出部(82〉により、描画開始頂点
とベース命ポインタBPOとのX方向の間隔をdxOを
算出し、d x BPO−x O+ d x Oの演算
を行なってベース・ポインタBPOのX座標値dxBP
oを算出する。そして、ベース拳ポインタ算出部(83
)により、上記間隔dxO,dyOに基づいてd zB
PO−zO+ ((d z/dx) Xdxo 1 +
f (dz/dy)XdyO) の演算を行なってベース・ポインタBPOの2座標値d
 z BPOを算出する。
Vertex coordinates with components below the decimal point are supplied from the upper processor, and based on the vertex coordinates, the edge/slope calculation section (2) calculates the slope of the edge line, and the polygon/slope calculation section (3) calculates the slope of the triangular polygon. The X direction and the gradient in the X direction are calculated. In addition, the base pointer calculation unit (81) calculates the drawing start vertex and the base pointer.
Calculate the distance in the X direction from pointer BPO to dyo,
A calculation of ynpo-yo+dyO is performed to calculate the y-coordinate value dynpo of the base pointer BPO. Similarly,
The base pointer calculation unit (82) calculates dxO as the distance in the X direction between the drawing start vertex and the base life pointer BPO, and performs the calculation d x BPO - x O + d x O to calculate the X of the base pointer BPO. Coordinate value dxBP
Calculate o. Then, the base fist pointer calculation unit (83
), based on the above intervals dxO, dyO, d zB
PO−zO+ ((d z/dx) Xdxo 1 +
f (dz/dy)XdyO) to calculate the two coordinate values d of base pointer BPO.
z Calculate BPO.

その後は、得られたベース・ポインタBPOに基づいて
第3図のブロック図と同様に稜線の補間およびスパンの
補間を行なって三角形ポリゴンの内部に位置する格子点
のみを描画できる。
Thereafter, based on the obtained base pointer BPO, edge line interpolation and span interpolation are performed in the same way as in the block diagram of FIG. 3, so that only grid points located inside the triangular polygon can be drawn.

この結果、著しく接近した2つ以上の三角形ポリゴンが
存在する場合であっても、これら三角形ポリゴンを非交
差面として描画でき、描画品質を高めることができる。
As a result, even if there are two or more triangular polygons that are very close to each other, these triangular polygons can be drawn as non-intersecting planes, and the drawing quality can be improved.

〈発明の効果〉 以上のように第1の発明は、仮想的に得られる稜線が格
子点と一致している場合を除いて、仮想的に得られる稜
線の内部に位置する格子点のみを描画でき、ひいては、
表面が描画される三角形ポリゴンと裏面が描画される三
角形ポリゴンとの稜線が一致している場合であっても、
三角形ポリゴンの描画品質を著しく向上させることがで
きるという特有の効果を奏する。
<Effects of the Invention> As described above, the first invention draws only the grid points located inside the virtually obtained ridgeline, except when the virtually obtained ridgeline coincides with the lattice point. possible, and in turn,
Even if the edges of the triangular polygon on which the front side is drawn and the triangular polygon on which the back side is drawn match,
This has the unique effect of significantly improving the drawing quality of triangular polygons.

第2の発明も、仮想的に得られる稜線が格子点と一致し
ている場合を除いて、仮想的に得られる稜線の内部に位
置する格子点のみを描画でき、ひいては、表面が描画さ
れる三角形ポリゴンと裏面が描画される三角形ポリゴン
との稜線が一致している場合であっても、三角形ポリゴ
ンの描画品質を著しく向上さぜることかできるという特
有の効果を奏する。
The second invention also allows drawing only grid points located inside the virtually obtained ridgeline, unless the ridgeline obtained virtually coincides with a lattice point, and as a result, the surface is drawn. Even when the edges of the triangular polygon and the triangular polygon whose back side is drawn match, the unique effect is that the drawing quality of the triangular polygon can be significantly improved.

第3の発明は、描画開始頂点として三角形ポリゴンの内
部に位置する格子点を選択するので、隣合う三角形ポリ
ゴンが近接している場合であっても、補間演算の基準と
なる頂点を異なる点として得ることができ、交差ポリゴ
ンとして描画してしまうという不都合を確実に解消して
三角形ポリゴンの描画品質を著しく向上させることがで
きるという特有の効果を奏する。
The third invention selects a lattice point located inside a triangular polygon as the drawing start vertex, so even if adjacent triangular polygons are close to each other, the vertices serving as the reference for interpolation calculation can be set to different points. This has the unique effect of reliably eliminating the inconvenience of drawing as intersecting polygons and significantly improving the drawing quality of triangular polygons.

第4の発明も、描画開始頂点として三角形ポリゴンの内
部に位置する格子点を選択するので、隣合う三角形ポリ
ゴンが近接している場合であっても、補間演算の基準と
なる頂点を異なる点として得ることができ、交差ポリゴ
ンとして描画してしまうという不都合を確実に解消して
三角形ポリゴンの描画品質を著しく向上させることがで
きるという特有の効果を奏する。
The fourth invention also selects a lattice point located inside a triangular polygon as the drawing start vertex, so even if adjacent triangular polygons are close to each other, the vertices serving as the reference for interpolation calculation can be set to different points. This has the unique effect of reliably eliminating the inconvenience of drawing as intersecting polygons and significantly improving the drawing quality of triangular polygons.

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

第1図はこの発明の三角形ポリゴン描画方法の一実施例
を示すフローチャート、 第2図は稜線補間動作を説明する概略図、第3図はこの
発明の三角形ポリゴン描画装置の一実施例を示すブロッ
ク図、 第4図はこの発明の三角形ポリゴン描画方法の他の実施
例を示すフローチャート、 第5図はベース・ポインタ算出動作を説明する概略図、 第6図はこの発明の三角形ポリゴン描画装置の他の実施
例を示すブロック図、 第7図は三角形ポリゴン描画方法の従来例を説明する概
略図、 第8図および第9図は、それぞれ従来の三角形ポリゴン
描画方法による不都合を説明する概略図。
FIG. 1 is a flowchart showing an embodiment of the triangular polygon drawing method of the present invention, FIG. 2 is a schematic diagram explaining the edge line interpolation operation, and FIG. 3 is a block diagram showing an embodiment of the triangular polygon drawing device of the present invention. 4 is a flowchart showing another embodiment of the triangular polygon drawing method of the present invention, FIG. 5 is a schematic diagram illustrating the base pointer calculation operation, and FIG. 6 is a flow chart showing another embodiment of the triangular polygon drawing method of the present invention. FIG. 7 is a schematic diagram illustrating a conventional example of a triangular polygon drawing method; FIGS. 8 and 9 are schematic diagrams illustrating disadvantages of the conventional triangular polygon drawing method.

Claims (1)

【特許請求の範囲】 1、三角形ポリゴンについてスキャンライン方向の奥行
き値および色データまたは輝度値の勾配を算出するとと
もに、スキャンラインと直交する方向の奥行き値および
色データまたは輝度値の勾配を算出し、三角形ポリゴン
の両方向の勾配に基づいて、仮想的に得られる描画開始
側稜線上の点に最も近いポリゴン内部の格子点を描画始
点として奥行き値および色データまたは輝度値を得ると
ともに、描画終了側稜線上の点に最も近いポリゴン内部
の格子点を描画終点として平面座標のみを得、得られた
勾配、描画始点の奥行き値および色データまたは輝度値
を初期値として、描画始点から描画終点までの間を補間
して描画することを特徴とする三角形ポリゴン描画方法
。 2、三角形ポリゴンについてスキャンライン方向の奥行
き値および色データまたは輝度値の勾配を算出する第1
勾配算出手段と、スキャンラインと直交する方向の奥行
き値および色データまたは輝度値の勾配を算出する第2
勾配算出手段(3)と、稜線上の点の平面座標を算出す
る平面座標算出手段(51)(52)(53)(54)
(55)(56)(57)と、三角形ポリゴンの両方向
の勾配を考慮して、仮想的に得られる描画開始側稜線上
の点に最も近いポリゴン内部の格子点を描画始点として
奥行き値および色データまたは輝度値を得る描画開始点
算出手段(4)(58)(59)(60)(61)(6
2)(63)と、描画終了側稜線上の点に最も近いポリ
ゴン内部の格子点の平面座標を得る描画終点算出手段(
4)(58)(59)(60)(61)(62)(63
)と、得られた勾配、描画始点の奥行き値および色デー
タまたは輝度値を初期値として、描画始点から描画終点
までの間を補間して描画する描画手段(71)(72)
(73)(74)(75)(76)(77)とを含むこ
とを特徴とする三角形ポリゴン描画装置。 3、描画開始側稜線上の点に最も近いポリゴン内部の格
子点を得るに先立って、小数点成分を含む三角形ポリゴ
ンの頂点データを受け取り、受け取った頂点データに基
づいて補間演算の基準となる頂点に対応する三角形ポリ
ゴン内部の格子点を頂点として奥行き値および色データ
または輝度値を得る上記特許請求の範囲第1項記載の三
角形ポリゴン描画方法。 4、小数点成分を含む三角形ポリゴンの頂点データを受
け取り、受け取った頂点データに基づいて補間演算の基
準となる頂点に対応する三角形ポリゴン内部の格子点を
頂点として奥行き値および色データまたは輝度値を得る
基準点算出手段(81)(82)(83)をさらに含ん
でいるとともに、描画開始点算出手段(4)(58)(
59)(60)(61)(62)(63)が、算出され
た基準点および三角形ポリゴンの両方向の勾配を考慮し
て、 仮想的に得られる描画開始側稜線上の点に最も近いポリ
ゴン内部の格子点を描画始点として奥行き値および色デ
ータまたは輝度値を得るものである上記特許請求の範囲
第2項記載の三角形ポリゴン描画装置。
[Claims] 1. Calculate the depth value and the gradient of color data or brightness value in the scan line direction for a triangular polygon, and also calculate the gradient of the depth value and color data or brightness value in the direction orthogonal to the scan line. , based on the gradients in both directions of the triangular polygon, the depth value and color data or brightness value are obtained using the grid point inside the polygon closest to the virtually obtained point on the ridgeline on the drawing start side as the drawing start point, and the depth value and color data or brightness value are obtained on the drawing end side. Obtain only plane coordinates with the grid point inside the polygon closest to the point on the edge as the drawing end point, and use the obtained gradient, depth value, and color data or brightness value of the drawing start point as initial values to calculate the distance from the drawing start point to the drawing end point. A method for drawing triangular polygons that is characterized by drawing by interpolating between them. 2. The first step of calculating the depth value in the scan line direction and the gradient of color data or brightness value for the triangular polygon.
a gradient calculating means, and a second calculating means for calculating gradients of depth values and color data or brightness values in a direction perpendicular to the scan line.
Gradient calculation means (3) and plane coordinate calculation means (51) (52) (53) (54) for calculating the plane coordinates of points on the ridgeline.
Considering (55), (56), and (57), and the gradient in both directions of the triangular polygon, the depth value and color are set as the drawing start point at the grid point inside the polygon that is closest to the point on the virtually obtained drawing start side ridgeline. Drawing start point calculation means (4) (58) (59) (60) (61) (6) for obtaining data or brightness values
2) (63) and a drawing end point calculation means (
4) (58) (59) (60) (61) (62) (63
) and a drawing means (71) (72) that interpolates and draws from the drawing start point to the drawing end point using the obtained gradient, depth value and color data or brightness value of the drawing start point as initial values.
(73), (74), (75), (76), and (77). 3. Prior to obtaining the grid point inside the polygon that is closest to the point on the drawing start side edge, receive the vertex data of the triangular polygon that includes decimal point components, and use the received vertex data to determine the vertices that will be the reference for interpolation calculations. A method for drawing a triangular polygon according to claim 1, in which depth values and color data or brightness values are obtained using grid points inside corresponding triangular polygons as vertices. 4. Receive vertex data of a triangular polygon that includes a decimal point component, and obtain depth values and color data or brightness values based on the received vertex data, with lattice points inside the triangular polygon corresponding to the vertices serving as the reference for interpolation calculations as vertices. It further includes reference point calculation means (81), (82), and (83), and drawing start point calculation means (4), (58), and
59) (60) (61) (62) (63) takes into account the calculated reference point and the gradient in both directions of the triangular polygon, and calculates the inside of the polygon that is closest to the point on the drawing start side edge line that is virtually obtained. 3. The triangular polygon drawing device according to claim 2, wherein the depth value and color data or brightness value are obtained using a lattice point as a drawing starting point.
JP2185631A 1990-07-13 1990-07-13 Method and device for plotting triangle polygone Pending JPH0477882A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2185631A JPH0477882A (en) 1990-07-13 1990-07-13 Method and device for plotting triangle polygone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2185631A JPH0477882A (en) 1990-07-13 1990-07-13 Method and device for plotting triangle polygone

Publications (1)

Publication Number Publication Date
JPH0477882A true JPH0477882A (en) 1992-03-11

Family

ID=16174158

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2185631A Pending JPH0477882A (en) 1990-07-13 1990-07-13 Method and device for plotting triangle polygone

Country Status (1)

Country Link
JP (1) JPH0477882A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09223245A (en) * 1996-02-19 1997-08-26 Nec Corp Shading plotting device
JP2007018507A (en) * 2005-07-05 2007-01-25 Samsung Sdi Co Ltd Stereoscopic image display device and 3d image-stereoscopic image converter
US8207961B2 (en) 2005-07-05 2012-06-26 Samsung Mobile Display Co., Ltd. 3D graphic processing device and stereoscopic image display device using the 3D graphic processing device
US8279221B2 (en) 2005-08-05 2012-10-02 Samsung Display Co., Ltd. 3D graphics processor and autostereoscopic display device using the same

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09223245A (en) * 1996-02-19 1997-08-26 Nec Corp Shading plotting device
JP2007018507A (en) * 2005-07-05 2007-01-25 Samsung Sdi Co Ltd Stereoscopic image display device and 3d image-stereoscopic image converter
US8154543B2 (en) 2005-07-05 2012-04-10 Samsung Mobile Display Co., Ltd. Stereoscopic image display device
US8207961B2 (en) 2005-07-05 2012-06-26 Samsung Mobile Display Co., Ltd. 3D graphic processing device and stereoscopic image display device using the 3D graphic processing device
US8279221B2 (en) 2005-08-05 2012-10-02 Samsung Display Co., Ltd. 3D graphics processor and autostereoscopic display device using the same

Similar Documents

Publication Publication Date Title
KR100261076B1 (en) Rendering method and apparatus of performing bump mapping and phong shading at the same time
US6600485B1 (en) Polygon data generation method and image display apparatus using same
EP0451875A2 (en) Image displaying system
US10593096B2 (en) Graphics processing employing cube map texturing
JPH05307610A (en) Texture mapping method and its device
JPH04220783A (en) Display apparatus and display method
JPS6383884A (en) Image processing system
JP2612260B2 (en) Texture mapping equipment
JPH11161819A (en) Image processor, its method and recording medium recording image processing program
JPH07182537A (en) Device and method for plotting graphic
JPH0477882A (en) Method and device for plotting triangle polygone
JP3035571B2 (en) Image processing device
EP0676724A2 (en) Texture mapping method and image processing apparatus
JP4060375B2 (en) Spotlight characteristic forming method and image processing apparatus using the same
JPH0721407A (en) Method for displaying picture
JPH11185052A (en) Device and method for calculating texture mapping coordinate of three-dimensional computer graphics
JPH11149566A (en) Three-dimensional cg plotting device for curved surface display
JP2000057372A (en) Image processor, image processing method and storage medium
JP4714919B2 (en) Rendering device, recording medium, and program
KR100742155B1 (en) Method and apparatus for making scan line
JP4106719B2 (en) Image processing device
JP2668863B2 (en) Cross-section drawing device
JP3312560B2 (en) Texture mapping device
JP2000030081A (en) Method for plotting rugged polygon and three- dimensional plotting device
JP2668867B2 (en) Cross-section drawing device