JPH0628492A - Writing processing method in computer graphics - Google Patents

Writing processing method in computer graphics

Info

Publication number
JPH0628492A
JPH0628492A JP18236492A JP18236492A JPH0628492A JP H0628492 A JPH0628492 A JP H0628492A JP 18236492 A JP18236492 A JP 18236492A JP 18236492 A JP18236492 A JP 18236492A JP H0628492 A JPH0628492 A JP H0628492A
Authority
JP
Japan
Prior art keywords
normal vector
points
vector
lighting
processing method
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.)
Withdrawn
Application number
JP18236492A
Other languages
Japanese (ja)
Inventor
Hiroshi Komazaki
弘 駒崎
Hideki Yagishita
秀樹 柳下
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP18236492A priority Critical patent/JPH0628492A/en
Publication of JPH0628492A publication Critical patent/JPH0628492A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Abstract

PURPOSE:To execute the writing processing at a high speed. CONSTITUTION:In the graphic processing method for displaying an image by executing a graphic processing, based on apex data of a polygonal graphic, based on graphic data containing coordinates of two points on the graphic and a normalized normal vector, a coordinate calculating means 2 for deriving a coordinate of a point for interpolating between two points, a normal vector calculating means 3 for deriving a normal vector of an interpolated point, and a writing processing part 4 are provided, and the normal vector calculating means 3 is constituted so that an angle made by the normal vectors of two points is calculated, and also, its angle is divided, based on the number of divisions of two points, a normalized normal vector of an interpolated point is calculated based on the normal vectors of two points and the divided angle, and a writing processing is executed by the normalized normal vector and a vector required for the writing processing.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は,コンピュータグラフィ
ックスにおけるライティング処理方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a lighting processing method in computer graphics.

【0002】3次元コンピュータグラフィックスは,ア
ニメーション,科学技術分野におけるシミュレーション
等様々な分野で利用されている。そして,そのようなコ
ンピュータグラフィックスは,精密な写実が要求される
とともに,高速に処理される必要がある。
Three-dimensional computer graphics are used in various fields such as animation and simulation in the field of science and technology. In addition, such computer graphics are required to be processed at high speed while demanding precise realism.

【0003】3次元コンピュータグラフィックスでは,
画像を構成する画素毎に法線ベクトルを求め,法線ベク
トル,光源情報,描画対象物表面の反射率等に基づくラ
イティング処理を画素毎に行い,リアリティのある描画
を得るようにしている。
In three-dimensional computer graphics,
A normal vector is obtained for each pixel that constitutes an image, and lighting processing is performed for each pixel based on the normal vector, light source information, the reflectance of the surface of the drawing target, and the like, so as to obtain realistic drawing.

【0004】そのような法線ベクトルの算出とライティ
ング処理は計算量が大きく処理の高速化の妨げになって
いた。
The calculation of such a normal vector and the lighting process require a large amount of calculation, which has been an obstacle to speeding up the process.

【0005】[0005]

【従来の技術】図8は従来のコンピュータグラフィック
ス装置の構成を示す。図において,100は多角形デー
タ入力部であって,描画図形を構成する要素となる多角
形図形の頂点の座標値,属性値(法線ベクトル,色等の
値)を入力するものである。101は面塗り部であっ
て,頂点間を結ぶ直線の座標,直線上の画素の法線ベク
トル等を線型補間により算出するものである(線型補間
については後述する)。102は面塗り部における法線
ベクトル算出部であって,補間された点の法線ベクトル
を算出するものである。103はスパン処理部であっ
て,頂点を結ぶ線分とディスプレイの水平走査ラインと
の交点同士を結ぶ水平走査ラインに平行な線分(スパン
と称する)上の画素の座標と法線ベクトルを算出するも
のである。スパン上の画素の法線ベクトルはスパン両端
の点の法線ベクトルに基づいて線型補間により算出す
る。104は法線ベクトル算出部である。
2. Description of the Related Art FIG. 8 shows the configuration of a conventional computer graphics device. In the figure, reference numeral 100 denotes a polygon data input unit for inputting coordinate values of vertexes of polygonal figures, which are elements constituting a drawing figure, and attribute values (values such as normal vectors and colors). Reference numeral 101 denotes a surface-painting unit which calculates coordinates of a straight line connecting vertices, a normal vector of pixels on the straight line, and the like by linear interpolation (linear interpolation will be described later). Reference numeral 102 denotes a normal vector calculation unit in the surface painting unit, which calculates the normal vector of the interpolated point. Reference numeral 103 denotes a span processing unit, which calculates coordinates and normal vectors of pixels on a line segment (called a span) parallel to the horizontal scanning line connecting the intersections of the line segment connecting the vertices and the horizontal scanning line of the display. To do. The normal vector of the pixels on the span is calculated by linear interpolation based on the normal vectors of the points at both ends of the span. 104 is a normal vector calculation unit.

【0006】105は隠面消去部であって,算出した画
素のZ値とZバッファ106に保持されている旧画素の
Z値を比較し,視点から見えない部分を消去するもので
ある。例えばZ値が小さい画素はZ値が大きい画素より
手前にあるというように,Z値は画素の視点からの相対
的位置関係を表す値である。そして,算出した現画素の
Z値が旧画素のZ値より小さければ,後続のライティン
グ処理部107に求めた画素のデータを転送して表示処
理を行い,Zバッファ106の値を更新する。106は
Zバッファであって,画素のZ値を格納するものであ
る。
Reference numeral 105 denotes a hidden surface erasing unit, which compares the calculated Z value of the pixel with the Z value of the old pixel held in the Z buffer 106, and erases a portion which cannot be seen from the viewpoint. For example, a pixel having a small Z value is in front of a pixel having a large Z value, and the Z value is a value representing the relative positional relationship of the pixel from the viewpoint. If the calculated Z value of the current pixel is smaller than the Z value of the old pixel, the pixel data obtained is transferred to the subsequent lighting processing unit 107 for display processing, and the value of the Z buffer 106 is updated. A Z buffer 106 stores the Z value of a pixel.

【0007】107はライティング処理部であって,各
画素の法線ベクトルと反射係数等の属性情報並びに照明
情報などから各画素の輝度を求めるものである。輝度の
算出方法は,(1) フォングライティング法,(2) クック
ライティング法,(3) ホールライティング法等がある
(これらのライティング法についてはそれぞれ後述す
る)。
A lighting processing unit 107 obtains the luminance of each pixel from the normal vector of each pixel, attribute information such as reflection coefficient, and illumination information. Luminance calculation methods include (1) Fong lighting method, (2) Cook lighting method, and (3) Hole lighting method (each of these lighting methods will be described later).

【0008】108はフレームバッファであって,1表
示画面分の画素データを格納するものである。109は
CRTであって,フレームバッファ108上の画素デー
タに基づいて画像表示するものである。
A frame buffer 108 stores pixel data for one display screen. A CRT 109 displays an image based on the pixel data on the frame buffer 108.

【0009】図9は従来の法線ベクトル算出方法を示す
図である。図において,A,B,C,Dは画像生成の基
本図形となる多角形図形の頂点である。頂点のデータは
座標,属性値(色,法線ベクトル等の値)よりなるもの
である。点Pは線型補間により求めた頂点Aと頂点Bを
結ぶ線分上の点である。同様に,点Qは線型補間により
求めた頂点Cと頂点Dを結ぶ線分上の点である。点Rは
水平走査ライン方向の線分PQ(スパン)上の点であ
る。
FIG. 9 is a diagram showing a conventional normal vector calculation method. In the figure, A, B, C and D are vertices of a polygonal figure which is a basic figure for image generation. The vertex data is composed of coordinates and attribute values (values such as color and normal vector). The point P is a point on the line segment connecting the vertices A and B obtained by the linear interpolation. Similarly, the point Q is a point on the line segment connecting the vertices C and D obtained by the linear interpolation. The point R is a point on the line segment PQ (span) in the horizontal scanning line direction.

