JP3312382B2 - Normal vector coordinate converter - Google Patents
Normal vector coordinate converterInfo
- Publication number
- JP3312382B2 JP3312382B2 JP30362391A JP30362391A JP3312382B2 JP 3312382 B2 JP3312382 B2 JP 3312382B2 JP 30362391 A JP30362391 A JP 30362391A JP 30362391 A JP30362391 A JP 30362391A JP 3312382 B2 JP3312382 B2 JP 3312382B2
- Authority
- JP
- Japan
- Prior art keywords
- matrix
- normal vector
- coordinate
- normal
- conversion
- 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.)
- Expired - Fee Related
Links
Landscapes
- Processing Or Creating Images (AREA)
- Complex Calculations (AREA)
- Image Generation (AREA)
Description
【0001】[0001]
【産業上の利用分野】この発明は法線ベクトル座標変換
装置に関し、さらに詳細にいえば、図形処理装置におけ
る法線ベクトルの座標変換に特に好適な装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a normal vector coordinate conversion apparatus, and more particularly, to an apparatus particularly suitable for normal vector coordinate conversion in a graphic processing apparatus.
【0002】[0002]
【従来の技術】従来から3次元図形の処理を行なう図形
処理装置においては、図形を構成するポリゴンの表裏の
識別、ポリゴンの色、輝度計算等を行なうために法線ベ
クトルが用いられている。また、この図形処理装置にお
いては、当初において図形が定義されている座標系と図
形を表示するための座標系とが異なるのであるから、上
記図形を構成する各ポリゴンのみならず各ポリゴンに付
随する法線ベクトルについても座標系間での座標変換を
行なう必要がある。この要求に応えるために、従来は4
行4列の同次座標変換マトリクスを用いた座標変換が行
なわれているが、法線については、同次座標変換マトリ
クスに基づく座標変換処理を施しただけでは不十分であ
り、座標変換後に必ず正規化処理を行なうようにしてい
る。2. Description of the Related Art Conventionally, in a graphic processing apparatus for processing a three-dimensional graphic, a normal vector is used for discriminating the front and back of a polygon constituting the graphic, calculating the color and brightness of the polygon, and the like. Further, in this graphic processing device, since the coordinate system in which the graphic is initially defined is different from the coordinate system for displaying the graphic, not only each polygon constituting the graphic but also each polygon is attached. For the normal vector, it is necessary to perform coordinate conversion between coordinate systems. Conventionally, to meet this demand,
Although coordinate transformation using the homogeneous coordinate transformation matrix of row 4 is performed, it is not sufficient to perform the coordinate transformation processing based on the homogeneous coordinate transformation matrix for the normals. Normalization processing is performed.
【0003】[0003]
【発明が解決しようとする課題】上記の法線ベクトルの
座標変換処理を行なう場合には、各法線ベクトル毎に同
次座標変換マトリクスに基づくマトリクス演算のみなら
ず正規化処理が必須であり、しかも一般的に処理対象と
なるポリゴンの数が著しく多いのであるから、図形処理
全体に占める法線ベクトルの正規化処理の割合がかなり
大きくなり、この結果、図形処理速度が低下してしまう
という不都合がある。When performing the above-described normal vector coordinate conversion processing, not only matrix operation based on a homogeneous coordinate conversion matrix but also normalization processing is required for each normal vector. In addition, since the number of polygons to be processed is generally extremely large, the ratio of normal vector normalization processing to the entire graphic processing becomes considerably large, and as a result, the graphic processing speed is reduced. There is.
【0004】尚、図形処理装置以外の装置であっても、
法線ベクトルの座標変換が必要な装置であれば同様の不
都合が生じる。[0004] Incidentally, even if the apparatus is other than the graphic processing apparatus,
A similar problem occurs if the apparatus requires coordinate transformation of the normal vector.
【0005】[0005]
【発明の目的】この発明は上記の問題点に鑑みてなされ
たものであり、法線ベクトルの座標変換に当って従来は
必須であった正規化処理を不要にできる法線ベクトル座
標変換装置を提供することを目的としている。SUMMARY OF THE INVENTION The present invention has been made in view of the above-mentioned problems, and an object of the present invention is to provide a normal vector coordinate conversion apparatus which can eliminate the normalization process which has been conventionally required in the normal vector coordinate conversion. It is intended to provide.
【0006】[0006]
【0007】[0007]
【課題を解決するための手段】請求項1の法線ベクトル
座標変換装置は、変換対象となる法線ベクトルが正規化
されているか否かを判別する第1判別手段と、対象とな
る座標変換が角度を保存するものであるか否かを判別す
る第2判別手段と、同次座標変換マトリクスの第4行お
よび第4列を除く部分行列の各要素に対してこの部分行
列の何れかの行要素の2乗和の平方根の逆数を乗算して
得た座標変換マトリクスを出力する座標変換マトリクス
出力手段と、変換対象となる法線ベクトルが正規化され
ていることを示す第1判別手段からの判別結果および対
象となる座標変換が角度を保存するものであることを示
す第2判別手段からの判別結果に応答して、座標変換マ
トリクス出力手段から出力される座標変換マトリクスに
基づく座標変換処理を行なう座標変換手段とを含んでい
る。According to a first aspect of the present invention, there is provided a normal vector coordinate conversion apparatus for determining whether or not a normal vector to be converted is normalized, and a target coordinate conversion. A second discriminating means for discriminating whether or not is the one that preserves an angle; and for each element of the sub-matrix except the fourth row and fourth column of the homogeneous coordinate transformation matrix, A coordinate transformation matrix output unit that outputs a coordinate transformation matrix obtained by multiplying a reciprocal of a square root of a sum of squares of a row element, and a first determination unit that indicates that a normal vector to be transformed is normalized. In response to the determination result from the second determination unit indicating that the target coordinate conversion is to save the angle, and the coordinate conversion processing based on the coordinate conversion matrix output from the coordinate conversion matrix output unit. And a coordinate transformation means for performing.
【0008】[0008]
【0009】[0009]
【作用】請求項1の法線ベクトル座標変換装置であれ
ば、変換対象となる法線ベクトルが正規化されているか
否かを第1判別手段により判別し、対象となる座標変換
が角度を保存するものであるか否かを第2判別手段によ
り判別する。また、同次座標変換マトリクスの第4行お
よび第4列を除く部分行列の各要素に対してこの部分行
列の何れかの行要素の2乗和の平方根の逆数を乗算して
得た座標変換マトリクスを座標変換マトリクス出力手段
により出力する。そして、変換対象となる法線ベクトル
が正規化されていることを示す第1判別手段からの判別
結果および対象となる座標変換が角度を保存するもので
あることを示す第2判別手段からの判別結果に応答し
て、座標変換手段により、座標変換マトリクス出力手段
から出力される座標変換マトリクスに基づく座標変換処
理を行なう。したがって、マトリクス演算および正規化
処理を行なっていた従来装置と比較して、正規化のため
の特別の処理を不要にできる。この紀果、法線ベクトル
を座標変換するために必要な処理量を大巾に低減でき、
座標変換処理速度を著しく向上できる。According to the first aspect of the present invention, the normal vector coordinate conversion device determines whether or not the normal vector to be converted is normalized by the first determination means, and the target coordinate conversion stores the angle. It is determined by the second determination means whether or not the operation is performed. Also, a coordinate transformation obtained by multiplying each element of the partial matrix excluding the fourth row and the fourth column of the homogeneous coordinate transformation matrix by the reciprocal of the square root of the sum of squares of any row element of the partial matrix. The matrix is output by the coordinate transformation matrix output means. The determination result from the first determination unit indicating that the normal vector to be converted is normalized, and the determination result from the second determination unit indicating that the target coordinate conversion preserves the angle. In response to the result, the coordinate conversion unit performs a coordinate conversion process based on the coordinate conversion matrix output from the coordinate conversion matrix output unit. Therefore, special processing for normalization can be made unnecessary as compared with a conventional apparatus that has performed matrix operation and normalization processing. As a result, the amount of processing required to convert the normal vector into coordinates can be greatly reduced,
The coordinate conversion processing speed can be significantly improved.
【0010】さらに詳細に説明すると、例えば円と円の
接線に直角なベクトルに対して従来方法により非均一な
拡大のための座標変換を行なうと円が楕円に変換され、
変換されたベクトルは楕円の接線に対して直角でなくな
ってしまう。ここで、元のベクトルが法線ベクトルに相
当している。本件発明者はこのような不都合が生じる原
因を解明し、法線ベクトルのみを座標変換するのではな
く、法線ベクトルで示される面を座標変換することによ
り元の法線ベクトルが座標変換後の図形に対しても法線
ベクトルとなるように法線ベクトルの座標変換を達成で
きることを見出し、併せて、所定の条件下において元の
法線ベクトルが正規化されている場合に特別に正規化の
ための処理を施すことなく正規化された変換後の法線ベ
クトルを得ることができることをも見出し本件発明を完
成させたのである。以下に詳述する。More specifically, for example, when a vector orthogonal to a tangent of a circle and a circle is subjected to coordinate transformation for non-uniform enlargement by a conventional method, the circle is transformed into an ellipse.
The transformed vector is no longer perpendicular to the tangent of the ellipse. Here, the original vector corresponds to the normal vector. The present inventor has clarified the cause of such an inconvenience, and does not perform coordinate transformation of only the normal vector, but carries out coordinate transformation of a plane indicated by the normal vector, thereby converting the original normal vector after the coordinate transformation. It has been found that the coordinate transformation of the normal vector can be achieved so that it becomes a normal vector also for the figure.In addition, when the original normal vector is normalized under predetermined conditions, special normalization is performed. It has also been found that a normalized normal vector after conversion can be obtained without performing any processing for this purpose, and the present invention has been completed. Details will be described below.
【0011】法線ベクトルN(Nx,Ny,Nz)で示さ
れる面の方程式が Nxx+Nyy+Nzz+R=0 であり、マトリクス[M]により座標変換された面の方
程式が Nx´x+Ny´y+Nz´z+R´=0 であり、変換後の面に対する法線ベクトルがN´(Nx
´,Ny´,Nz´)であると仮定する。[0011] a normal vector N (N x, N y, N z) equation of the surface represented by the N x x + N y y + N z z + R = 0, the matrix [M] by equation coordinate transformed face N x'x + N y'y + N z'z + R'= 0, the normal vector to the surface of the converted N'(N x
, N y ′, N z ′).
【0012】この場合において、変換前の座標点(X,
Y,Z,1)に対して変換後の面上の点の同次座標表現
が(X´,Y´,Z´,w´)であると仮定すると、w
´=0は無限遠点を示すものであるから、w´≠0の点
のみについて考えれば、上記同次座標表現はw´(X´
/w´,Y´/w´,Z´/w´,1)となり、通常座
標に戻すとw´(x´,y´,z´,1)となる。した
がって、座標変換前後の面上の点に関しては数1の関係
が成立する。In this case, coordinate points (X,
Assuming that a homogeneous coordinate expression of a point on the surface after conversion with respect to Y, Z, 1) is (X ′, Y ′, Z ′, w ′), w
Since '= 0 indicates a point at infinity, the homogenous coordinate expression is w' (X '
/ W ', Y' / w ', Z' / w ', 1), and when returned to normal coordinates, becomes w' (x ', y', z ', 1). Therefore, the relation of Equation 1 holds for points on the surface before and after the coordinate transformation.
【0013】[0013]
【数1】 (Equation 1)
【0014】上記面の方程式を行列で表すと、それぞれ
数2、数3のとおりになる。When the equations of the above surface are represented by matrices, they are as shown in Equations 2 and 3, respectively.
【0015】[0015]
【数2】 (Equation 2)
【0016】[0016]
【数3】 (Equation 3)
【0017】また、数1から (x y z 1)=w´(x´ y´ z´ 1)[M]-1 の関係が得られるので、数2に代入し、両辺をw´で除
算することにより数4の関係が得られる。Further, since the relationship of (xyz 1) = w ′ (x′y′z ′ 1) [M] −1 is obtained from Expression 1, it is substituted into Expression 2 and both sides are divided by w ′. By doing so, the relationship of Equation 4 is obtained.
【0018】[0018]
【数4】 (Equation 4)
【0019】数3および数4から数5の関係が得られ、
両辺を転置することにより数6の関係が得られる。The relationship of Expression 5 is obtained from Expressions 3 and 4;
By transposing both sides, the relationship of Expression 6 is obtained.
【0020】[0020]
【数5】 (Equation 5)
【0021】[0021]
【数6】 (Equation 6)
【0022】即ち、マトリクス[M]の逆行列の転置行
列で座標変換を行なうことにより法線ベクトルを正しく
座標変換できることが分る。但し、この場合には、Rを
算出する必要がある。しかし、マトリクス[M]の第4
列の要素が0 0 0 pであればRは座標変換結果
(Nx´ Ny´ Nz´)に全く影響を与えないことを
見出し、さらに第4行および第4列を除く部分行列に基
づく座標変換を行なうだけでよいことをも見出した。即
ち、マトリクス[M]の第4列が0 0 0pであれ
ば、逆行列[M]-1の第4列も0 0 0 p´とな
り、逆行列の転置行列t([M]-1)の第4行が0 0
0 p´となる。したがって、Rは座標変換結果(Nx
´ Ny´ Nz´)に全く影響を与えない。That is, it is understood that the coordinate transformation can be correctly performed on the normal vector by performing the coordinate transformation using the transposed matrix of the inverse matrix of the matrix [M]. However, in this case, it is necessary to calculate R. However, the fourth of the matrix [M]
If the element of the column is 0 00 p, it is found that R does not affect the coordinate transformation result (N x N y NN z ) at all, and furthermore, the sub-matrix excluding the fourth row and the fourth column has It is also found that it is only necessary to perform coordinate transformation based on the coordinates. That is, if the fourth column of the matrix [M] is 0 0 0p, the fourth column of the inverse matrix [M] -1 is also 0 0 0 p ′, and the inverse matrix transpose t ([M] -1 ) Is the fourth row of 0 0
0 p '. Therefore, R is the coordinate transformation result (N x
'N y' N z ') to no effect.
【0023】さらに、部分行列[Mb]が数7で与えら
れているとする。また、以下の説明において元の法線ベ
クトルを(N)で、座標変換後の法線ベクトルを(N
´)でそれぞれ示す。Further, it is assumed that the partial matrix [Mb] is given by Expression 7. In the following description, the original normal vector is (N), and the coordinate-transformed normal vector is (N).
').
【0024】[0024]
【数7】 (Equation 7)
【0025】そして、数8および数9の関係が成立する
と仮定する。Then, it is assumed that the relations of Expressions 8 and 9 hold.
【0026】[0026]
【数8】 (Equation 8)
【0027】かつAnd
【0028】[0028]
【数9】 (Equation 9)
【0029】また、r=(m112+m122+m1
32)-1/2とする。この場合には、数8および数9の関
係は数10で表される。Also, r = (m11 2 + m12 2 + m1)
3 2 ) Set to -1/2 . In this case, the relationship between Expressions 8 and 9 is expressed by Expression 10.
【0030】[0030]
【数10】 (Equation 10)
【0031】但し、[E]は単位ベクトルである。この
関係は数11のように変形できるので、r・[Mb]が
直交マトリクスであることが分る。Here, [E] is a unit vector. Since this relationship can be modified as shown in Equation 11, it can be seen that r · [Mb] is an orthogonal matrix.
【0032】[0032]
【数11】 [Equation 11]
【0033】ところで、数10の両辺に左からr2・
[Mb]-1を乗算すると、 r2・t[Mb]=[Mb]-1 となるので、数12に代入して変形することにより数1
3が得られる。By the way, r 2 ·
By multiplying by [Mb] −1 , r 2 · t [Mb] = [Mb] −1.
3 is obtained.
【0034】[0034]
【数12】 (Equation 12)
【0035】[0035]
【数13】 (Equation 13)
【0036】即ち、(N)・(r・[Mb])=(Ns
´)の式に基づいて座標変換を行なうことが数12に基
づいて座標変換を行なうことと等価である。さらに、数
11の左から(N)を、右からt(N)を乗算して変形
すると、 ((N)・(r・[Mb]))・t((N)・(r・[Mb]))=(N)・t (N) となる。この式に数13を代入して変形することにより |(Ns´)|=|(N)| の関係が得られるのであるから、数13に基づいて法線
ベクトルを座標変換した場合に法線ベクトルの長さが保
存されることが分る。That is, (N) · (r · [Mb]) = (Ns
Performing coordinate transformation based on the equation (1) is equivalent to performing coordinate transformation based on Equation 12. Further, when (N) from the left of Expression 11 is transformed by multiplying t (N) from the right, ((N) · (r · [Mb])) · t ((N) · (r · [Mb) ])) = (N) · t (N). By substituting equation (13) into this equation and transforming it, the relationship of | (Ns ′) | = | (N) | is obtained. Therefore, when the normal vector is coordinate-transformed based on equation (13), the normal becomes You can see that the length of the vector is preserved.
【0037】したがって、法線ベクトル(N)が正規化
されている場合には、r・[Mb]に基づいて座標変換
を行なうだけで、座標変換および正規化が行なわれた法
線ベクトル(Ns´)を得ることができる。Therefore, when the normal vector (N) is normalized, only the coordinate transformation based on r · [Mb] is performed, and the coordinate-transformed and normalized normal vector (Ns ') Can be obtained.
【0038】[0038]
【実施例】以下、実施例を示す添付図面によって詳細に
説明する。図1はこの発明の法線ベクトル座標変換方法
の一実施例を示すフローチャートである。ステップSP
1において設定条件に基づいて座標点変換のための同次
マトリクス[M]を設定し、ステップSP2において、
元の法線ベクトルが正規化され、かつ設定された同次マ
トリクス[M]が角度を保存するものであるか否か、即
ち、元の法線ベクトルが正規化され、かつ数8および数
9を満足しているか否かを判別する。そして、ステップ
SP2において元の法線ベクトルが正規化され、かつ数
8および数9を満足すると判別された場合には、ステッ
プSP3においてr・[Mb]を算出して法線変換用マ
トリクスとし、逆に、ステップSP2において元の法線
ベクトルが正規化されていないか、または数8および数
9の少なくとも一方を満足しないと判別された場合に
は、ステップSP4においてt([Mb]-1)を算出し
て法線変換用マトリクスとする。ステップSP3または
ステップSP4の処理が行なわれた後は、ステップSP
5において、算出された法線変換用マトリクスに基づい
て法線ベクトルの座標変換を行ない、ステップSP6に
おいて、元の法線ベクトルが正規化され、かつ設定され
た同次マトリクス[M]が角度を保存するものであるか
否か、即ち、元の法線ベクトルが正規化され、かつ数8
および数9を満足しているか否かを判別する。そして、
ステップSP6において元の法線ベクトルが正規化され
ていないか、または数8および数9の少なくとも一方を
満足しないと判別された場合には、ステップSP7にお
いて、座標変換された法線ベクトルに対する正規化処理
を施す。ステップSP7の処理が行なわれた場合、また
はステップSP6において元の法線ベクトルが正規化さ
れ、かつ数8および数9を満足すると判別された場合に
は、ステップSP8において対象となる全ての法線ベク
トルの座標変換が終了したか否かを判別し、座標変換が
終了していない法線ベクトルが存在している場合には再
びステップSP5の処理を行なう。逆に、対象となる全
ての法線ベクトルの座標変換が終了したと判別された場
合にはそのまま一連の処理を終了する。BRIEF DESCRIPTION OF THE DRAWINGS FIG. FIG. 1 is a flowchart showing one embodiment of the normal vector coordinate conversion method of the present invention. Step SP
In step 1, a homogeneous matrix [M] for coordinate point conversion is set based on the setting conditions, and in step SP2,
Whether the original normal vector has been normalized and whether the set homogeneous matrix [M] preserves angles, ie, the original normal vector has been normalized, and Equations 8 and 9 Is determined. Then, in step SP2, when it is determined that the original normal vector is normalized, and it is determined that Expressions 8 and 9 are satisfied, r · [Mb] is calculated in step SP3 to obtain a normal conversion matrix. Conversely, if it is determined in step SP2 that the original normal vector is not normalized or does not satisfy at least one of Equations 8 and 9, t ([Mb] -1 ) is determined in Step SP4. Is calculated as a normal-line conversion matrix. After the processing of step SP3 or step SP4 is performed, step SP3
In step 5, coordinate transformation of the normal vector is performed based on the calculated normal transformation matrix. In step SP6, the original normal vector is normalized, and the set homogeneous matrix [M] determines the angle. Whether it is to be preserved, that is, the original normal vector is normalized and
It is determined whether or not Equation 9 is satisfied. And
If it is determined in step SP6 that the original normal vector has not been normalized or does not satisfy at least one of Equations 8 and 9, in Step SP7, normalization of the coordinate-transformed normal vector is performed. Perform processing. If the processing in step SP7 has been performed, or if it is determined in step SP6 that the original normal vectors have been normalized and that equations (8) and (9) are satisfied, all the target normals are determined in step SP8. It is determined whether or not the vector coordinate conversion has been completed. If there is a normal vector for which the coordinate conversion has not been completed, the process of step SP5 is performed again. Conversely, if it is determined that the coordinate conversion of all the target normal vectors has been completed, the series of processing ends.
【0039】以上の説明から明らかなように、元の法線
ベクトルが正規化され、かつ同次マトリクスが数8およ
び数9を満足する場合には、単にr・[Mb]を法線変
換用マトリクスとして法線ベクトルの座標変換を行なう
だけでよく、座標変換後に正規化処理を施す必要がなく
なるのであるから、法線ベクトルの座標変換のための処
理を簡素化できる。また、一旦法線変換用マトリクスを
算出した後は多数の法線ベクトルに対して座標変換処理
を行なうだけでよいから、法線変換用マトリクスの算出
に従来方法よりも多少時間がかかっても、全体としてみ
れば大幅な処理の簡素化および高速化を達成できる。さ
らに、座標変換の対象となる法線ベクトルが正規化され
ていないか、または同次マトリクスが数8および数9の
少なくとも一方を満足していない場合には、法線変換用
マトリクスの算出に従来方法よりも多少時間がかかるこ
とに起因して処理の複雑化および低速化を招くことにな
るのであるが、一般的なアプリケーション・プログラム
においては座標変換の対象となる法線ベクトルが正規化
され、かつ同次マトリクスが数8および数9を満足する
場合が殆どであるから、全体として処理の簡素化および
高速化を達成できることになる。本件発明者が行なった
ベンチマーク・テストの結果、図形処理装置における処
理量が約14〜15%減少し、全体として性能が約17
%向上したことが確認された。As is apparent from the above description, when the original normal vector is normalized and the homogeneous matrix satisfies the equations (8) and (9), simply r · [Mb] is used for normal transformation. It is only necessary to perform the coordinate transformation of the normal vector as a matrix, and there is no need to perform the normalization processing after the coordinate transformation. Therefore, the processing for the coordinate transformation of the normal vector can be simplified. Also, once the matrix for normal transformation is calculated, it is only necessary to perform coordinate transformation processing on a large number of normal vectors, so even if it takes a little longer to calculate the matrix for normal transformation than the conventional method, As a whole, the processing can be greatly simplified and speeded up. Further, if the normal vector to be coordinate-transformed is not normalized, or if the homogeneous matrix does not satisfy at least one of Equations 8 and 9, conventional calculation of the matrix for normal transformation is performed. Although it takes a little longer than the method, the processing becomes complicated and slows down.However, in a general application program, the normal vector to be subjected to coordinate transformation is normalized, In most cases, the homogeneous matrix satisfies the formulas 8 and 9, so that the processing can be simplified and speeded up as a whole. As a result of the benchmark test performed by the present inventor, the processing amount in the graphic processing apparatus was reduced by about 14 to 15%, and the overall performance was reduced by about 17%.
It has been confirmed that the percentage has improved.
【0040】[0040]
【実施例2】図2はこの発明の法線ベクトル座標変換装
置の一実施例を示すブロック図である。図2の法線ベク
トル座標変換装置は、座標変換の対象となる法線ベクト
ルが既に正規化されているか否かを判別する正規化判別
部9と、設定条件に基づいて座標点変換のための同次マ
トリクス[M]を設定する同次マトリクス設定部1と、
設定された同次マトリクス[M]が角度を保存するもの
であるか否かを判別する同次マトリクス判別部2と、正
規化判別部9による判別結果および同次マトリクス判別
部2による判別結果に応答して選択的に動作する1対の
法線変換用マトリクス算出部3,4と、何れかの法線変
換用マトリクス算出部3,4により算出された法線変換
用マトリクスを保持する法線変換用マトリクス保持部5
と、法線変換用マトリクスに基づいて法線ベクトルの座
標変換を行なう法線ベクトル座標変換部6と、座標変換
の対象となる法線ベクトルが正規化されていないことを
示す正規化判別部9からの判別結果および設定された同
次マトリクスが角度を保存するものでないことを示す同
次マトリクス判別部2からの判別結果に応答して、座標
変換された法線ベクトルの正規化を行なう正規化処理部
7と、変換対象となる法線ベクトルの数に対応して法線
ベクトル座標変換部6および必要に応じて正規化処理部
7を反復動作させる反復制御部8とを有している。Embodiment 2 FIG. 2 is a block diagram showing an embodiment of a normal vector coordinate converter according to the present invention. The normal vector coordinate conversion device of FIG. 2 includes a normalization determination unit 9 that determines whether a normal vector to be subjected to coordinate conversion has already been normalized, and a normalization determination unit 9 that performs coordinate point conversion based on setting conditions. A homogeneous matrix setting unit 1 for setting a homogeneous matrix [M];
A homogenous matrix discriminating unit 2 for discriminating whether or not the set homogenous matrix [M] preserves the angle, a discrimination result by the normalization discriminating unit 9 and a discrimination result by the homogenous matrix discriminating unit 2 A pair of normal-line conversion matrix calculation units 3 and 4 that selectively operate in response, and a normal line that holds the normal-line conversion matrix calculated by any of the normal-line conversion matrix calculation units 3 and 4 Conversion matrix holding unit 5
And a normal vector coordinate conversion unit 6 for performing coordinate conversion of the normal vector based on the normal conversion matrix, and a normalization determination unit 9 for indicating that the normal vector to be subjected to the coordinate conversion is not normalized. , And normalization for normalizing the coordinate-transformed normal vector in response to the determination result from the homogeneous matrix determination unit 2 indicating that the set homogeneous matrix does not preserve the angle. The processing unit 7 includes a normal vector coordinate conversion unit 6 corresponding to the number of normal vectors to be converted, and an iterative control unit 8 for repeatedly operating the normalization processing unit 7 as necessary.
【0041】上記同次マトリクス判別部2は、設定され
た同次マトリクス[M]が数8および数9を満足してい
るか否かを判別するものである。上記法線変換用マトリ
クス算出部3はr・[Mb]を法線変換用マトリクスと
して算出するものであり、上記法線変換用マトリクス算
出部4はt([Mb]-1)を法線変換用マトリクスとし
て算出するものである。The homogeneous matrix determination section 2 determines whether or not the set homogeneous matrix [M] satisfies Expressions 8 and 9. The normal-line conversion matrix calculation unit 3 calculates r · [Mb] as a normal-line conversion matrix, and the normal-line conversion matrix calculation unit 4 converts t ([Mb] −1 ) into a normal-line conversion. It is calculated as a use matrix.
【0042】上記構成の法線ベクトル座標変換装置の作
用は次のとおりである。先ず、正規化判別部9により座
標変換の対象となる法線ベクトルが既に正規化されてい
るか否かを判別し、座標変換のための設定条件に基づい
て同次マトリクス設定部1において同次マトリクスを設
定し、設定された同次マトリクスが数8および数9を共
に満足するか否かを同次マトリクス判別部2により判別
する。そして、正規化判別部9により座標変換の対象と
なる法線ベクトルが既に正規化されていると判別され、
かつ同次マトリクス判別部2により数8および数9を満
足すると判別された場合には、法線変換用マトリクス算
出部3によりr・[Mb]を算出して法線変換用マトリ
クス保持部5に供給する。逆に、正規化判別部9により
座標変換の対象となる法線ベクトルが既に正規化されて
いないと判別され、および/または同次マトリクス判別
部2により数8および数9の少なくとも一方を満足しな
いと判別された場合には、法線変換用マトリクス算出部
4によりt([Mb]-1)を算出して法線変換用マトリ
クス保持部5に供給する。The operation of the normal vector coordinate conversion device having the above configuration is as follows. First, the normalization determination unit 9 determines whether or not the normal vector to be subjected to coordinate conversion has already been normalized. Based on the setting conditions for coordinate conversion, the homogeneous matrix Is set, and whether the set homogeneous matrix satisfies both Equation 8 and Equation 9 is determined by the homogeneous matrix determination unit 2. Then, the normalization determining unit 9 determines that the normal vector to be subjected to the coordinate conversion has already been normalized,
When it is determined by the homogenous matrix determination unit 2 that Equations 8 and 9 are satisfied, r · [Mb] is calculated by the normal-line conversion matrix calculation unit 3 and stored in the normal-line conversion matrix holding unit 5. Supply. Conversely, it is determined by the normalization determining unit 9 that the normal vector to be subjected to the coordinate conversion has not been normalized, and / or the homogeneous matrix determining unit 2 does not satisfy at least one of Expressions 8 and 9. Is determined, t ([Mb] -1 ) is calculated by the normal-line conversion matrix calculation unit 4 and supplied to the normal-line conversion matrix holding unit 5.
【0043】以上のように法線ベクトル座標変換用のマ
トリクスが法線変換用マトリクス保持部5に保持された
後は、反復制御部8により反復動作される法線ベクトル
座標変換部6により各法線ベクトルの座標変換を行な
う。ここで、法線ベクトル座標変換用のマトリクスがr
・[Mb]である場合には、変換後の法線ベクトルが既
に正規化された状態になっているのであるから、さらに
正規化処理を行なう必要はなく、処理を簡素化できると
ともに高速化できる。しかし、法線ベクトル座標変換用
のマトリクスがt([Mb]-1)である場合には、変換
後の法線ベクトルは正規化された状態ではないから、さ
らに正規化処理を行なう必要があり、正規化処理部7に
より正規化処理を行なうことにより、座標変換され、か
つ正規化された法線ベクトルを得ることができる。After the matrix for normal vector coordinate conversion is held in the matrix holding unit 5 for normal line conversion as described above, the normal vector coordinate conversion unit 6 that is repeatedly operated by the repetition control unit 8 performs each method. Performs coordinate transformation of a line vector. Here, the matrix for normal vector coordinate transformation is r
In the case of [Mb], since the transformed normal vector is already in a normalized state, it is not necessary to perform further normalization processing, and the processing can be simplified and the speed can be increased. . However, if the matrix for normal vector coordinate conversion is t ([Mb] -1 ), the normal vector after conversion is not in a normalized state, so it is necessary to perform further normalization processing. By performing the normalization processing by the normalization processing unit 7, a coordinate-transformed and normalized normal vector can be obtained.
【0044】以上の説明から明らかなように、法線ベク
トル座標変換用のマトリクスがt([Mb]-1)である
場合には同次マトリクス判別部2による判別が必要にな
る分だけ処理が複雑化することになるが、一般的なアプ
リケーション・プログラムにおいては座標変換の対象と
なる法線ベクトルが既に正規化され、かつ同次マトリク
スが数8および数9を満足する場合、即ち、法線ベクト
ル座標変換用のマトリクスがr・[Mb]である場合が
殆どであるから、全体として処理の簡素化および高速化
を達成できることになる。As is clear from the above description, when the matrix for normal vector coordinate conversion is t ([Mb] -1 ), the processing is performed by the amount required to be determined by the homogeneous matrix determination unit 2. Although it is complicated, in a general application program, the normal vector to be subjected to coordinate transformation has already been normalized, and the homogeneous matrix satisfies Expressions 8 and 9, ie, the normal line In most cases, the matrix for vector coordinate conversion is r · [Mb], so that the processing can be simplified and speeded up as a whole.
【0045】尚、この発明は上記の実施例に限定される
ものではなく、例えば、座標変換前の法線ベクトルが既
に正規化されているか否かおよび数8および数9を満足
するか否かの判別結果に対応してフラグをセット/リセ
ットしておき、座標変換後にフラグがセットされている
かリセットされているかに応答して正規化処理を省略す
るか実行するかを制御することが可能であるほか、この
発明の要旨を変更しない範囲内において種々の設計変更
を施すことが可能である。It should be noted that the present invention is not limited to the above embodiment. For example, it is determined whether or not the normal vector before coordinate transformation has already been normalized and whether or not Equations 8 and 9 are satisfied. It is possible to set / reset the flag in accordance with the result of the determination, and control whether to omit or execute the normalization processing in response to whether the flag is set or reset after the coordinate conversion. In addition, various design changes can be made without departing from the scope of the present invention.
【0046】[0046]
【0047】[0047]
【発明の効果】請求項1の発明も、同次座標変換マトリ
クスの第4行および第4列を除く部分行列の各要素に対
してこの部分行列の何れかの行要素の2乗和の平方根の
逆数を乗算して得た座標変換マトリクスに基づく座標変
換を行なうだけで座標変換が施され、かつ正規化された
法線ベクトルを得ることができ、正規化のための特別の
処理を不要にできるのであるから、法繚ベクトルを座標
変換するために必要な処理量を大巾に低減でき、座標変
換処理速度を著しく向上できるという特有の効果を奏す
る。According to the first aspect of the present invention, the square root of the sum of squares of any of the row elements of the sub-matrix is calculated for each element of the sub-matrix excluding the fourth row and the fourth column of the homogeneous coordinate transformation matrix. The coordinate transformation is performed only by performing the coordinate transformation based on the coordinate transformation matrix obtained by multiplying the reciprocal of, and a normalized normal vector can be obtained, eliminating the need for special processing for normalization. Since it is possible, the amount of processing required for performing coordinate transformation of the legal vector can be greatly reduced, and a unique effect that the coordinate transformation processing speed can be remarkably improved can be achieved.
【図1】この発明の法線ベクトル座標変換方法の一実施
例を示すフローチャートである。FIG. 1 is a flowchart showing an embodiment of a normal vector coordinate conversion method according to the present invention.
【図2】この発明の法線ベクトル座標変換装置の一実施
例を示すブロック図である。FIG. 2 is a block diagram showing an embodiment of a normal vector coordinate conversion device according to the present invention.
2 同次マトリクス判別部 3 法線変換用マトリク
ス算出部 6 法線ベクトル座標変換部 9 正規化判別部2 Homogeneous matrix discriminating section 3 Matrix calculating section for normal transformation 6 Normal vector coordinate transforming section 9 Normalization discriminating section
───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 17/10 - 17/18 G06T 1/00 - 1/40 G06T 3/00 - 5/50 G06T 9/00 - 9/40 G06T 11/00 - 11/40 G06T 15/00 - 15/60 G06T 17/00 - 17/30 ──────────────────────────────────────────────────続 き Continued on the front page (58) Fields surveyed (Int. Cl. 7 , DB name) G06F 17/10-17/18 G06T 1/00-1/40 G06T 3/00-5/50 G06T 9 / 00-9/40 G06T 11/00-11/40 G06T 15/00-15/60 G06T 17/00-17/30
Claims (1)
れているか否かを判別する第1判別手段(9)と、対象
となる座標変換が角度を保存するものであるか否かを判
別する第2判別手段(2)と、同次座標変換マトリクス
の第4行および第4列を除く部分行列の各要素に対して
この部分行列の何れかの行要素の2乗和の平方根の逆数
を乗算して得た座標変換マトリクスを出力する座標変換
マトリクス出力手段(3)と、変換対象となる法線ベク
トルが正規化されていることを示す第1判別手段(9)
からの判別結果および対象となる座標変換が角度を保存
するものであることを示す第2判別手段(2)からの判
別結果に応答して、座標変換マトリクス出力手段(3)
から出力される座標変換マトリクスに基づく座標変換処
理を行なう座標変換手段(6)とを含むことを特徴とす
る法線ベクトル座標変換装置。A first determining means for determining whether a normal vector to be converted is normalized; and determining whether or not a coordinate conversion to be performed preserves an angle. And a reciprocal of the square root of the sum of squares of any row element of the sub-matrix for each element of the sub-matrix excluding the fourth row and the fourth column of the homogeneous coordinate transformation matrix A coordinate transformation matrix output means (3) for outputting a coordinate transformation matrix obtained by multiplying by (1), and a first discrimination means (9) for indicating that a normal vector to be transformed is normalized.
A coordinate transformation matrix output means (3) in response to the judgment result from the second judgment means and the judgment result from the second judgment means (2) indicating that the target coordinate conversion is to save the angle.
And a coordinate conversion means (6) for performing a coordinate conversion process based on a coordinate conversion matrix output from the device.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP30362391A JP3312382B2 (en) | 1991-11-19 | 1991-11-19 | Normal vector coordinate converter |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP30362391A JP3312382B2 (en) | 1991-11-19 | 1991-11-19 | Normal vector coordinate converter |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH05143635A JPH05143635A (en) | 1993-06-11 |
| JP3312382B2 true JP3312382B2 (en) | 2002-08-05 |
Family
ID=17923217
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP30362391A Expired - Fee Related JP3312382B2 (en) | 1991-11-19 | 1991-11-19 | Normal vector coordinate converter |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3312382B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9147249B2 (en) * | 2012-10-23 | 2015-09-29 | Electronics And Telecommunications Research Institute | Apparatus and method for calibrating depth image based on relationship between depth sensor and color camera |
-
1991
- 1991-11-19 JP JP30362391A patent/JP3312382B2/en not_active Expired - Fee Related
Non-Patent Citations (1)
| Title |
|---|
| 長尾真、他7名編,岩波情報科学辞典,日本,株式会社岩波書店,1990年5月25日,初版,p.425 |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH05143635A (en) | 1993-06-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6369818B1 (en) | Method, apparatus and computer program product for generating perspective corrected data from warped information | |
| US6377712B1 (en) | Iteratively building displacement maps for image warping | |
| JP2642070B2 (en) | Method and system for generating quadrilateral mesh | |
| CN112528707A (en) | Image processing method, device, equipment and storage medium | |
| WO2004053741A1 (en) | Method of calculating intersecions between triangle and line segment and progam therefor | |
| US5638500A (en) | Apparatus and method for direct calculation of clip region | |
| JP3312382B2 (en) | Normal vector coordinate converter | |
| JP3239975B2 (en) | Polygon drawing device | |
| JP3413733B2 (en) | Method for checking interference between shapes | |
| US6552724B1 (en) | Triangle strip merging for length maximization | |
| CA2308249C (en) | Triangle strip length maximization | |
| US8232993B2 (en) | Systems and methods for graphical rendering | |
| US6380936B1 (en) | System and method for inferring projective mappings | |
| US6683621B1 (en) | Vertex and spherical normalization circuit | |
| US6822656B1 (en) | Sphere mode texture coordinate generator | |
| JPS6114514B2 (en) | ||
| US6489958B1 (en) | Method and device for graphic representation of an object defined by a plurality of triangles on a display surface | |
| JP5391759B2 (en) | Deformation simulation method of virtual object | |
| JPH0664618B2 (en) | Clipping circuit | |
| Li | VQS Transformation with an Incremental Approach | |
| CN120374717A (en) | Image processing method, device, equipment and medium | |
| JPH07282106A (en) | CAD data offset method | |
| JPH11149561A (en) | Method and apparatus for generating a non-fractal scalar field | |
| JPH087127A (en) | Memory reduced coordinate transforming device | |
| JPH1083461A (en) | Graphic drawing device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080531 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090531 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100531 Year of fee payment: 8 |
|
| LAPS | Cancellation because of no payment of annual fees |