JPH0248780A - Straight line generator - Google Patents
Straight line generatorInfo
- Publication number
- JPH0248780A JPH0248780A JP20052088A JP20052088A JPH0248780A JP H0248780 A JPH0248780 A JP H0248780A JP 20052088 A JP20052088 A JP 20052088A JP 20052088 A JP20052088 A JP 20052088A JP H0248780 A JPH0248780 A JP H0248780A
- Authority
- JP
- Japan
- Prior art keywords
- point
- coordinate axis
- data
- coordinates
- difference
- 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
Links
Landscapes
- Image Generation (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は直線発生装置に関し、特に図形を生成・表示す
る情報処理装置等における3次元座標上の直線の発生や
直線上のカラー情報をスムーズに変化させることによっ
て3次元物体を表現することのできる直線発生装置に関
する。[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a straight line generation device, and in particular, to smooth generation of straight lines on three-dimensional coordinates and color information on straight lines in information processing devices that generate and display figures. The present invention relates to a straight line generator that can express a three-dimensional object by changing the straight line to a three-dimensional object.
コンピュータ・デイスプレィ上に3次元的な物体を表示
するための技術、いわゆる3次元グラフィックスは昨今
急速に普及してきている。Techniques for displaying three-dimensional objects on computer displays, so-called three-dimensional graphics, are rapidly becoming popular these days.
2次元平面のデイスプレィに3次元物体をそれらしく表
現するために、手前にある物体によって隠される面を表
示しないようにする隠面消去、曲面をもった物体をそれ
らしく表示するシェーディングをおこなう方式などが考
えられてきた。In order to make a 3D object look like it appears on a 2D flat display, there are hidden surface removal methods that prevent surfaces hidden by objects in the foreground from being displayed, and shading methods that make objects with curved surfaces look like they appear. has been considered.
種々の方式の内、もっともアルゴリズムが単純で高速化
に適した方法としては、隠面消去法に関してはZバッフ
ァ・アルゴリズム、シェーディング方式に関してはグー
ローの方法と呼ばれる手法がある。Among the various methods, the methods with the simplest algorithm and the most suitable for speeding up are the Z-buffer algorithm for hidden surface elimination, and the Gouraud method for shading.
Zバッファ・アルゴリズムは、通常の表示データを格納
しておくメモリの他に、それらのデータに1対1に対応
するZバッファと呼ばれるメモリを備えておき、表示し
ようのするデータの奥行きをしめすZ値を計算し、Zバ
ッファにすでに書かれたZ。値を読出してこれと比較し
、手前にあった時だけ(Z <Zo )データおよびZ
値を書き換えるという方法である。これを繰り返してい
くことによって、隠面消去が実現できる。In addition to the memory that stores normal display data, the Z-buffer algorithm has a memory called a Z-buffer that corresponds one-to-one to that data. Calculate the value Z already written to the Z buffer. Read the value and compare it with this, and only when it is in front (Z < Zo) data and Z
This method involves rewriting the value. By repeating this process, hidden surface removal can be achieved.
グーローの方法は、書込むデータのカラー情報そのもの
をスムーズに変化させることによって曲面を滑らかに見
せようとするものである。カラー値の生成は上述したZ
値の生成方法と、直線発生の面からみると原理的に同じ
であり、発生した値を奥行き情報に用いるのでなく、直
接カラー値として用いるというように利用法が異なるだ
けである。Gouraud's method attempts to make a curved surface appear smooth by smoothly changing the color information itself of the data to be written. The generation of color values is done using the Z
The method of generating values and the generation of straight lines are basically the same; the only difference is that the generated values are used directly as color values rather than as depth information.
さて、両方式はともに直線の発生に伴って利用すること
が基本となる。2次元の直線発生方法の、周知の技術と
してディジタル微分解析法(以下DDAと呼ぶ)がある
。これは、直線の点列のX、Y座標を正確にかつ乗算、
除算を行わないで求めることができるので、多くのグラ
フィックス・デイスプレィ装置に応用され広く普及して
いる技術である。Now, both formulas are basically used when a straight line is generated. Digital differential analysis (hereinafter referred to as DDA) is a well-known technique for generating two-dimensional straight lines. This accurately multiplies the X and Y coordinates of the line point sequence,
Since it can be determined without performing division, it is a widely used technique that has been applied to many graphics display devices.
次に、DDAについて簡単に説明する。Next, DDA will be briefly explained.
まず、直線の始点、終点座標からX座標軸方向の差分D
X、Y座標軸方向の差分DYを求める。First, the difference D in the X coordinate axis direction from the starting point and ending point coordinates of the straight line
Find the difference DY in the X and Y coordinate axis directions.
そして、これら差分DX、DYの絶対値の大きいほうを
基準座標軸として、その基準座標軸の始点の座標値を初
期値にして単位座標値“1”を加算(又は減算)して行
く。Then, using the larger absolute value of the differences DX and DY as a reference coordinate axis, the unit coordinate value "1" is added (or subtracted) using the coordinate value of the starting point of the reference coordinate axis as an initial value.
一方、基準座標軸にならなかった座標軸の座標値は基準
座標軸の増減に同期して、原理的にはDX/DY(又は
D Y/D X )の傾きを加えて行き、1を越えたか
否かで増減させる代わりに、D X/D Yを直接加算
又は減算しないですむように変形した式をもとに増減を
判定する。On the other hand, the coordinate values of the coordinate axes that did not become the reference coordinate axes are synchronized with the increase or decrease of the reference coordinate axes, and in principle the slope of DX/DY (or D Y/D Instead of increasing or decreasing D X/D Y, the increase or decrease is determined based on a modified formula so that there is no need to directly add or subtract D X/D Y.
3次元直線に関しては、X−Y平面上の直線はDDAで
発生するが、3次元目のZ値、カラー値は、X−Z平面
あるいはY−Z平面上の直線の傾き計算しこれを直接加
えて求めるというような手法を採っていた。なぜならば
、DDAの基本は差分の大きい座標軸を基準とすること
であるが、互いに独立なXYZ座標系上の直線の始点、
終点座標の差分の大小はさまざまであるので、直接的に
はZ値をDDAで求められなかったためである。Regarding three-dimensional straight lines, straight lines on the X-Y plane are generated by DDA, but the third-dimensional Z values and color values are calculated directly by calculating the slope of the straight line on the X-Z plane or Y-Z plane. They adopted a method of asking for additional information. This is because the basics of DDA is to use coordinate axes with large differences as a reference, but the starting points of straight lines on mutually independent XYZ coordinate systems,
This is because the difference in the end point coordinates varies in size, so the Z value cannot be directly determined by DDA.
上述した従来の直線発生装置は、X−Y平面上の直線は
DDAにより発生するが、3次元目の値はDDAにより
発生することができないために、始点、終点間の傾きを
直接加算して行く構成となっているので、傾きD Z/
D X又はD Z/D Yを除算で求める場合、これを
求めるビット数で精度が決り、順次加算されるので誤差
が増大するという欠点があった。逆に、精度を上げるた
めに小数点以下のビット数を多くすると除算に要する計
算時間が長くなり、性能が劣化するという欠点がある。The conventional straight line generator described above generates a straight line on the X-Y plane by DDA, but because the third-dimensional value cannot be generated by DDA, it directly adds the slope between the starting point and the ending point. Since the configuration is such that the slope D Z/
When calculating D X or D Z/D Y by division, the precision is determined by the number of bits used to calculate it, and since they are sequentially added, there is a drawback that errors increase. Conversely, if the number of bits below the decimal point is increased in order to improve precision, the computation time required for division will increase, resulting in a deterioration in performance.
本発明の目的は、誤差が増大するのを防止して所定の精
度が得られ、かつ計算時間を短縮することができる直線
発生装置を提供することにある。SUMMARY OF THE INVENTION An object of the present invention is to provide a straight line generator that can prevent errors from increasing, obtain a predetermined accuracy, and reduce calculation time.
本発明の直線発生装置は、始点及び終点のX。 The straight line generator of the present invention has a starting point and an ending point.
Y座標とこれらX、Y座標に対する第3の座標及び付属
データの少なくとも一方を含む第3のデータとを格納す
る入力レジスタ群と、この入力レジスタ群に格納されて
いるX、Y座標からX、X座標軸方向の前記始点、終点
間の差分を求め、これら差分の絶対値の大きい方の座標
軸を基準座標軸としてこれら差分からX−Y平面上の前
記始点。an input register group that stores third data including the Y coordinate and at least one of third coordinates and attached data for these X and Y coordinates, and X, Y coordinates stored in the input register group; The difference between the starting point and the ending point in the direction of the X coordinate axis is calculated, and the starting point on the XY plane is determined from these differences by using the coordinate axis with the larger absolute value of these differences as the reference coordinate axis.
終点間の中間の直線座標を算出するためのパラメータを
発生し格納する手段と、前記入力レジスタ群に格納され
ている第3のデータの始点、終点間の差分を求め、この
差分を前記基準座標軸方向の差分て除算した値の整数部
及び小数部を求め、これら整数部及び小数部並びに前記
基準座標軸方向の差分から前記第3のデータの始点、終
点間の中間の値を算出するためのパラメータを発生し格
納する手段と、前記X−Y平面上の始点から基準座標軸
方向に所定の単位座標値づつ順次単調増加(又は減少)
させて行くと共にこの単位座標値の単調増加(又は減少
)に同期して前記X−Y平面に対するパラメータをもと
に所定の演算を行い前記基準座標軸と対をなす座標軸方
向の各座標を求め、前記X−Y平面上の始点、終点間の
中間の各直線座標を算出する手段と、前記基準座標軸方
向の単調増加(又は減少)に同期して前記第3のデータ
に対するパラメータをもとに所定の演算を行い、前記第
3のデータの始点、終点間の各中間の値を算出する手段
とを有している。means for generating and storing parameters for calculating the intermediate linear coordinates between the end points; and means for determining the difference between the start point and the end point of the third data stored in the input register group, and converting this difference into the reference coordinate axis. A parameter for determining the integer part and decimal part of the value divided by the difference in direction, and calculating the intermediate value between the start point and the end point of the third data from these integer part and decimal part and the difference in the reference coordinate axis direction. and a means for generating and storing a unit coordinate value, which sequentially monotonically increases (or decreases) by a predetermined unit coordinate value in the direction of the reference coordinate axis from the starting point on the X-Y plane.
At the same time, in synchronization with the monotonous increase (or decrease) of this unit coordinate value, predetermined calculations are performed based on the parameters for the X-Y plane to determine each coordinate in the direction of the coordinate axis paired with the reference coordinate axis, means for calculating each intermediate linear coordinate between the starting point and the ending point on the X-Y plane; and calculating intermediate values between the starting point and the ending point of the third data.
本発明は、正確な3次元目のZ値を高速に計算するため
に、次のような考え方を導入した。The present invention introduces the following idea in order to calculate an accurate third-dimensional Z value at high speed.
まず、Z値の発生をDDAでおこなうことを基本とする
。そのために、X−Z平面又はY−Z平面の直線の傾き
を整数部と1未満の小数部に分離する。First, the Z value is basically generated using DDA. For this purpose, the slope of a straight line on the X-Z plane or the Y-Z plane is separated into an integer part and a decimal part less than 1.
たとえば、始点(0,O,O)と終点(1o。For example, the starting point (0, O, O) and the ending point (1o.
7.23>を直線で補間するとする。7.23> is interpolated by a straight line.
基準座標軸は、差分の大きいX座標軸になる。The reference coordinate axis becomes the X coordinate axis with a large difference.
X−Y平面上では、X座標軸方向に単位座標値“1“を
順次加算しながらX座標軸方向の座標値を計算していく
。On the X-Y plane, coordinate values in the X-coordinate axis direction are calculated while sequentially adding unit coordinate values "1" in the X-coordinate axis direction.
一方Z値は、X−Z平面上の直線を発生して求める。こ
の場合、傾きは、23/10であるので、整数部は2、
小数部は3/10となる。On the other hand, the Z value is determined by generating a straight line on the X-Z plane. In this case, the slope is 23/10, so the integer part is 2,
The decimal part is 3/10.
これらの値から、Z値の直線、Z=(23/10)・X
は、Z=2・X+(3/10)・Xで表現されることに
なる。すなわち、Z値を求めるにあたって、2・Xにつ
いてはXの゛+1パの増加に対して“+2″させていけ
ばよく、(3/10)・Xについては従来のDDAを適
用することができる。From these values, a straight line of Z values, Z = (23/10)・X
is expressed as Z=2・X+(3/10)・X. In other words, when calculating the Z value, for 2.X, it is sufficient to add "+2" for the increase of ゛+1 pa in X, and for (3/10).X, conventional DDA can be applied. .
この方法は、X、Y座環値の計算と全く同期してZ値を
求めることができるため、処理が単純であり、またDD
Aを利用しているので正確なZ値を算出できる上、除算
をした結果の整数部と小数部とを求めるだけに簡略化で
きるという特徴を有している。This method is simple because the Z value can be calculated in complete synchronization with the calculation of the X and Y locus values, and the DD
Since it uses A, it is possible to calculate an accurate Z value, and it also has the feature that it can be simplified by simply finding the integer part and decimal part of the result of division.
次に、本発明の実施例について図面を参照して説明する
。Next, embodiments of the present invention will be described with reference to the drawings.
第1図は本発明の一実施例を示すブロック図である。こ
の実施例は、始点(Xs 、 Ys 、 Zs )と終
点(XE 、 YE 、 ZE )を結ぶ直線を発生す
る機能を有するものでカラー・データは固定したときの
例を示すものである。FIG. 1 is a block diagram showing one embodiment of the present invention. This embodiment has a function of generating a straight line connecting a starting point (Xs, Ys, Zs) and an ending point (XE, YE, ZE), and shows an example when color data is fixed.
この第1図に示された実施例を説明する前に、まず、第
2図に示されたフローチャートをもとに処理全体のフロ
ーについて概要を説明する。Before explaining the embodiment shown in FIG. 1, an overview of the overall process flow will be first explained based on the flowchart shown in FIG.
与えられた始点、終点座標をもとにX、Y、X座標軸方
向のそれぞれの変化量すなわち差分DX、DY、DZを
もとめる。X、X座標軸方向の差分DX、DYをもとに
DDAに必要なパラメータを計算する。Based on the given start point and end point coordinates, the amounts of change in the X, Y, and X coordinate axis directions, that is, the differences DX, DY, and DZ are determined. Parameters required for DDA are calculated based on the differences DX and DY in the X and X coordinate axis directions.
一方、X座標軸方向については、X座標軸あるいはX座
標軸方向の差分の大きいほうの値でX座標軸方向の差分
を割った整数部と小数部とを求める。その小数部をもと
にZ値発生のためのDDAに必要なパラメータを計算す
る。ここまで(手順P1〜P4)がいわゆる前処理であ
る。On the other hand, regarding the X coordinate axis direction, the integer part and decimal part are obtained by dividing the difference in the X coordinate axis direction by the larger value of the difference in the X coordinate axis or the X coordinate axis direction. Parameters required for DDA for Z value generation are calculated based on the decimal part. The steps up to this point (procedures P1 to P4) are so-called pre-processing.
次に、実際の描画処理すなわち直線発生を行う。Next, actual drawing processing, that is, straight line generation is performed.
まず、X−Y平面上の直線と対応する点くX。First, point X that corresponds to a straight line on the X-Y plane.
Y)からZバッファにすでに書かれているカラー・デー
タとZ。値とを読出し、計算で求めたz値とZe値とを
比較し、Z (Zoであれば新しいカラー・データとz
値とをZバッファ等の表示メモリの点(X、Y)に書き
戻す。Z≧Zoであれば何も行わない(手順P5〜P7
)。color data already written to the Z buffer from Y) and Z. The calculated z value is compared with the Ze value, and Z (if Zo, new color data and z
The value is written back to the point (X, Y) of a display memory such as a Z buffer. If Z≧Zo, do nothing (steps P5 to P7
).
つづいて、x、y、z値の更新を行う。これは前処理で
生成したDDA用のパラメータをもとにDDAにより計
算する(手順P8)。Next, the x, y, and z values are updated. This is calculated by DDA based on the DDA parameters generated in preprocessing (procedure P8).
最後に、終点座標まで描画したかどうかをチエツクして
終点座標まで以上の動作を繰り返す(手順p9.p弓〜
P9)。Finally, check whether you have drawn to the end point coordinates and repeat the above operation until the end point coordinates (step p9.
P9).
次に、この実施例のハードウェアについて説明する。Next, the hardware of this embodiment will be explained.
第1図において、1は直線発生に必要な始点及び終点の
各データを格納する入力レジスタ群、2は入力レジスタ
群1のリード・ライト制御などを行う入力制御部、3は
処理の流れを制御するシーケンサ、4は入力データを描
画演算に適した形式に変換するパラメータ処理部、5は
描画レジスタ群、6,7は描画レジスタ群5の内容を演
算処理する演算回路、8はカラー・データと2値を処理
するデータ選択部、9は外部のZバッファ等の表示メモ
リの対するアドレスを出力するアドレス出力部、R1へ
R18はそれぞれ16ビツトのレジスタ、D1〜Dll
はデータ、S、〜sitは制御信号である。In Fig. 1, 1 is a group of input registers that stores the starting point and end point data required to generate a straight line, 2 is an input control unit that performs read/write control of input register group 1, and 3 is a control unit that controls the flow of processing. 4 is a parameter processing unit that converts input data into a format suitable for drawing operations, 5 is a drawing register group, 6 and 7 are arithmetic circuits that process the contents of the drawing register group 5, and 8 is a color data processing unit. A data selection section that processes binary values; 9 is an address output section that outputs an address for a display memory such as an external Z buffer; R1 and R18 are each 16-bit registers; D1 to Dll
is data, S, ~sit is a control signal.
まず、入力レジスタ群1の各レジスタR1〜R7に、上
位に位置付けられるホスト・システムから、始点、終点
の座標(Xs 、 Ys 、 Zs ) 。First, the coordinates (Xs, Ys, Zs) of the start point and end point are stored in each register R1 to R7 of the input register group 1 from the host system located at the upper level.
(Xi 、 Yt 、 Ze )及び付属データである
直線のカラー・データCRLを格納する。これらレジス
タR1〜R7の選択は、制御信号S1をもとに入力制御
部2によりデコードされた制御信号SKIによっておこ
なわれる。ホスト・システムは必要なデータを格納した
後、制御信号S1によってシーケンサ3の動作を開始さ
せる。(Xi, Yt, Ze) and attached data, straight line color data CRL, are stored. Selection of these registers R1 to R7 is performed by a control signal SKI decoded by the input control section 2 based on the control signal S1. After storing the necessary data, the host system starts the operation of the sequencer 3 by means of a control signal S1.
パラメータ処理部4は、演算回路6.7と共に描画レジ
スタ群5の各レジスタR8〜R14を使用してシーケン
サ3からの制御信号S4〜S7のもとに、入力レジスタ
群1に格納されている始点及び終点の座標(Xs 、
Ys 、 Zs ) 、 (Xi 。The parameter processing unit 4 uses the registers R8 to R14 of the drawing register group 5 together with the arithmetic circuit 6.7 to calculate the starting point stored in the input register group 1 based on the control signals S4 to S7 from the sequencer 3. and the coordinates of the end point (Xs,
Ys, Zs), (Xi.
YE、Zs)からx、y、z座標軸方向の始点。YE, Zs) to the starting point in the x, y, z coordinate axis direction.
終点間の各差分DX、DY、DZを求め、差分DX、D
Yの絶対値の大きい方の座標軸を基準座標軸としてこれ
ら差分DX、DY、DZから、X−Y平面上の始点、終
点間の中間の直線座標を算出するためのDDAパラメー
タを発生し、また、差分DZを基準座標軸方向の差分(
仮にDXとする)で除算したDZ/DXの値の整数部及
び小数部を求め、これら整数部、小数部及び基準座標軸
方向の差分DXからZ座標軸方向の始点、終点間の中間
の座標を算出するためのDDAパラメータを発生する。Find the differences DX, DY, and DZ between the end points, and calculate the differences DX, D
Using the coordinate axis with the larger absolute value of Y as the reference coordinate axis, from these differences DX, DY, and DZ, a DDA parameter is generated for calculating the intermediate linear coordinate between the starting point and the ending point on the X-Y plane, and The difference DZ is the difference in the direction of the reference coordinate axis (
Calculate the integer part and decimal part of the value of DZ/DX divided by (temporarily assumed to be DX), and calculate the intermediate coordinate between the start point and end point in the Z coordinate axis direction from these integer part, decimal part, and the difference DX in the reference coordinate axis direction. Generate DDA parameters for
描画レジスタ群5は、パラメータ処理部4及び演算回路
6,7により発生した各DDAパラメータをレジスタR
8〜R14にそれぞれ格納すると共に、レジスタR15
〜R18にまずはじめにX、Y。The drawing register group 5 stores each DDA parameter generated by the parameter processing unit 4 and the arithmetic circuits 6 and 7 in a register R.
8 to R14, and register R15.
~R18 First of all, X, Y.
Z及びカラー・データの初期値(始点の値)を格納して
おく。The initial values of Z and color data (starting point values) are stored.
演算回路6.7は、上述のDDAパラメータ発生後、描
画レジスタ群5の各レジスタR8〜R17を使用してシ
ーケンサ3からの制御信号S、〜S7のもとに、X−Y
平面上の始点から基準座標軸〈X座標軸)方向に、単位
M標値“1″づつを順次単調増加(又は減少)させて行
くと共にこの単調増加(又は減少)に同期してX−Y平
面に対するDDAパラメータをもとにDDA演算を行い
基準座標軸と対をなす座標軸(Y座標軸)方向の各座標
を求め、X−Y平面上の始点、終点間の中間の各直線座
標を算出しその結果を順次レジスタR,6,R,,に格
納し、基準座標軸方向の単調増加(又は減少)と同期し
て、Z座標軸方向に対するDDAパラメータをもとにD
DA演算を行いZ座標軸方向の始点、終点間の中間の各
座標を算出してその結果を順次レジスタR15に格納す
る。After the above-mentioned DDA parameters are generated, the arithmetic circuit 6.7 uses each register R8 to R17 of the drawing register group 5 to perform the X-Y
Sequentially monotonically increase (or decrease) the unit M target value "1" from the starting point on the plane in the direction of the reference coordinate axis (X coordinate axis), and in synchronization with this monotonous increase (or decrease), Perform DDA calculations based on the DDA parameters to obtain each coordinate in the direction of the coordinate axis (Y coordinate axis) that pairs with the reference coordinate axis, calculate each linear coordinate intermediate between the starting point and end point on the X-Y plane, and use the results. Sequentially stored in registers R, 6, R, , and in synchronization with the monotonous increase (or decrease) in the reference coordinate axis direction, the D is
DA calculation is performed to calculate intermediate coordinates between the starting point and the ending point in the Z coordinate axis direction, and the results are sequentially stored in the register R15.
アドレス出力部9は、基準座標軸方向の単調増加(又は
減少〉に同期して、すなわちX、Y座標が更新される都
度、レジスタR16,R17からX。The address output unit 9 outputs an X value from registers R16 and R17 in synchronization with a monotonous increase (or decrease) in the direction of the reference coordinate axis, that is, each time the X and Y coordinates are updated.
Y座標を読出し出力する。Read and output the Y coordinate.
データ選択部8は、Zバッファ等の表示メモリの、アド
レス出力部9からのX、Y座標と対応するアドレスから
読出されたZo値及びカラー・データを入力し、レジス
タR15の値ZとZo値とを比較してZ<Zoであれば
表示メモリにレジスタR,4,R18の値を書き戻し、
Z≧Zoであれば何も行なわないで次へと進む。The data selection section 8 inputs the Zo value and color data read from the address corresponding to the X and Y coordinates from the address output section 9 in a display memory such as a Z buffer, and selects the Z value and the Zo value of the register R15. If Z<Zo, the values of registers R, 4, and R18 are written back to the display memory,
If Z≧Zo, do nothing and proceed to the next step.
このようにして、XYZ座標系における始点。In this way, the starting point in the XYZ coordinate system.
終点間を結ぶ直線の発生と、Z座標軸方向及びカラー・
データの隠面消去処理が行なわれる。Generation of a straight line connecting end points, Z coordinate axis direction and color
Hidden surface erasure processing of the data is performed.
第3図は第2図に示されたフローチャートの手順P、〜
P4の詳細な流れを示すフローチャートである。FIG. 3 shows steps P, ~ of the flowchart shown in FIG.
It is a flowchart which shows the detailed flow of P4.
第3図において、DXYI〜DXY3がX−Y平面に対
するDDAパラメータであり、描画レジスタ群5のレジ
スタR8〜R1oにそれぞれ格納される。また、DZ1
〜DZ3及びSがZ座標軸方向に対するDDAパラメー
タであり、描画レジスタ群5のレジスタRI4〜R1フ
にそれぞれ格納される。In FIG. 3, DXYI to DXY3 are DDA parameters for the XY plane, and are stored in registers R8 to R1o of the drawing register group 5, respectively. Also, DZ1
~DZ3 and S are DDA parameters for the Z coordinate axis direction, and are stored in registers RI4 to R1 of the drawing register group 5, respectively.
第4図は第2図に示されたフローチャートの手順P8の
詳細な流れを示すフローチャートである。FIG. 4 is a flowchart showing the detailed flow of step P8 in the flowchart shown in FIG.
X−Y平面及びZ座標軸方向に対するDDAパラメータ
DX¥1〜DxY3.DZ1〜DZ3及びSを使用して
DDA演算が行なわれ、レジスタR15〜R17に格納
されているX、Y、Z座標が順次更新される。DDA parameters DX\1 to DxY3 for the X-Y plane and Z coordinate axis direction. A DDA operation is performed using DZ1 to DZ3 and S, and the X, Y, and Z coordinates stored in registers R15 to R17 are sequentially updated.
なお、演算回路を2系統備えたのは、性能を向上させる
ためであり、また、第4図のフローチャートの手順P
19+ R21の正負の判定によるシーケンサ3におけ
る処理の分岐は、演算回路6から出力される制御信号S
IOにもとづいて実行される。The reason why two systems of arithmetic circuits are provided is to improve performance, and also because step P of the flowchart in FIG.
19+ The branching of processing in the sequencer 3 based on whether R21 is positive or negative is determined by the control signal S output from the arithmetic circuit 6.
It is executed based on IO.
上記実施例においては、カラー・データを固定しXYZ
座標系における直線を発生する場合について述べたが、
始点(Xs 、 Ys )と終点(XE 、 Yv、
)とを結ぶ2次元の直線に対し、始点、終点それぞれに
カラー・データを定義し、始点、終点間の中間点のカラ
ー・データを直線補間により求めることもできる。これ
は、グーローの方法によるシェーディングを実現するの
に必要な機能である。In the above embodiment, the color data is fixed and the XYZ
We have described the case of generating a straight line in the coordinate system, but
Starting point (Xs, Ys) and ending point (XE, Yv,
), color data can be defined for each of the starting point and the ending point, and the color data of the intermediate point between the starting point and the ending point can be obtained by linear interpolation. This is a necessary function to implement shading using Gouraud's method.
この処理は、上記実施例のハードウェアを用いて容易に
実現できる。This process can be easily realized using the hardware of the above embodiment.
まず、第2図を参照して処理のフローを説明する。First, the flow of processing will be explained with reference to FIG.
この処理では、第2図の“Z“をカラー・データに置換
えるとともに手順P5〜P7の部分を次のように変更す
る。In this process, "Z" in FIG. 2 is replaced with color data, and steps P5 to P7 are changed as follows.
メモリ上の点(X、Y)からデータを読出したり、Z値
を比較する必要はなく、単に求めたZ値(カラー値)を
点(x、y)に書込めばよい。There is no need to read data from the point (X, Y) on the memory or compare Z values; it is sufficient to simply write the obtained Z value (color value) to the point (x, y).
従って、第1図に示されたデータ選択部8の動作が単純
になり、レジスタR15から入力したZ値をデータDI
Oとして出力すればよい。上述したデータ選択部8への
動作指示は制御信号S8によって行うことができる。Therefore, the operation of the data selection unit 8 shown in FIG. 1 is simplified, and the Z value input from the register R15 is
It should be output as O. The above-mentioned operation instruction to the data selection section 8 can be given by the control signal S8.
なお、上記実施例の表示メモリに対するアドレス発生は
、X座標値、Y座標値を結合したものであったが、X、
Y座標の計算とは独立に発生させたり、データ選択部8
において表示メモリから読出したデータと新たに書込む
カラー・データを演算した結果を書込むハードウェアを
追加したとしても本発明の主旨から逸脱するものではな
い。Note that the address generation for the display memory in the above embodiment was a combination of the X coordinate value and the Y coordinate value, but
It can be generated independently of the calculation of the Y coordinate, or it can be generated by the data selection section 8.
Even if hardware is added to write the result of calculating the data read from the display memory and the newly written color data, this does not depart from the gist of the present invention.
さらに、本発明の実施例は3次元直線発生とシェーディ
ング直線発生とを個別に実現するものを示したが、これ
らを複合させて3次元直線をシェーディングを行いなが
ら発生させることも容易に実現できる。また、1種類の
カラー・データだけでなく、複数のカラー・データ処理
を行わせることによって、いわゆるR G B (RE
D、GREEN。Further, although the embodiments of the present invention have shown the generation of three-dimensional straight lines and the generation of shading straight lines separately, it is also possible to easily generate three-dimensional straight lines while performing shading by combining them. In addition, by processing not only one type of color data but multiple color data, so-called RGB (RE
D. GREEN.
BLLE)の三原色に対応させてシューディング処理を
実現させることもできる。Shooting processing can also be realized in correspondence with the three primary colors of BLLE.
以上説明したように本発明は、始点及び終点のX、Y座
標に対する第3のデータの始点、終点間の差分を、X、
Y座標軸方向の差分の絶対値の大きい方の差分て除算し
て整数部と小数部とに分け、第3のデータの始点、終点
間の中間の値を整数部の加算(又は減算)と小数部側の
DDA演算とにより求める構成とすることにより、従来
のように第3のデータの傾きをそのまま直接加算(又は
減算)するのでなく、整数の加算(又は減算)とDDA
とにより処理されるので、誤差が増大するのを防止して
所定の精度を得ることができ、また、従来の方法では傾
きの演算精度を上げるためには演算処理のビット数を多
くする必要があったが本発明においてはその必要がない
ので、計算時間を短縮することができる効果がある。As explained above, the present invention calculates the difference between the starting point and the ending point of the third data with respect to the X, Y coordinates of the starting point and the ending point.
Divide by the larger absolute value of the difference in the direction of the Y coordinate axis, divide it into an integer part and a decimal part, and add (or subtract) the integer part and add (or subtract) the intermediate value between the start point and end point of the third data to the decimal part. By adopting a configuration in which the calculation is performed using the DDA operation on the part side, instead of directly adding (or subtracting) the slope of the third data as is in the conventional method, it is possible to calculate the slope by adding (or subtracting) an integer and using the DDA calculation.
Since the calculation is performed by However, in the present invention, this is not necessary, so there is an effect that the calculation time can be shortened.
ジスタ群、6,7・・・演算回路、8・・・データ選択
部、9・・・アドレス出力部、P1〜P24・・・手順
、R1〜R18・・・レジスタ。Register group, 6, 7... Arithmetic circuit, 8... Data selection section, 9... Address output section, P1 to P24... Procedure, R1 to R18... Register.
第1図は本発明のτ実施例を示すブロック図、ぞれ第2
図に示されたフローチャートの手順の一部を詳細な流れ
で示したフローチャートである。FIG. 1 is a block diagram showing a τ embodiment of the present invention;
3 is a flowchart showing in detail a part of the procedure of the flowchart shown in the figure.
Claims (1)
る第3の座標及び付属データの少なくとも一方を含む第
3のデータとを格納する入力レジスタ群と、この入力レ
ジスタ群に格納されているX、Y座標からX、Y座標軸
方向の前記始点、終点間の差分を求め、これら差分の絶
対値の大きい方の座標軸を基準座標軸としてこれら差分
からX−Y平面上の前記始点、終点間の中間の直線座標
を算出するためのパラメータを発生し格納する手段と、
前記入力レジスタ群に格納されている第3のデータの始
点、終点間の差分を求め、この差分を前記基準座標軸方
向の差分で除算した値の整数部及び小数部を求め、これ
ら整数部及び小数部並びに前記基準座標軸方向の差分か
ら前記第3のデータの始点、終点間の中間の値を算出す
るためのパラメータを発生し格納する手段と、前記X−
Y平面上の始点から基準座標軸方向に所定の単位座標値
づつ順次単調増加(又は減少)させて行くと共にこの単
位座標値の単調増加(又は減少)に同期して前記X−Y
平面に対するパラメータをもとに所定の演算を行い前記
基準座標軸と対をなす座標軸方向の各座標を求め、前記
X−Y平面上の始点、終点間の中間の各直線座標を算出
する手段と、前記基準座標軸方向の単調増加(又は減少
)に同期して前記第3のデータに対するパラメータをも
とに所定の演算を行い、第3のデータの始点、終点間の
各中間の値を算出する手段とを有することを特徴とする
直線発生装置。an input register group that stores the X and Y coordinates of the start point and the end point, and third data including at least one of the third coordinates and attached data for these X and Y coordinates, and the X stored in this input register group; , calculate the difference between the starting point and the ending point in the X and Y coordinate axis directions from the Y coordinate, and using the coordinate axis with the larger absolute value of these differences as the reference coordinate axis, use these differences to calculate the intermediate point between the starting point and the ending point on the X-Y plane. means for generating and storing parameters for calculating the linear coordinates of;
Find the difference between the start point and end point of the third data stored in the input register group, divide this difference by the difference in the reference coordinate axis direction, find the integer part and decimal part, and calculate the integer part and decimal part. means for generating and storing a parameter for calculating an intermediate value between the start point and the end point of the third data from the difference in the direction of the coordinate axis and the reference coordinate axis;
From the starting point on the Y plane, the unit coordinate values are sequentially monotonically increased (or decreased) in the direction of the reference coordinate axis, and in synchronization with the monotonous increase (or decrease) of the unit coordinate values, the
means for calculating each coordinate in a direction of a coordinate axis that pairs with the reference coordinate axis by performing a predetermined calculation based on parameters for the plane, and calculating each linear coordinate intermediate between the starting point and the ending point on the X-Y plane; Means for performing predetermined calculations based on parameters for the third data in synchronization with the monotonous increase (or decrease) in the direction of the reference coordinate axis, and calculating intermediate values between the start point and the end point of the third data. A straight line generator comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20052088A JPH0248780A (en) | 1988-08-10 | 1988-08-10 | Straight line generator |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP20052088A JPH0248780A (en) | 1988-08-10 | 1988-08-10 | Straight line generator |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0248780A true JPH0248780A (en) | 1990-02-19 |
Family
ID=16425677
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP20052088A Pending JPH0248780A (en) | 1988-08-10 | 1988-08-10 | Straight line generator |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0248780A (en) |
-
1988
- 1988-08-10 JP JP20052088A patent/JPH0248780A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4148560B2 (en) | Floating point division arithmetic unit | |
| JP2501580B2 (en) | Curved image visual display generator | |
| US6377265B1 (en) | Digital differential analyzer | |
| JPH09167255A (en) | Real-time rendering method and apparatus for selectively performing bump mapping and pon shading | |
| JPH0916806A (en) | Stereoscopic image processing device | |
| JPS63198174A (en) | Graphic processor | |
| WO1996028794A1 (en) | Three-dimensional graphic display device | |
| US5179647A (en) | Method and apparatus for implementing adaptive forward differencing using integer arithmetic | |
| US7015930B2 (en) | Method and apparatus for interpolating pixel parameters based on a plurality of vertex values | |
| JPH09134452A (en) | High-speed interpolation method of depth buffer value in computer graphics display system and graphics system | |
| JPH09120278A (en) | Line scan conversion apparatus and method in computer graphics system | |
| JPH11185052A (en) | Apparatus and method for calculating texture mapping coordinates of three-dimensional computer graphics | |
| JPH03144782A (en) | Three-dimensional processor | |
| US6693634B1 (en) | Reduction rate processing circuit and method with logarithmic operation and image processor employing same | |
| CA2261245C (en) | Division circuit and graphic display processing apparatus | |
| KR100848687B1 (en) | 3D graphics processing device and its operation method | |
| JP3059739B2 (en) | Information processing apparatus with curve drawing function and processing method | |
| JP3268484B2 (en) | Shading method and shading device | |
| JP4244444B2 (en) | Data processing device, division circuit, and image processing device | |
| JP3358891B2 (en) | Z-value perspective transformation processing method and image processing apparatus | |
| EP0256488B1 (en) | Method of interpolating pixel values | |
| RU2109350C1 (en) | Graphic data display | |
| JP4224887B2 (en) | Signal processing apparatus and image processing apparatus | |
| JPH01288977A (en) | Picture displaying device | |
| RU2058600C1 (en) | Specialized computing unit for computer graphics devices |