【0010】NA ,NB ,NC ,ND はそれぞれ頂点
A,B,C,Dの法線ベクトルである。N1 ,N2 ,N
はそれぞれ点P,Q,Rの法線ベクトルである。以下の
説明において,NA ,NB ,NC ,ND ,N1 ,N2
Nは全てベクトルを表す。
N A , N B , N C and N D are normal vectors of vertices A, B, C and D, respectively. N 1 , N 2 , N
Are normal vectors of the points P, Q, and R, respectively. In the following description, N A , N B , N C , N D , N 1 , N 2 ,
All N represent vectors.

【0011】図10により従来のグラフィック処理方法
の説明をする(図8,図9を参照)。 多角形データ入力部100は,多角図形ABCDの
頂点データを入力する。
A conventional graphic processing method will be described with reference to FIG. 10 (see FIGS. 8 and 9). The polygon data input unit 100 inputs the vertex data of the polygonal figure ABCD.

【0012】 面塗り部101は,線分AB上の点
P,線分CD上の点Qを線型補間により求める。点Pの
座標を線型補間により求める場合,線分ABの傾きと点
Pの点Aからの垂直方向の増分に対する水平方向の増分
を求め,座標を算出する。色等の属性値も同様に線型補
間する。
The surface painting unit 101 obtains a point P on the line segment AB and a point Q on the line segment CD by linear interpolation. When the coordinates of the point P are obtained by linear interpolation, the inclination of the line segment AB and the increment of the point P in the horizontal direction with respect to the increment in the vertical direction from the point A are obtained and the coordinates are calculated. Similarly, linear interpolation is performed on attribute values such as colors.

【0013】 面塗り部101は,点Pの法線ベクト
ルN1 ,点Qの法線ベクトルN2 を線型補間により算出
し,正規化処理する。線型補間により法線ベクトルを算
出する方法は,頂点Aの法線ベクトルNA ,頂点Bの法
線ベクトルのNB それぞれの成分について,線分ABの
傾きと点Pの頂点Aからの垂直方向の増分とにより算出
する。正規化処理はベクトルの長さを1とする。
[0013] surface coating portion 101, the normal vector N 1 of the point P, and the normal vector N 2 of point Q is calculated by linear interpolation, processes normalization. Method for calculating the normal vector by linear interpolation normal vector N A vertices A, the N B each component of the normal vector of the vertex B, the vertical direction from the apex A of the slope and the point P of the line segment AB And the increment of. In the normalization process, the length of the vector is set to 1.

【0014】 スパン処理部103はスパンPQ上の
画素Rの座標を求める。 スパン処理部103はスパンPQ上の点Rの法線ベ
クトルを点Pの法線ベクトルN1 と点Qの法線ベクトル
2 を線型補間により求め,正規化処理する。
The span processing unit 103 obtains the coordinates of the pixel R on the span PQ. Span processor 103 determined by linear interpolation of the normal vectors N 2 of the normal vector N 1 and the point Q of the point P the vector of point R on the span PQ, processes normalization.

【0015】 隠面消去部105は現画素のZ値と旧
画素のZ値を比較し隠面消去を行う。 ライティング処理部107はライティング処理を行
う(ライティング処理については後述する)。
The hidden surface removal unit 105 compares the Z value of the current pixel with the Z value of the old pixel to perform hidden surface removal. The writing processing unit 107 performs writing processing (writing processing will be described later).

【0016】 ライティング処理された1画面分のデ
ータをフレームバッファ108に格納し,CRT109
に画像表示する。次にライティング処理部107におけ
るライティング処理方法について説明する。
Data for one screen that has undergone lighting processing is stored in the frame buffer 108, and the CRT 109
The image is displayed on. Next, a lighting processing method in the lighting processing unit 107 will be described.

【0017】ランティング処理は,光源の種類,位置,
視点の位置に基づいて,画素毎に色および輝度を算出す
るものである。ライティング処理方法には,フォングラ
イティング法,クックライティング法,ホールライティ
ング法等さまざまな方法があるが,先ず代表的なフォン
グライティング法について説明する(クックライティン
グ,ホールライティングについては後述する)。
The launching process is performed by selecting the type of light source, position,
Color and luminance are calculated for each pixel based on the position of the viewpoint. There are various lighting processing methods such as the Phong lighting method, the Cook lighting method, and the Hall lighting method. First, a typical Phong lighting method will be described (the Cook lighting and the Hall lighting will be described later).

【0018】〔フォングライティング法〕フォングライ
ティング法は,現実の光景では,光源からの光が直接当
たらない所でも壁からの反射等様々な経路で光が物体に
照射されるので,光のそのような物体を取り巻く環境に
基づく成分,光源から到達した光が対象点で乱反射する
成分,光源から到達した光がつやを持った面に反射して
主に正反射方向に多く反射されてハイライトを生じる鏡
面成分等を考慮したものである。
[Phong Writing Method] In a real scene, the phong lighting method irradiates an object with various paths such as reflection from a wall even in a place where the light from the light source does not directly hit, so A component based on the environment surrounding the object, a component of the light from the light source that is diffusely reflected at the target point, and a component of the light from the light source that is reflected by the glossy surface and is mainly reflected in the specular reflection direction to highlight. This is because the generated mirror surface component and the like are taken into consideration.

【0019】点Rの波長kにおける分光反射輝度CK
次のように表す。以下の説明において,Lj ,Rj ,E
はベクトルである。 Ck =CAk+CDk+CSkAk=ka akdk ここで,CAkは,壁等の環境からの反射光(環境反射
光)に基づく分光反射輝度である。CDkは,光源から到
来する拡散光の乱反射に基づく拡散反射輝度である。C
Skは光源から到来する拡散光の点Pにおける鏡面分光反
射輝度である。
Spectral reflection luminance C K at wavelength R at point R is expressed as follows. In the following description, L j , R j , E
Is a vector. C k = C Ak + C Dk + C Sk C Ak = k a I ak C dk Here, C Ak is the spectral reflection luminance based on the reflected light (environmental reflected light) from the environment such as a wall. C Dk is diffuse reflection brightness based on diffuse reflection of diffused light coming from a light source. C
Sk is the specular spectral reflection luminance at the point P of the diffused light coming from the light source.

【0020】ka ,kd ,kS は,それぞれ点Pの物体
の属する環境反射係数,拡散反射係数,鏡面反射係数で
ある。Cdk,CSkはそれぞれ,点Pの物体の分光拡散反
射率,鏡面反射率である。mは光源数である。CLjk
j番目の光源の分光密度である。Lj は光源への方向ベ
クトル,Rj はj番目の光源から入射した光が,対象点
で反射してできる反射ベクトルである。Nは対象点の法
線ベクトル,Eは対象点から視点へ向かうベクトル,n
はフォングの係数である。Ij はj番目の光源の光度,
akは環境光の反射放射輝度である。
K a , k d and k S are the environmental reflection coefficient, the diffuse reflection coefficient and the specular reflection coefficient to which the object at the point P belongs, respectively. C dk and C Sk are the spectral diffuse reflectance and the specular reflectance of the object at the point P, respectively. m is the number of light sources. C Ljk is the spectral density of the jth light source. L j is a direction vector to the light source, and R j is a reflection vector formed by the light incident from the j-th light source being reflected at the target point. N is the normal vector of the target point, E is the vector from the target point to the viewpoint, n
Is the coefficient of Fong. I j is the luminous intensity of the j-th light source,
I ak is the reflected radiance of ambient light.

【0021】[0021]

【発明が解決しようとする課題】従来のライティング処
理は,画素毎に法線ベクトルを線型補間により求めて正
規化処理し,求められた正規化法線ベクトルNに基づい
て,上記式(1) ,(2) のベクトルの内積演算処理を行っ
ていた。そのため,従来のライティング処理は計算量が
多く,高速処理できなかった。
In the conventional lighting process, a normal vector is calculated for each pixel by linear interpolation, and the normalization process is performed. Based on the calculated normal vector N, the above equation (1) is used. , (2) Vector inner product calculation processing was performed. Therefore, the conventional lighting process has a large amount of calculation and cannot be processed at high speed.

【0022】本発明は,高速にライティング処理を行う
ことのできるグラフィック処理方法を提供することを目
的とする。
It is an object of the present invention to provide a graphic processing method capable of performing lighting processing at high speed.

【0023】[0023]

【課題を解決するための手段】本発明は,図形上の2点
の法線ベクトルの作る角度αを算出し,2点の画素(対
象点)の法線ベクトルを算出する場合,対象点の法線ベ
クトルが2点の法線ベクトルを分割する角度に基づく係
数を求め,そのベクトル和として対象点の法線ベクトル
を表すようにした。そして,輝度の算出における法線ベ
クトルと対象点の反射光等の内積計算を,求めた法線ベ
クトルの和と反射光等のベクトルにより行うようにし
た。
According to the present invention, when an angle α formed by normal vectors of two points on a figure is calculated and a normal vector of two pixels (target points) is calculated, The coefficient based on the angle at which the normal vector divides the normal vector of two points is calculated, and the normal vector of the target point is represented as the vector sum. Then, the inner product of the normal vector and the reflected light of the target point in the calculation of the brightness is calculated by the sum of the obtained normal vectors and the vector of the reflected light.

【0024】図1は本発明の基本構成を示す。図におい
て,1は多角形図形の頂点データ入力手段,2は座標算
出手段であって,頂点を結ぶ線分上の画素の座標を線型
補間により算出するとともに,スパンを求めるものであ
る。
FIG. 1 shows the basic configuration of the present invention. In the figure, reference numeral 1 is a vertex data input means for polygonal figures, and 2 is a coordinate calculation means for calculating the coordinates of pixels on a line segment connecting the vertices by linear interpolation and determining the span.

【0025】3は法線ベクトル算出手段であって,スパ
ン両端の法線ベクトルN1 ,N2 を頂点A,B,および
C,Dの法線ベクトルNA ,NB 角およびNC ,ND
大きさおよび両ベクトルの作る角度に基づいて求め,さ
らに,スパンPQ上の点Rの法線ベクトルを点P,Qの
法線ベクトルN1 ,N2 の大きさおよび両ベクトルの作
る角度により求めるものである。例えば,法線ベクトル
1 ,N2 を求める場合,法線ベクトルN1 ,N2 の作
る角度αを求める。そして,スパンPQ上の点Rの法線
ベクトルNが分割する角度(β,γ)に応じた係数a,
bを求め,対象点の法線ベクトルをN=aN1 +bN2
として算出するものである。法線ベクトルN1 ,N2
求める場合も,同様に頂点A,BおよびC,Dの法線ベ
クトルN A ,NB およびNC ,ND により同様に算出す
る。
Reference numeral 3 denotes a normal vector calculation means, which is a spa
Normal vector N at both ends1, N2To vertices A, B, and
Normal vector N of C and DA, NBCorner and NC, NDof
Based on the magnitude and the angle formed by both vectors,
In addition, the normal vector of point R on span PQ
Normal vector N1, N2The size of and both vectors
The angle is determined by the angle. For example, the normal vector
N1, N2To find the normal vector N1, N2Work of
Angle α is calculated. And the normal line of the point R on the span PQ
The coefficient a corresponding to the angle (β, γ) at which the vector N divides,
b, and obtain the normal vector of the target point as N = aN1+ BN2
Is calculated as Normal vector N1, N2To
Similarly, when obtaining, the normal vector of vertices A, B and C, D
Cuttle N A, NBAnd NC, NDIs calculated similarly by
It

【0026】4はライティング処理手段であって,ライ
ティング処理を行うものであって,ライティング処理に
必要なベクトルAj と法線ベクトルNとの内積Aj ・N
をA j ・N=aAj ・N1 +bAj ・N2 として算出す
るものである。5はa,bの係数を算出するための三角
函数テーブルである。6は作成した画像を画面表示する
表示手段である。
Reference numeral 4 is a lighting processing means,
Lighting process,
Required Vector AjInner product A of the normal vector Nj・ N
A j・ N = aAj・ N1+ BAj・ N2Calculate as
It is something. 5 is a triangle for calculating the coefficients of a and b
It is a function table. 6 displays the created image on the screen
It is a display means.

【0027】[0027]

【作用】図2により本発明の法線ベクトル算出方法につ
いて説明する。図2 (a)において,P,Qはスパン両端
の点を表す。RはスパンPQ上の点である。スパンPQ
はM個の画素により分割されているとする。N1 は点P
の法線ベクトル,N2 は点Qの法線ベクトルである。N
は点Rの法線ベクトルである。αはN1 とN2 の作る角
度である。γ,βは,γ=αt(tは分割数Mから求ま
る係数で,例えばt=n/M(nは整数)),β=α−
γにより求める。
The normal vector calculating method of the present invention will be described with reference to FIG. In Fig. 2 (a), P and Q represent the points at both ends of the span. R is a point on span PQ. Span PQ
Is divided by M pixels. N 1 is point P
, N 2 is the normal vector of the point Q. N
Is the normal vector of the point R. α is the angle formed by N 1 and N 2 . γ and β are γ = αt (t is a coefficient obtained from the division number M, for example, t = n / M (n is an integer)), β = α-
Calculated by γ.

【0028】次に,図2 (b)により法線ベクトル算出方
法を説明する。図2 (b)において,N1 ,N2 は点
P’,Q’の法線ベクトルで長さ1に正規化されている
ものである。OはN1 とN2 の交点,OP’は法線ベク
トルN1 ,OQ’は法線ベクトルN2 である。OP”は
角αを分割して求めた補間法線ベクトルNであって,点
Rの法線ベクトルである。
Next, the normal vector calculation method will be described with reference to FIG. In FIG. 2 (b), N 1 and N 2 are normal vectors of points P ′ and Q ′ and are normalized to length 1. O is the intersection of N 1 and N 2 , OP ′ is the normal vector N 1 , and OQ ′ is the normal vector N 2 . OP ″ is an interpolation normal vector N obtained by dividing the angle α and is a normal vector of the point R.

【0029】N1 ,N2 ,Nが正規化されている時,
N,N1 ,N2 の間には,次の関係がある。 N=(N1 sinγ+N2 sinβ)(sinα)-1 ・・・・・(1) ’ (この式の証明は後述する。)この関係式から,N1
2 ,α,β,γに基づいて補間法線ベクトルNを求め
ることができる。そして,γ=αtにより,tを変える
ことにより,線分AB上の各点の法線ベクトルを求める
ことができる。
When N 1 , N 2 and N are normalized,
The following relationships exist between N, N 1 and N 2 . N = (N 1 sin γ + N 2 sin β) (sin α) -1 (1) '(Proof of this formula will be described later.) From this relational expression, N 1 ,
The interpolation normal vector N can be obtained based on N 2 , α, β and γ. Then, by changing t by γ = αt, the normal vector of each point on the line segment AB can be obtained.

【0030】次に,図1の基本構成の動作を説明する。
必要に応じて図2を参照する。多角形図形の頂点データ
入力手段1は,作成画像の基本となる多角形図形の頂点
データを入力する。座標算出手段2は多角形図形の頂点
を結ぶスパンPQ等を線型補間により求める。
Next, the operation of the basic configuration of FIG. 1 will be described.
Refer to FIG. 2 as needed. The polygon figure vertex data input means 1 inputs the vertex data of the polygon figure which is the basis of the created image. The coordinate calculating means 2 obtains the span PQ or the like connecting the vertices of the polygonal figure by linear interpolation.

【0031】法線ベクトル算出手段3は,p=N1 ・N
2 ,α=cos-1pにより,N1 とN2 の作る角度を算
出する。γ(γ=αt),β(β=α−β)により,
γ,βを求める。N=aN1 +bN2 によりNを求め
る。但し,a=(sinγ)(sinα)-1,b=(s
inβ)(sinα)-1
The normal vector calculating means 3 has p = N 1 · N
2 , the angle formed by N 1 and N 2 is calculated by α = cos −1 p. By γ (γ = αt) and β (β = α-β),
Find γ and β. N is calculated by N = aN 1 + bN 2 . However, a = (sinγ) (sinα) −1 , b = (s
inβ) (sinα) −1 .

【0032】tを変えながら,上記処理を繰り返し,各
頂点を結ぶ線分上の画素の法線ベクトル,および各スパ
ン上の画素の法線ベクトルを求める。その際,a,bは
三角函数テーブル5を参照することにより求める。
While changing t, the above process is repeated to obtain the normal vector of the pixel on the line segment connecting the vertices and the normal vector of the pixel on each span. At that time, a and b are obtained by referring to the triangular function table 5.

【0033】ライティング処理手段4は,ライティング
処理に必要なベクトルAj とした時,法線ベクトルとの
内積計算Aj ・Nを,Aj ・N=aAj ・N1 +bAj
・N 2 により行う。
The lighting processing means 4 writes
Vector A required for processingjAnd the normal vector
Inner product calculation Aj・ N is Aj・ N = aAj・ N1+ BAj
・ N 2By.

【0034】フォングライティング処理の場合,上記式
(1) ,(2) (5頁参照)の内積計算をこの演算方法によ
り行う。 即ち,Lj ・N=Lj ・(aN1 +bN2 ) =aLj ・N1 +bLj ・N2 としてLj ・Nの演算処理を行う。
In the case of pong lighting processing, the above equation
The inner product calculation of (1), (2) (see page 5) is performed by this calculation method. That is, L j · N = L j · (aN 1 + bN 2 ) = aL j · N 1 + bL j · N 2 is calculated and L j · N is calculated.

【0035】Lj ・N1 とLj ・N2 は予め求められる
ので,aとbを求めればよい。cos-1p,sinβ,
sinγは三角函数テーブル5を参照することにより高
速に求めることができるのでa,bは高速に算出でき
る。
Since L j · N 1 and L j · N 2 are obtained in advance, it is sufficient to obtain a and b. cos −1 p, sin β,
Since sinγ can be calculated at high speed by referring to the triangular function table 5, a and b can be calculated at high speed.

【0036】同様に,上記式(2) における内積演算は,
反射ベクトルRj =2(Lj ・N)N−Lj であるの
で, Rj ・E=(2(Lj ・N)N−Lj )・E =2(aLj ・N+bLj ・N2 )(aN1 ・E+bN1 ・E) −Lj ・E として求めることができる。
Similarly, the inner product operation in the above equation (2) is
Since the reflection vector R j = 2 (L j · N) N−L j , R j · E = (2 (L j · N) N−L j ) · E = 2 (aL j · N + bL j · N 2 ) It can be calculated as (aN 1 · E + bN 1 · E) −L j · E.

【0037】Lj ・N1 ,Lj ・N2 ,N1 ・E,N1
・E,Lj ・Eは予め計算でき,a,bも上記のように
高速に求めることができるので,Rj ・Eの演算も高速
に処理できる。
L j · N 1 , L j · N 2 , N 1 · E, N 1
Since E and L j · E can be calculated in advance and a and b can be calculated at high speed as described above, the calculation of R j · E can also be processed at high speed.

【0038】そして,ライティング処理した結果を表示
手段6により画面表示する。図3は,本発明の法線ベク
トル算出のフローを示す。図は,係数a,bを求めるた
めのフローである(1スパンがM画素の場合)。
Then, the result of the lighting process is displayed on the screen by the display means 6. FIG. 3 shows a flow of normal vector calculation of the present invention. The figure is a flow for obtaining the coefficients a and b (when one span is M pixels).

【0039】図示の番号に従ってフローを説明する。 S1 1ステップの増分incを設定する。1スパンが
M画素であるので,増分を1/Mとする。
The flow will be described according to the numbers shown. S1 Set the increment inc of one step. Since 1 span is M pixels, the increment is 1 / M.

【0040】S2 法線ベクトルN1 とN2 の成す角度
αを算出する。 S3 αのサイン函数逆数invsa=1/sinαを
算出する。 S4 繰り返しイッデックスiに初期値0を設定する。
The angle α formed by the S2 normal vector N 1 and N 2 is calculated. The reciprocal sine function invsa = 1 / sin α of S3 α is calculated. S4 The initial value 0 is set to the iteration index i.

【0041】S5 ラベルLOOPに飛ぶ。 S6 ラベルLOOPの処理を行う。 S7 γ=α*i*incを算出する。S5: Jump to label LOOP. S6 Label LOOP processing is performed. S7 γ = α * i * inc is calculated.

【0042】S8 β=α−γによりβを算出する。 S9 a=invsa*sinγによりaを求める。 S10 b=invsa*sinβによりbを求める。Β is calculated by S8 β = α-γ. S9 a = invsa * sinγ is used to obtain a. S10 b = invsa * sin β is used to obtain b.

【0043】S11 ライティング処理に必要なベクト
ルAj とNとの内積計算をa*Aj*N1 +b*Aj
2 により求める。 S12 i=i+1としてiを1インクリメントする。
S11 The inner product calculation of the vectors A j and N required for the lighting processing is a * A j * N 1 + b * A j *
Calculated by N 2 . S12 i = i + 1 is set and i is incremented by 1.

【0044】S13 もし,i<Mなら,LOOPの処
理を繰り返す。そうでなければ処理を終了する。 〔上記式(1) ’の証明〕(図(2) , (b)を参照する)。
S13 If i <M, the LOOP process is repeated. Otherwise, the process ends. [Proof of Equation (1) 'above] (see Figures (2) and (b)).

【0045】ベクトルNは,ベクトルN1 とN2 により
次のように表すことができる。 N=aN1 +bN2 (a,bは実数)・・・・・・(1) ” NとN1 の内積を取ると, N・N1 =(aN1 +bN2 )・N1 =a|N1 2 +bN1 ・N2 ・・・・・・・(2) ” N・N1 =|N||N1 |cosβ,|N1 2 =1,N1 ・N2 =|N1 | ・|N2 |cosαより cosβ=a+bcosα ・・・・・・・(3) 同様に,NとN2 の内積を取って, N・N2 =(aN1 +bN2 )・N1 =aN1 ・N2 +b|N2 2 ・・・・・・・(4) cosγ=acosα+b ・・・・・・・(5) となる。
The vector N can be represented by the vectors N 1 and N 2 as follows. N = aN 1 + bN 2 (a and b are real numbers) ··· (1) ″ Taking the inner product of N and N 1 , N · N 1 = (aN 1 + bN 2 ) · N 1 = a | N 1 | 2 + bN 1 · N 2 ··· (2) ”N · N 1 = | N | | N 1 | cosβ, | N 1 | 2 = 1, N 1 · N 2 = | N 1 | · | N 2 | cos α = cos β = a + b cos α (3) Similarly, the inner product of N and N 2 is taken, and N · N 2 = (aN 1 + bN 2 ) · N 1 = aN 1 · N 2 + b | N 2 | 2 (4) cosγ = acosα + b (5)

【0046】(5) にcosαを掛けて(3) から引くと, cosβ−cosαcosγ=a(1−cos2 α)・・・・(6) 一方,cosβ=cos(α−β),(1−cos2 α)=sin2 αから , sinαsinγ=asin2 α ・・・・・・・・(7) 故に,a=sinγ/sinα ・・・・・・・・(8) 同様に, b=sinβ/sinα ・・・・・・・・(9) 以上から, N=(N1 sinγ+N2 sinβ)(sinα)-1 (証明終わり)。[0046] When the draw from (5) in over a cosα (3), cosβ-cosαcosγ = a (1-cos 2 α) On the other hand ···· (6), cosβ = cos (α-β), (1 -Cos 2 α) = sin 2 α, then sin α sin γ = asin 2 α (7) Therefore, a = sin γ / sin α (8) Similarly, b = sinβ / sinα (9) From the above, N = (N 1 sinγ + N 2 sinβ) (sinα) -1 (end of proof).

【0047】[0047]

【実施例】本発明のライティング処理におけるクックラ
イティング法,ホールライティング法について説明す
る。
EXAMPLE A cook writing method and a hole writing method in the writing processing of the present invention will be described.

【0048】〔クックライティング法〕クックライティ
ング法は,対象点の波長kに対する分光反射輝度Ck
次の計算式により求めるものである。
[Cookwriting Method] The Cookwriting method obtains the spectral reflection luminance C k for the wavelength k of the target point by the following calculation formula.

【0049】 k ,CAk,CSk,ka ,Iak,Cdk,Ij ,はフォン
グライティング法の場合と同じである。
[0049] C k, C Ak, C Sk , k a, I ak, C dk, I j, are the same as in the Phong lighting method.

【0050】次に,鏡面反射による分光輝度CSkを以下
の手順により算出する。対象とする点のベクトルNと,
その端点からの視点へのベクトルとの内積を取って,そ
の値が正なら「表の状態」,負なら「裏の状態」と呼ぶ
ことにする(図4ライティング法説明図(1) (b), (c)
参照)。以下の説明において,Hj はベクトルである。
Next, the spectral brightness C Sk due to specular reflection is calculated by the following procedure. A vector N of points of interest,
The inner product with the vector from the end point to the viewpoint is taken, and if the value is positive, it will be called the "front state", and if it is negative, it will be called the "back state" (Fig. 4 Illustration of lighting method (1) (b) ), (C)
reference). In the following description, H j is a vector.

【0051】(1) j番目の光源方向から入射した光を
視線方向へ反射させる微小面積の単位ベクトルHj を求
める。各光源に対してベクトルEとLj との和のベクト
ルを求め,正規化する(図4ライティング法説明図(1)
(a)参照)。
(1) The unit vector H j of a minute area that reflects the light incident from the j-th light source direction in the line-of-sight direction is obtained. For each light source, the vector of the sum of the vectors E and L j is calculated and normalized (Fig. 4 Lighting method explanatory diagram (1)
(See (a)).

【0052】Hj =(Lj +E)/|Lj +E| (2) フレネル反射係数Rfjkを次式で計算する。 Rfjk=(1/2){(g−c)2 /(g+c)2
{1+(c(g+c)−1)2 /(c(g−c)+1)
2 } c=cosθ=Lj ・Hj =E・Hj2 =nk 2 +c2 −1 nk =(1+RK 1/2 )/(1−RK 1/2 ) =(1−RK 1/2 )/(1+RK 1/2 ) g2 <0なら光が全反射するため,Rfjk=1とする。
H j = (L j + E) / | L j + E | (2) Fresnel reflection coefficient Rf jk is calculated by the following equation. Rf jk = (1/2) {(g-c) 2 / (g + c) 2 }
{1+ (c (g + c) -1) 2 / (c (g-c) +1)
2 } c = cos θ = L j · H j = E · H j g 2 = n k 2 + c 2 −1 n k = (1 + R K 1/2 ) / (1-R K 1/2 ) = (1- If R K 1/2 ) / (1 + R K 1/2 ) g 2 <0, light is totally reflected, so Rf jk = 1.

【0053】nk は波長kでの屈折率,RK 波長kでの
鏡面反射率 (3) 反射光に対する微小面傾斜分布函数Dsを計算す
る。 光源jの光が視線方向へ反射する割合を微小傾斜分布函
数Dsj より次式で求める。
N k is the refractive index at the wavelength k, and R K is the specular reflectance at the wavelength k. (3) The minute surface inclination distribution function Ds for the reflected light is calculated. The rate at which the light from the light source j is reflected in the line-of-sight direction is calculated from the minute gradient distribution function Ds j by the following equation.

【0054】Dsj =Σwk j (mk ) Dj (mk )=(1/m2 cos2 δj )e(−tan
δj 2 /mk 2 ) wk は各微小面傾斜函数に掛ける比重である(但し,Σ
k =1)。mk は微小面の傾斜のrms平均値(2乗
和の平方根)である。δj は法線ベクトルNと2等分ベ
クトルHj との間の角度である。
Ds j = Σw k D j (m k ) D j (m k ) = (1 / m 2 cos 2 δ j ) e (-tan
δ j 2 / m k 2 ) w k is the specific gravity by which each small plane tilt function is multiplied (where Σ
w k = 1). m k is the rms average value (square root of the sum of squares) of the inclination of the minute surface. δ j is the angle between the normal vector N and the bisection vector H j .

【0055】(4) 幾何減衰係数Gを求める。 G=min(1,Gm,Gs)(1,G,Gsのうちの
最小値を選択する)。 Gm=2(N・Hj )(N・Lj )/(E・Hj ) =2(N・Hj )(N・Lj )/(Lj ・Hj ) Gs=2(N・Hj )(N・E) /(E・Hj ) =2(N・Hj )(N・E) /(Lj ・Hj ) (5) 鏡面双方向反射率Rsjkを計算する。
(4) Obtain the geometric damping coefficient G. G = min (1, Gm, Gs) (select the minimum value of 1, G, Gs). Gm = 2 (N * Hj ) (N * Lj ) / (E * Hj ) = 2 (N * Hj ) (N * Lj ) / ( Lj * Hj ) Gs = 2 (N *) H j ) (N · E) / (E · H j ) = 2 (N · H j ) (N · E) / (L j · H j ) (5) The specular bidirectional reflectance Rs jk is calculated.

【0056】 Rsjk=RfjkDsj G/π(N・Lj )(N・E) =0 (N・Lj =0) (6) 鏡面反射による放射輝度CSkを計算する。Rs jk = Rf jk Ds j G / π (N · L j ) (N · E) = 0 (N · L j = 0) (6) Calculate the radiance C Sk due to specular reflection.

【0057】 S は鏡面反射係数,mは光源の個数 本発明により,クックライティング法の輝度を算出する
場合,法線ベクトルNとの内積の演算(Lj ・N,N・
j ,N・E)を前述のアルゴリズムに従って計算す
る。
[0057] k S is a specular reflection coefficient, m is the number of light sources According to the present invention, when calculating the luminance of the Cookwriting method, the inner product with the normal vector N is calculated (L j · N, N ·
H j , N · E) is calculated according to the algorithm described above.

【0058】次に,ホールライティング法について説明
する。 〔ホールライティング法〕ホールライティング法は以下
の手順により分光反射輝度を算出するものである。
Next, the hole lighting method will be described. [Hole Writing Method] The hole writing method is to calculate the spectral reflection luminance by the following procedure.

【0059】 k ,CAk,CSk,ka ,Iak,Cdk,Ij はフォング
ライティング法の場合と同じである。
[0059] C k, C Ak, C Sk , k a, I ak, C dk, I j is the same as that of Phong lighting method.

【0060】対象とする点のベクトルNと,その端点か
ら視点へのベクトルとの内積を取って,その値が正なら
「表の状態」,負なら「裏の状態」と呼ぶことにする
(図4ライティング法説明図(1) (b), (c)参照)。
The inner product of the vector N of the target point and the vector from the end point to the viewpoint is taken, and if the value is positive, it is called "front state", and if it is negative, it is called "back state" ( Fig. 4 Illustration of lighting method (1) (b), (c)).

【0061】(1) j番目の光源方向から入射した光を
視線方向へ反射させる微小面積の単位ベクトルHj を求
める。各光源に対してベクトルEとLj との和のベクト
ルを求め,正規化する。
(1) The unit vector H j of a minute area that reflects the light incident from the j-th light source direction in the line-of-sight direction is obtained. The vector of the sum of the vectors E and L j is obtained for each light source and normalized.

【0062】Hj =(Lj +E)/|Lj +E| (2) フレネル反射係数Rfjkを計算する。 Rfjk=(1/2){(g−c)2 /(g+c)2
{1+(c(g+c)−1)2 /(c(g+c)+1)
2 } c=cosθ=Lj ・Hj =E・Hj2 =nk 2 +c2 −1 nk =(1+RK 1/2 )/(1−RK 1/2 ) (表の状
態) =(1−RK 1/2 )/(1+RK 1/2 ) (裏の状態) g2 <0なら光が全反射するため,Rfjk=1とする。
H j = (L j + E) / | L j + E | (2) The Fresnel reflection coefficient Rf jk is calculated. Rf jk = (1/2) {(g-c) 2 / (g + c) 2 }
{1+ (c (g + c) -1) 2 / (c (g + c) +1)
2 } c = cos θ = L j · H j = E · H j g 2 = n k 2 + c 2 −1 n k = (1 + R K 1/2 ) / (1-R K 1/2 ) (state in table ) = (1−R K 1/2 ) / (1 + R K 1/2 ) (state on the back) If g 2 <0, light is totally reflected, so Rf jk = 1.

【0063】nk は波長kでの屈折率,RK 波長kでの
分光鏡面反射率 (3) 反射光に対する微小面傾斜分布函数Dsを計算す
る。 光源jの光が視線方向へ反射する割合を微小傾斜分布函
数Dsj より次式で求める。
N k is the refractive index at the wavelength k, and R K is the specular specular reflectance at the wavelength k. (3) The minute surface inclination distribution function Ds for the reflected light is calculated. The rate at which the light from the light source j is reflected in the line-of-sight direction is calculated from the minute gradient distribution function Ds j by the following equation.

【0064】Dsj =(N・Hj m mは物体の光沢を表す指数(フォングの指数に同じ)で
ある。 Rsjk=RfjkDsj /(N・Lj ) (N・Lj ≠0
の場合) Rsjk=0 (N・Lj =0
の場合) (5) 鏡面反射による分光輝度CSkを計算する。
Ds j = (N · H j ) m m is an index (same as the Fong index) representing the gloss of an object. Rs jk = Rf jk Ds j / (N · L j ) (N · L j ≠ 0
In the case of) Rs jk = 0 (N · L j = 0
(5) Calculate the spectral luminance C Sk due to specular reflection.

【0065】 S は鏡面反射係数である。[0065] k S is the specular reflection coefficient.

【0066】(6) 光源の透過光による分光輝度CTk
計算する。 N・Lj ≧0の場合には,j番目の光源からの透過
光による分光輝度CTkは0とする。
(6) The spectral brightness C Tk due to the transmitted light from the light source is calculated. When N · L j ≧ 0, the spectral luminance C Tk due to the transmitted light from the j-th light source is set to 0.

【0067】 光源方向から入射した光を視線方向へ
屈折させる微小面の単位法線ベクトルHj ’を求める
(図5ライティング法説明図(2) (a), (b)参照)。 スネルの法則により,各光源に対してベクトルH’を以
下の式により求め,正規化する(図5参照)。
A unit normal vector H j ′ of a minute surface that refracts light incident from the light source direction in the line-of-sight direction is obtained (see FIG. 5, lighting method explanatory diagrams (2) (a), (b)). According to Snell's law, a vector H ′ is obtained for each light source by the following formula and normalized (see FIG. 5).

【0068】 Hj ’=Lj +(1/η)E (表の状態の場合) Hj ’=−Lj −ηE (裏の状態の場合) ηは物体の屈折率 フレネルの公式による光源jに対する波長λの透過
率Tfjkは,以下の式により求める。
H j ′ = L j + (1 / η) E (in the case of the front state) H j ′ = −L j −ηE (in the case of the back state) η is the refractive index of the object Light source according to Fresnel's formula The transmittance Tf jk of the wavelength λ with respect to j is calculated by the following formula.

【0069】Tfjk=1−Rfjk =1−(1/2){(g−c)2 /(g+c)2 }{1
+(c(g+c)−1)2 /(c(g+c)+1)2 } c=Lj ・Hj ’ g2 =nk 2 +c2 −1 nk =(1−RK 1/2 )/(1+RK 1/2 ) (表の状
態) =(1+RK 1/2 )/(1−RK 1/2 ) (裏の状態) g2 <0なら光が全反射するため,Tfjk=1とする。
Tf jk = 1-Rf jk = 1- (1/2) {(g-c) 2 / (g + c) 2 } {1
+ (C (g + c) -1) 2 / (c (g + c) +1) 2} c = L j · H j 'g 2 = n k 2 + c 2 -1 n k = (1-R K 1/2) / (1 + R K 1/2 ) (state in the table) = (1 + R K 1/2 ) / (1-R K 1/2 ) (state in the back) If g 2 <0, light is totally reflected, so Tf jk = 1.

【0070】nk =1ならg=cよりTfjk=1とな
る。 nk は波長kでの屈折率,RK 波長kでの鏡面反射率 透過光に対する微小面傾斜分布函数Dtj を算出す
る。
If n k = 1 then Tf jk = 1 since g = c. n k is the refractive index at the wavelength k, and R K is the specular reflectance at the wavelength k. The minute surface inclination distribution function Dt j for the transmitted light is calculated.

【0071】 Dtj =(−N・Hj ’)m (η≠1) =1 (η=1,Lj +E)=0) =0 (η=1,Lj +E)≠0) 光源jに対する波長λの双方向透過率Tjkを次のよ
うに計算する。
Dt j = (− N · H j ') m (η ≠ 1) = 1 (η = 1, L j + E) = 0) = 0 (η = 1, L j + E) ≠ 0) Light source j Calculate the bidirectional transmittance T jk of the wavelength λ with respect to

【0072】Tjk=TfjkDtj /(−N・Lj ) 透過による分光輝度CTkを計算する。 t は透過係数である。T jk = Tf jk Dt j / (-N · L j ) Spectral luminance C Tk due to transmission is calculated. k t is a transmission coefficient.

【0073】このホールライティング法による場合もフ
ォングライティング法による場合と同様に,法線ベクト
ルNとの内積計算(Lj ・N,N・Hj ,N・Hj
等)に本発明のアルゴリズムを適用できる。
Also in the case of this hole writing method, as in the case of the fong writing method, the inner product calculation (L j · N, N · H j , N · H j 'with the normal vector N is performed.
Etc.) can apply the algorithm of the present invention.

【0074】図6は本発明の実施例(1) を示す図であ
る。図において,30はセグメントバッファであって,
多角形図形の頂点データを持つものである。31はセグ
メント管理部であって,セングメントバッファ30から
多角図形のデータを一枚ずつ取り出すものである。32
は座標変換部であって,ユーザの指定により多角形の移
動,回転等を行うものである。33はクリッピング部で
あって,視野に入らない部分をカットするものである。
FIG. 6 is a diagram showing an embodiment (1) of the present invention. In the figure, 30 is a segment buffer,
It has the vertex data of a polygonal figure. Reference numeral 31 is a segment management unit, which takes out polygon data from the segment buffer 30 one by one. 32
Is a coordinate conversion unit, which moves or rotates a polygon according to user's designation. Reference numeral 33 denotes a clipping portion, which cuts a portion that does not enter the visual field.

【0075】34は面塗り部であって,線型補間により
スパン端点の座標を求めるとともに法線ベクトルを算出
するものである。35は本発明の法線ベクトル算出手段
であって,角度分割により法線ベクトルを算出するもの
である。
Reference numeral 34 denotes a surface painting portion, which is used to obtain the coordinates of the span end points by linear interpolation and to calculate the normal vector. Reference numeral 35 denotes a normal vector calculating means of the present invention, which calculates a normal vector by angle division.

【0076】36はスパン処理部であって,面塗り部3
4で求めたスパン上の各画素のZ値,属性等をDDAに
より線型補間して求めるとともに,スパン端点の法線ベ
クトルに基づいて,本発明の法線ベクトル算出方法によ
りスパン上の画素の法線ベクトルを算出するものであ
る。37は法線ベクトル算出手段であって,本発明の角
度分割により法線ベクトルを算出するものである。
Reference numeral 36 denotes a span processing section, which is a surface coating section 3
The Z value, the attribute, etc. of each pixel on the span obtained in 4 are linearly interpolated by DDA, and based on the normal vector of the span end point, the method of calculating the normal vector of the present invention is used to calculate the pixel on the span. The line vector is calculated. Reference numeral 37 is a normal vector calculating means for calculating a normal vector by the angle division of the present invention.

【0077】38は隠面消去部てあって,Z値に基づい
て,視点の方向からは隠れて見えない部分を消去すると
ともに,現画素が旧画素より視点に近い場合にはZバッ
ファ39のZ値の書き換えを行うものである。39はZ
バッファであって,各画素のZ値を格納するものであ
る。40はライティング処理部であって,フォングライ
ティング法,クックライティング法,ホールライティン
グ法等でライティング処理を行うものである。その際,
法線ベクトルとの内積計算は本発明の方法によりなされ
るものである。41はフレームバッファであって,1画
面分の面表示データを格納するものである。42はCR
Tであって,フレームバッファ41のデータを画像表示
するものである。
Reference numeral 38 denotes a hidden surface erasing section which erases a portion which is hidden and invisible from the direction of the viewpoint based on the Z value, and when the current pixel is closer to the viewpoint than the old pixel, the Z buffer 39 The Z value is rewritten. 39 is Z
The buffer stores the Z value of each pixel. Reference numeral 40 denotes a lighting processing unit, which performs lighting processing by the Phong lighting method, Cook lighting method, hole lighting method, or the like. that time,
The inner product calculation with the normal vector is performed by the method of the present invention. Reference numeral 41 is a frame buffer for storing the surface display data for one screen. 42 is CR
T is for displaying the data of the frame buffer 41 as an image.

【0078】図の構成の動作を説明する。セグメントバ
ッファ30は多角形図形の頂点データを保持する。セグ
メント管理部31はセグメントバッファ30から,描画
図形の基本となる多角形図形を入力する。座標変換部3
2はユーザが指定する多角形図形の回転,移動等に基づ
く座標変換を行う。クリッピング部33は視野に入らな
い部分をクリップする。
The operation of the configuration shown in the figure will be described. The segment buffer 30 holds vertex data of polygonal figures. The segment management unit 31 inputs from the segment buffer 30 a polygonal figure which is the basis of a drawing figure. Coordinate conversion unit 3
2 performs coordinate conversion based on rotation, movement, etc. of a polygonal figure specified by the user. The clipping unit 33 clips a portion that does not enter the visual field.

【0079】面塗り部34は頂点データを結ぶ線分をス
パンにより分割する。その際,スパン両端の法線ベクト
ルを,頂点NA とNB の法線ベクトルに対して,N1
aN A +aNB により算出する。
The surface painting section 34 draws line segments connecting the vertex data.
Divide by bread. At that time, the normal vector at both ends of the span
The vertex NAAnd NBN for the normal vector of1=
aN A+ ANBCalculate by

【0080】スパン処理部36は,各スパン両端点の座
標に基づいて画素に展開する。スパン量端点の座標をN
1 ,N2 とした時,スパン上の画素の法線ベクトルをN
=aN1 +bN2 により算出する。
The span processing unit 36 develops the pixels on the basis of the coordinates of both end points of each span. Set the coordinates of the end point of the span amount to N
When 1 and N 2 , the normal vector of the pixel on the span is N
= AN 1 + bN 2

【0081】隠面消去部38は画素の現Z値と旧Z値を
比較し,現Z値が旧Z値より小さければ現画素を表示す
るようにし,Zバッファの値を更新する。ライティング
処理部40は,フォングライティング法,クックライテ
ィング法,ホールライティング法によりライティング処
理を行う。ライティング処理に必要なベクトルをAj
すると,法線ベクトルとの内積処理をaAj ・N1 +b
2 *N2 により行う。1画面の画像データがフレーム
バッファ41に転送され,CRT42に表示される。
The hidden surface elimination unit 38 calculates the current Z value and the old Z value of the pixel.
If the current Z value is smaller than the old Z value, the current pixel is displayed.
The value of the Z buffer is updated. lighting
The processing unit 40 uses the Phong writing method, the Cook Lite method.
Lighting by the lighting method and the hole lighting method
Do the work. A required vector for lighting processingjWhen
Then, the inner product processing with the normal vector is aAj・ N1+ B
N 2* N2By. Image data of one screen is a frame
It is transferred to the buffer 41 and displayed on the CRT 42.

【0082】図7は本発明の実施例(2) を示す。図は,
アニメーション画像を自動生成する場合のグラフィック
処理装置の構成を示す。
FIG. 7 shows an embodiment (2) of the present invention. The figure is
1 shows a configuration of a graphic processing device when automatically generating an animation image.

【0083】図において,50はセグメントバッファ,
51はセグメント管理部,52は座標変換部,53はク
リッピング,54は面塗り部であって,各スパン上の各
画素のZ値等を線型補間により算出し,本発明の角度分
割の方法により法線ベクトルを算出するものである。5
6はスパン処理部であって,スパン上の画素の座標値を
求め,各画素のZ値,属性値等を線型補間により算出す
るとともに,本発明の角度分割の方法により法線ベクト
ルを算出するものである。58は隠面消去部,59はZ
バッファ,60はライティング処理部であって,フォン
グライティング法,クックライティング法,ホールライ
ティング法によりライティング処理を行うものである。
ライティングに必要なベクトルをAj とすると,法線ベ
クトルとAj との内積計算をaAj ・N1 +bAj ・N
2 により算出する。61はフレームバッファ,62はC
RTである。
In the figure, 50 is a segment buffer,
Reference numeral 51 is a segment management unit, 52 is a coordinate conversion unit, 53 is a clipping unit, and 54 is a surface painting unit. The Z value of each pixel on each span is calculated by linear interpolation, and the angle division method of the present invention is used. The normal vector is calculated. 5
Reference numeral 6 denotes a span processing unit, which calculates coordinate values of pixels on the span, calculates Z values, attribute values, etc. of each pixel by linear interpolation, and calculates a normal vector by the angle division method of the present invention. It is a thing. 58 is a hidden surface erasing section, 59 is Z
A buffer, 60 is a lighting processing unit, which performs lighting processing by the Phong lighting method, the Cook lighting method, and the hole lighting method.
When the vector required lighting and A j, aA an inner product calculation of the normal vector and A j j · N 1 + bA j · N
Calculated according to 2 . 61 is a frame buffer, 62 is C
It is RT.

【0084】以上の構成は図6におけるものと同様であ
る。64は全体制御部であって,装置各部に指令を出す
ものである。65は制御データ部であって,画像生成に
おける画像移動等を制御するデータを格納するものであ
る。63は画像記録部であって,フレームバッファ61
の内容を記録するものである。
The above construction is similar to that shown in FIG. Reference numeral 64 denotes an overall control unit, which issues a command to each unit of the device. A control data unit 65 stores data for controlling image movement and the like in image generation. 63 is an image recording unit, which is a frame buffer 61
The content of is recorded.

【0085】図の構成の動作を説明する。制御データ部
65には,予めいつどこからどこまで描画図形を移動さ
せるかなどの情報を格納しておく。全体制御部64は制
御データに基づいてセグメント管理部51に指示し,指
定した描画対象物のデータを取り出すように指示すると
ともに,座標変換部52にも移動,回転等を指示する。
1枚の画像が生成し終わると,フレームバッファ61か
ら画像の生成が終了した旨の通知が全体制御部64に送
出され,全体制御部64は画像記録部63にフレームバ
ッファ61の内容を記録するように指示する。画像記録
部63はフレームバッファの内容を記録する。
The operation of the configuration shown in the figure will be described. The control data section 65 stores in advance information such as when and where to move the drawing figure. Based on the control data, the overall control unit 64 instructs the segment management unit 51 to take out the data of the designated drawing object, and also instructs the coordinate conversion unit 52 to move, rotate, etc.
When the generation of one image is completed, the frame buffer 61 sends a notification that the generation of the image is completed to the overall control unit 64, and the overall control unit 64 records the contents of the frame buffer 61 in the image recording unit 63. To instruct. The image recording unit 63 records the contents of the frame buffer.

【0086】[0086]

【発明の効果】本発明によれば,3次元コンピュータグ
ラフィックスにおいてライティング処理を高速に行うこ
とができる。そのため,短時間で多くの画像を生成で
き,静止画像およびアニメーション等の動画像を効率的
に生成することができる。
According to the present invention, the writing process can be performed at high speed in three-dimensional computer graphics. Therefore, many images can be generated in a short time, and moving images such as still images and animations can be efficiently generated.

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

【図1】本発明の基本構成を示す図である。FIG. 1 is a diagram showing a basic configuration of the present invention.

【図2】本発明の法線ベクトル算出方法の説明図であ
る。
FIG. 2 is an explanatory diagram of a normal vector calculation method of the present invention.

【図3】本発明の法線ベクトル算出のフローを示す図で
ある。
FIG. 3 is a diagram showing a flow of normal vector calculation of the present invention.

【図4】本発明のライティング法の説明図(1) である。FIG. 4 is an explanatory diagram (1) of the lighting method of the present invention.

【図5】本発明のライティング法の説明図(2) である。FIG. 5 is an explanatory diagram (2) of the lighting method of the present invention.

【図6】本発明の実施例(1) を示す図である。FIG. 6 is a diagram showing an embodiment (1) of the present invention.

【図7】本発明の実施例(2) を示す図である。FIG. 7 is a diagram showing an embodiment (2) of the present invention.

【図8】従来のコンピュータグラフィック装置を示す図
である。
FIG. 8 is a diagram showing a conventional computer graphic device.

【図9】法線ベクトル算出方法の説明図である。FIG. 9 is an explanatory diagram of a normal vector calculation method.

【図10】従来のグラフィック処理方法を示す図であ
る。
FIG. 10 is a diagram showing a conventional graphic processing method.

【符号の説明】[Explanation of symbols]

1 :多角形図形の頂点データ入力手段 2 :座標算出手段 3 :法線ベクトル算出手段 4 :ライティング処理手段 5 :三角函数テーブル 6 :表示手段 1: vertex data input means for polygonal figure 2: coordinate calculation means 3: normal vector calculation means 4: lighting processing means 5: trigonometric function table 6: display means

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 多角形図形の頂点データに基づいてグラ
フィック処理を行い画像表示するコンピュータグラフィ
ックスにおけるライティング処理方法において,図形上
の2点の座標と正規化法線ベクトルを含む図形データに
基づいて,該2点間を補間する点の座標を求める座標算
出手段(2) と,該補間した点の法線ベクトルを求める法
線ベクトル算出手段(3) と,ライティング処理手段(4)
を備え,法線ベクトル算出手段(3) は,該2点の法線ベ
クトルの作る角度を算出するとともに該2点の分割数に
基づいて該角を分割し,該2点の法線ベクトルと該分割
角度に基づいて補間した点の正規化法線ベクトルを算出
し,該正規化法線ベクトルとライティング処理に必要な
ベクトルとによりライティング処理を行うことを特徴と
するコンピュータグラフィックスにおけるライティング
処理方法。
1. A lighting processing method in computer graphics for performing graphic processing based on vertex data of a polygonal figure to display an image, based on figure data including coordinates of two points on the figure and a normalized normal vector. , Coordinate calculation means (2) for obtaining coordinates of a point for interpolating between the two points, normal vector calculation means (3) for obtaining a normal vector of the interpolated point, and lighting processing means (4)
The normal vector calculation means (3) calculates an angle formed by the normal vectors of the two points, divides the angle based on the number of divisions of the two points, and calculates a normal vector of the two points. A lighting processing method in computer graphics, characterized in that a normalized normal vector of points interpolated based on the division angle is calculated, and lighting processing is performed by the normalized normal vector and a vector required for lighting processing. .
【請求項2】 請求項1において,法線ベクトル算出手
段(3) は,2点の法線ベクトル(N1 ,N2 )の作る角
度αを求め,補間する法線ベクトル(N)と法線ベクト
ル(N1 )の作る角度をβ,法線ベクトル(N)と法線
ベクトル(N 2 )の作る角度をγとしたとき,N=(N
1 sinγ+N2 sinβ)(sinα)-1により法線
ベクトルを算出することを特徴とするコンピュータグラ
フィックスにおけるライティング処理方法。
2. The normal vector calculator according to claim 1,
Step (3) is a two-point normal vector (N1, N2) 'S angle
Normal vector (N) and normal vector for finding and interpolating degree α
Le (N1) Makes an angle β, the normal vector (N) and normal
Vector (N 2), The angle created by
1sinγ + N2sinβ) (sinα)-1Due to normal
A computer graph characterized by calculating vectors
Lighting processing method in Fix.
【請求項3】 請求項1もしくは2において,ライティ
ング処理はフォングライティング処理法もしくはクック
ライティング処理法もしくはホールライティング処理法
であることを特徴とするコンピュータグラフィックスに
おけるライティング処理方法。
3. The lighting processing method in computer graphics according to claim 1 or 2, wherein the lighting processing is a pong writing processing method, a cook lighting processing method, or a hole lighting processing method.
【請求項4】 請求項1,2および3において,三角函
数と逆三角函数の三角函数テーブル(5) を備え,テーブ
ルを参照することにより三角函数値および逆三角函数値
を求め,法線ベクトルの算出およびライティング処理に
おける演算を行うことを特徴とするコンピュータグラフ
ィックスにおけるライティング処理方法。
4. A trigonometric function table (5) of trigonometric functions and inverse trigonometric functions according to claim 1, 2, and 3, wherein the trigonometric function value and the inverse trigonometric function value are obtained by referring to the table, and a normal vector is obtained. And a lighting processing method in computer graphics, which comprises:
JP18236492A 1992-07-09 1992-07-09 Writing processing method in computer graphics Withdrawn JPH0628492A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18236492A JPH0628492A (en) 1992-07-09 1992-07-09 Writing processing method in computer graphics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18236492A JPH0628492A (en) 1992-07-09 1992-07-09 Writing processing method in computer graphics

Publications (1)

Publication Number Publication Date
JPH0628492A true JPH0628492A (en) 1994-02-04

Family

ID=16117025

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18236492A Withdrawn JPH0628492A (en) 1992-07-09 1992-07-09 Writing processing method in computer graphics

Country Status (1)

Country Link
JP (1) JPH0628492A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004079663A1 (en) * 2003-03-06 2004-09-16 Digital Media Professionals Inc. Light reflection intensity calculation circuit
US7609265B2 (en) 2002-03-21 2009-10-27 Microsoft Corporation Graphics image rendering with radiance self-transfer for low-frequency lighting environments

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7609265B2 (en) 2002-03-21 2009-10-27 Microsoft Corporation Graphics image rendering with radiance self-transfer for low-frequency lighting environments
WO2004079663A1 (en) * 2003-03-06 2004-09-16 Digital Media Professionals Inc. Light reflection intensity calculation circuit
US7616802B2 (en) 2003-03-06 2009-11-10 Digital Media Professionals, Inc. Light reflection intensity calculation circuit

Similar Documents

Publication Publication Date Title
JP3095751B2 (en) Method to obtain radiation image
JP3184327B2 (en) Three-dimensional graphics processing method and apparatus
US7786993B2 (en) Environment mapping
CN111723902A (en) Dynamically estimating lighting parameters for a location in an augmented reality scene using a neural network
US5673377A (en) Method and system for displaying a representation of a three-dimensional object with surface features that conform to the surface of the three-dimensional object
JP5299173B2 (en) Image processing apparatus, image processing method, and program
US20070139408A1 (en) Reflective image objects
JPH0757117A (en) Forming method of index to texture map and computer control display system
JP2002236938A (en) Surface shading method using texture map stored on the basis of bidirectional reflection distribution function
US6384824B1 (en) Method, system and computer program product for multi-pass bump-mapping into an environment map
JPH0683979A (en) Method and system for displaying computer graphic accompaned by formation of shadow
Cosco et al. Augmented touch without visual obtrusion
US20050046645A1 (en) Autoscaling
JP3012828B2 (en) Drawing method, apparatus, and recording medium
JP2692783B2 (en) System and method for generating a two-dimensional representation of a three-dimensional object
JP2003115055A (en) Image generator
JPH0628492A (en) Writing processing method in computer graphics
JP2003168130A (en) System for previewing photorealistic rendering of synthetic scene in real-time
KR100295709B1 (en) Spotlight characteristic forming method and image processor using the same
JP3261832B2 (en) Image generation device
CN117437345B (en) Method and system for realizing rendering texture specular reflection effect based on three-dimensional engine
JP4219090B2 (en) Method, system, and computer program product for providing lighting in computer graphics shading and animation
JP2000057372A (en) Image processor, image processing method and storage medium
JPH06111028A (en) Image generating device
Guevarra et al. Blending with Blender: Getting Started

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19991005