JPH1083180A - Device and method for displaying graphics - Google Patents

Device and method for displaying graphics

Info

Publication number
JPH1083180A
JPH1083180A JP8236164A JP23616496A JPH1083180A JP H1083180 A JPH1083180 A JP H1083180A JP 8236164 A JP8236164 A JP 8236164A JP 23616496 A JP23616496 A JP 23616496A JP H1083180 A JPH1083180 A JP H1083180A
Authority
JP
Japan
Prior art keywords
qiimage
image
source image
data
color
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
JP8236164A
Other languages
Japanese (ja)
Inventor
Ichiro Iimura
伊智郎 飯村
Kazuyoshi Koga
和義 古賀
Katsura Abe
桂 阿部
Jun Sato
潤 佐藤
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP8236164A priority Critical patent/JPH1083180A/en
Publication of JPH1083180A publication Critical patent/JPH1083180A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Controls And Circuits For Display Device (AREA)
  • Image Generation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To make possible rapidly processing in high quality a display having texture mapping with less hardware material amounts by providing a means selecting a source image with an index added to a figure and the means storing plural source images with different luminance. SOLUTION: A CPU part 1100 forms a command according to processing procedure of information of the figure to be displayed to store it in a command buffer 2200 in a memory part 2000. At this time, the CPU 1100 selects from plural source images with different luminance awaited in a source image buffer 2300 in the memory part 2000 by using a result of luminance calculation. By such a processing, a bright source image is stuck to a bright figure, and a dark source image is stuck to a dark figure. A graphics processor part 1200 accesses the command formed by the CPU part 1100, and plots the figure to a frame buffer 2400 in the memory part 2000 according to the command.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、3次元図形を表示
する3次元グラフィックス表示技術に係わり、特に、3
次元表示効果を高めるために絵柄や模様を3次元図形に
貼るということを、少ないハードウェア物量で高速かつ
高品質に処理する3次元グラフィックス表示装置及び方
法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a three-dimensional graphics display technique for displaying a three-dimensional figure, and more particularly to a three-dimensional graphics display technique.
The present invention relates to a three-dimensional graphics display device and method for processing a high-speed and high-quality process of attaching a picture or pattern to a three-dimensional figure in order to enhance a three-dimensional display effect with a small amount of hardware.

【0002】[0002]

【従来の技術】3次元グラフィックスの表示を行う場
合、写実性の高い表示を行うことが要求される。この写
実性を高める方法として、3次元図形に絵柄や模様を張
り付ける方法がある。ここで、張り付ける絵柄や模様の
ことをテクスチャ(ソース画像ともいう)といい、2次
元テクスチャを3次元図形に写像することをテクスチャ
マッピングという。この処理は、3次元図形上の1点と
テクスチャ上の1点とを対応付け、夫々の1点における
色情報を混ぜ合わせること(ブレンド処理)により行わ
れる。
2. Description of the Related Art When displaying three-dimensional graphics, it is required to display images with high realism. As a method of increasing the realism, there is a method of attaching a picture or pattern to a three-dimensional figure. Here, a picture or pattern to be pasted is called a texture (also referred to as a source image), and mapping of a two-dimensional texture to a three-dimensional figure is called texture mapping. This processing is performed by associating one point on the three-dimensional figure with one point on the texture, and mixing the color information at each one point (blend processing).

【0003】この方法は、 Jackie Neider,Tom Davis and Mason Woo : OpenGL Pr
ogramming Guide,Addison Wesley Publishing Compan
y,1993,pp.274−276. に記載されている。
This method is described in Jackie Neider, Tom Davis and Mason Woo: OpenGL Pr
ogramming Guide, Addison Wesley Publishing Compan
y, 1993, pp. 274-276.

【0004】これによれば、ブレンド処理の方法は複数
あり、いずれの場合も画素毎に処理を行う。この画素毎
のブレンド処理により得られた色情報又は/及び図形情
報を元に、3次元図形を表示するために必要な描画デー
タ又は表示データを生成する。
According to this, there are a plurality of blending methods, and in each case, the processing is performed for each pixel. Based on the color information and / or graphic information obtained by the blending process for each pixel, drawing data or display data necessary for displaying a three-dimensional graphic is generated.

【0005】[0005]

【発明が解決しようとする課題】上述の方法では、画素
毎にブレンド処理を行う必要があるため、高速に処理す
るには、ブレンド処理をハードウェア化する必要があ
る。つまり、ハードウェア物量を増やすという問題があ
った。
In the above-described method, it is necessary to perform the blending process for each pixel. Therefore, in order to perform high-speed processing, it is necessary to implement the blending process by hardware. That is, there is a problem of increasing the hardware quantity.

【0006】本発明の目的は、上記テクスチャマッピン
グを有する表示を、少ないハードウェア物量で高速かつ
高品質に処理可能な3次元グラフィックス表示装置及び
方法の提供にある。
An object of the present invention is to provide a three-dimensional graphics display device and method capable of processing a display having the above-described texture mapping at high speed and with high quality with a small amount of hardware.

【0007】[0007]

【課題を解決するための手段】本発明の特徴は、3次元
空間で定義される図形が2次元空間に投影され、その投
影された図形にソース画像を張り付けるグラフィックス
表示装置及び方法において、図形に付けられた指標によ
りソース画像を選択する手段と、輝度の異なる複数のソ
ース画像を格納する手段とを具備することにある。
A feature of the present invention is a graphics display apparatus and method for projecting a figure defined in a three-dimensional space onto a two-dimensional space and pasting a source image to the projected figure. The object is to include means for selecting a source image based on an index attached to a figure and means for storing a plurality of source images having different luminances.

【0008】[0008]

【発明の実施の形態】図1に、本発明を用いたグラフィ
ックスシステムの構成例を示す。
FIG. 1 shows a configuration example of a graphics system using the present invention.

【0009】このシステムは、例えば、ワークステーシ
ョン,パソコン,個人情報機器などで、データ処理,表
示処理,データ入出力処理等の処理を行うグラフィック
ス処理部1000と、各種データや命令(以下、コマン
ドと記す)を保持し、読み出し処理又は書き込み処理さ
れるメモリ部2000と、CRT,液晶,プリンタ等の
表示部3000と、他の処理装置やメモリ装置との入出
力処理をする入出力処理部3500とから構成される。
This system includes, for example, a graphics processing unit 1000 that performs data processing, display processing, data input / output processing, and the like on a workstation, a personal computer, personal information equipment, and the like, and various data and instructions (hereinafter, commands). ), A display unit 3000 such as a CRT, a liquid crystal display, a printer, etc., and an input / output processing unit 3500 for performing input / output processing with another processing device or memory device. It is composed of

【0010】グラフィックス処理部1000は、データ
処理や他のプロセッサの制御等を行うCPU部1100
と、描画処理を行うグラフィックスプロセッサ部120
0と、表示部3000にデータを表示するためのタイミ
ング処理等を行う表示プロセッサ部1300と、上記の
CPU部1100、グラフィックスプロセッサ部1200,
表示プロセッサ部1300,メモリ部2000等を含む
外部装置との間のデータの伝送制御を行うメモリコント
ローラ部1400とから構成される。ここで、グラフィ
ックスプロセッサ部1200と表示プロセッサ部130
0とは独立して示されているが、1つのプロセッサ部と
して形成することも可能である。
A graphics processing unit 1000 is a CPU unit 1100 that performs data processing and controls other processors.
And a graphics processor unit 120 for performing a drawing process
0, a display processor unit 1300 that performs timing processing for displaying data on the display unit 3000, etc., the CPU unit 1100, the graphics processor unit 1200,
A memory controller 1400 that controls data transmission to and from an external device including a display processor 1300, a memory 2000, and the like. Here, the graphics processor unit 1200 and the display processor unit 130
Although it is shown independently of 0, it can be formed as one processor unit.

【0011】メモリ部2000は、CPU部1100が
使用する主記憶2100と、描画のためのコマンドを保
持するコマンドバッファ2200と、テクスチャマッピ
ングに用いる絵柄や模様を保持するソース画像バッファ
2300と、表示のためのデータを保持するフレームバ
ッファ2400とを含んだ構成で示しているが、夫々の
領域を分離してもよい。
The memory unit 2000 includes a main memory 2100 used by the CPU unit 1100, a command buffer 2200 for holding commands for drawing, a source image buffer 2300 for holding pictures and patterns used for texture mapping, and a display And a frame buffer 2400 that holds data for this purpose, but each area may be separated.

【0012】グラフィックスプロセッサ部1200は、
メモリ部2000内のコマンドバッファ2200に対す
るアクセスを制御するコマンドバッファ制御部1210
と、メモリ部2000内のソース画像バッファ2300
に対するアクセスを制御するソース画像バッファ制御部
1220と、メモリ部2000内のフレームバッファ2
400に対するアクセスを制御するフレームバッファ制
御部1230とを具備している。
The graphics processor unit 1200 includes:
Command buffer control unit 1210 for controlling access to command buffer 2200 in memory unit 2000
And a source image buffer 2300 in the memory unit 2000
Source image buffer control unit 1220 for controlling access to image data, and frame buffer 2 in memory unit 2000.
And a frame buffer control unit 1230 for controlling access to the H.400.

【0013】本発明の特徴となるテクスチャマッピング
を有する表示は、主にCPU部1100によって処理され
る。
The display having the texture mapping which is a feature of the present invention is mainly processed by the CPU 1100.

【0014】次に、このグラフィックスシステムで3次
元図形を表示するための処理手順を示す。CPU部11
00では、表示すべき図形の情報を図3の処理手順に従
ってコマンドを作成し、メモリ部2000内のコマンド
バッファ2200に格納する。この際、輝度計算600
0の結果を用いて、使用するソース画像を選択する。こ
の処理により、グラフィックス表示の写実性を高めるこ
とができる。
Next, a processing procedure for displaying a three-dimensional figure with this graphics system will be described. CPU unit 11
At 00, a command is created for the information of the graphic to be displayed according to the processing procedure of FIG. 3 and stored in the command buffer 2200 in the memory unit 2000. At this time, the brightness calculation 600
Using the result of 0, a source image to be used is selected. By this processing, the realism of the graphics display can be improved.

【0015】グラフィックスプロセッサ部1200は、
CPU部1100で作成されたコマンドをアクセスし、
そのコマンドに従ってメモリ部2000内のフレームバ
ッファ2400に図形を描画する。図12は、コマンド
の例を示したものである。CODEはコマンドを区別す
るためのコードであり、DRAWMODEは描画する属
性である。また、TXS,TYS,TDX,TDY,D
X1,DY1,DX2,DY2,DX3,DY3,DX
4,DY4は、図11に示す値に対応する。すなわち、
メモリ部2000のソース座標系2310において、開
始位置(TXS,TYS)、幅TDX(図8のW0に対
応)、高さTDY(図8のH0に対応)のソース画像
を、表示部3000のデバイス座標系2410の(DX
1,DY1),(DX2,DY2),(DX3,DY
3),(DX4,DY4)に描画することを示すコマン
ドである。TXS,TYS,TDX,TDYは、後述す
る図3のソース画像選択7000において、また、DX
1,DY1,DX2,DY2,DX3,DY3,DX
4,DY4は、後述する図3の投影変換8000におい
て求められる。
The graphics processor unit 1200 includes:
Access the command created by the CPU unit 1100,
In accordance with the command, a figure is drawn in the frame buffer 2400 in the memory unit 2000. FIG. 12 shows an example of the command. CODE is a code for distinguishing commands, and DRAWMODE is an attribute for drawing. TXS, TYS, TDX, TDY, D
X1, DY1, DX2, DY2, DX3, DY3, DX
4, DY4 correspond to the values shown in FIG. That is,
In the source coordinate system 2310 of the memory unit 2000, a source image of a start position (TXS, TYS), a width TDX (corresponding to W0 in FIG. 8), and a height TDY (corresponding to H0 in FIG. 8) is displayed on a device of the display unit 3000. (DX) of the coordinate system 2410
1, DY1), (DX2, DY2), (DX3, DY
3) and (DX4, DY4). TXS, TYS, TDX, and TDY are used in a source image selection 7000 in FIG.
1, DY1, DX2, DY2, DX3, DY3, DX
4 and DY4 are obtained in a later-described projection transformation 8000 of FIG.

【0016】このようにして描画された情報は、表示プ
ロセッサ部1300によって読み出しが行われ、表示部
3000に転送され表示される。
The information drawn in this manner is read out by the display processor 1300 and transferred to the display 3000 for display.

【0017】メモリコントローラ部1400は、CPU
部1100、グラフィックスプロセッサ部1200,表
示プロセッサ部1300からの夫々のメモリアクセスを
調停する。
The memory controller 1400 includes a CPU
The respective memory accesses from the unit 1100, the graphics processor unit 1200, and the display processor unit 1300 are arbitrated.

【0018】図2に、本発明のテクスチャマッピングの
概説図を示す。
FIG. 2 shows a schematic diagram of the texture mapping of the present invention.

【0019】まず、予め、メモリ部2000内のソース
画像バッファ2300に、輝度の異なる複数のソース画
像を用意する。この用意するソース画像は同じ絵柄でな
くてもよいが、ここでは同じ絵柄であるとする。これら
複数のソース画像の選択は、輝度計算6000の結果を
指標として行う。この処理により、明るい図形には明る
いソース画像を、暗い図形には暗いソース画像を張り付
けることができる。この処理は、図3のソース画像選択
7000において行われる。
First, a plurality of source images having different luminances are prepared in a source image buffer 2300 in the memory unit 2000 in advance. The prepared source images need not have the same pattern, but here it is assumed that they have the same pattern. The selection of the plurality of source images is performed using the result of the luminance calculation 6000 as an index. By this processing, a bright source image can be pasted on a bright figure, and a dark source image can be pasted on a dark figure. This processing is performed in source image selection 7000 in FIG.

【0020】図3に、CPU部1100で行われる本発
明のテクスチャマッピング処理フローを示す。
FIG. 3 shows a texture mapping processing flow of the present invention performed by the CPU unit 1100.

【0021】まず、グラフィックスプロセッサ部120
0に対するコマンドを作成するために必要な各種パラメ
ータを設定する。次に、描画する図形に座標変換500
0を施しモデル座標系から視点座標系に変換する。この
計算は、4×4の座標変換行列をMmv,モデル座標系デ
ータをVmcとすると、変換後の視点座標系データVvrcは
次式で与えられる。
First, the graphics processor unit 120
Various parameters required to create a command for 0 are set. Next, coordinate transformation 500 is performed on the figure to be drawn.
0 is applied to convert from the model coordinate system to the viewpoint coordinate system. In this calculation, assuming that a 4 × 4 coordinate conversion matrix is Mmv and the model coordinate system data is Vmc, the viewpoint coordinate system data Vvrc after conversion is given by the following equation.

【0022】Vvrc=Mmv×Vmc 次に、視点,光源,図形の位置を三次元的に考慮し輝度
計算6000を行う。次に、上記輝度計算6000で算
出された色情報を元に、予め用意しておいた輝度レベル
の異なるソース画像の中から、使用するソース画像を選
択する。次に、視点座標系にある図形に対して投影変換
8000を施し、デバイス座標系2410に変換する。この
計算は、4×4の投影変換行列をMpers、視点座標系デ
ータを Vvrcとすると、変換後のデバイス座標系241
0データVdc は次式で与えられる。
Vvrc = Mmv × Vmc Next, a luminance calculation 6000 is performed in consideration of the viewpoint, the light source, and the position of the figure three-dimensionally. Next, based on the color information calculated by the brightness calculation 6000, a source image to be used is selected from previously prepared source images having different brightness levels. Next, a projection transformation 8000 is performed on the figure in the viewpoint coordinate system, and the figure is transformed into a device coordinate system 2410. In this calculation, assuming that the 4 × 4 projection transformation matrix is Mpers and the viewpoint coordinate system data is Vvrc, the device coordinate system 241 after the transformation is obtained.
The 0 data Vdc is given by the following equation.

【0023】Vdc=Mpers×Vvrc それらの結果を元に、グラフィックスプロセッサ部12
00が解釈し図形を描画するコマンドを作成する。以上
で、CPU部1100で行われる1つの図形に対する処
理は完結する。複数の図形に対するコマンドを作成する
場合には、この処理を繰り返すことで実現できる。
Vdc = Mpers × Vvrc Based on the results, the graphics processor 12
00 creates a command to interpret and draw a figure. Thus, the processing for one figure performed by the CPU unit 1100 is completed. When a command for a plurality of figures is created, this can be realized by repeating this process.

【0024】図4に、図3における各種パラメータ設定
4000の詳細を示す。
FIG. 4 shows details of the various parameter settings 4000 in FIG.

【0025】まず、図3の座標変換5000で用いられ
る座標変換行列を設定する。次に、図3の輝度計算60
00で必要な光源パラメータ,材質パラメータを設定す
る。光源パラメータに関しては光源数分設定する。次
に、図3の投影変換8000で用いられる投影変換行列
を設定する。最後に、輝度の異なる複数のソース画像を
メモリ部2000内のソース画像バッファ2300に設
定する。
First, a coordinate transformation matrix used in the coordinate transformation 5000 of FIG. 3 is set. Next, the brightness calculation 60 of FIG.
At 00, necessary light source parameters and material parameters are set. Light source parameters are set for the number of light sources. Next, a projection transformation matrix used in the projection transformation 8000 of FIG. 3 is set. Finally, a plurality of source images having different luminances are set in the source image buffer 2300 in the memory unit 2000.

【0026】図5に、図4におけるソース画像設定45
00の詳細を示す。
FIG. 5 shows the source image setting 45 in FIG.
00 is shown in detail.

【0027】図6に示すような、輝度の異なる複数のソ
ース画像を設定することを考える。まず、最も輝度レベ
ルの低いソース画像を設定する。この場合、ソース画像
を識別するIDは0、ソース画像の輝度レベルは0であ
る。次に、このソース画像のデータをメモリ部2000
内のソース画像バッファ2300に設定する。この結
果、図7に示すようにソース画像バッファ2300のア
ドレスA0を先頭に最も輝度レベルの低いソース画像の
データが格納される。最後に、これらソース画像を管理
するため、図8に示すソース画像テーブル2110に、
ソース画像ID,輝度レベル,ソース画像アドレス,ソ
ース画像サイズを設定する。この一連の処理を輝度レベ
ル数分行うことにより、輝度の異なる複数のソース画像
を設定する。その結果、図7に示すように、A0,A
1,A2,A3,A4を夫々先頭アドレスとしてソース
画像データがソース画像バッファ2300に格納され、
A0に近い程輝度レベルが低く、A4に近い程輝度レベ
ルが高くなる。また、ソース画像ID,輝度レベル,ソ
ース画像アドレス,ソース画像サイズを対応付けるソー
ス画像テーブル2110が、図8のようにできあがる。
更に、別のIDを持つソース画像を設定する場合には、
図4におけるソース画像設定4500を繰り返し行えば
よい。
Consider setting a plurality of source images having different luminances as shown in FIG. First, a source image with the lowest luminance level is set. In this case, the ID for identifying the source image is 0, and the luminance level of the source image is 0. Next, the data of the source image is stored in the memory unit 2000.
Is set in the source image buffer 2300 in the table. As a result, as shown in FIG. 7, the data of the source image having the lowest luminance level is stored starting from the address A0 of the source image buffer 2300. Finally, in order to manage these source images, a source image table 2110 shown in FIG.
A source image ID, a luminance level, a source image address, and a source image size are set. By performing this series of processing for the number of luminance levels, a plurality of source images having different luminances are set. As a result, as shown in FIG.
The source image data is stored in the source image buffer 2300 using 1, A2, A3, and A4 as the respective start addresses.
The closer to A0, the lower the brightness level, and the closer to A4, the higher the brightness level. Further, a source image table 2110 for associating a source image ID, a luminance level, a source image address, and a source image size is completed as shown in FIG.
Furthermore, when setting a source image having another ID,
The source image setting 4500 in FIG. 4 may be repeatedly performed.

【0028】図9に、図3における輝度計算6000で
用いる照光モデル6100を示す。Ldirは光源ベクト
ル,Lは光源方向ベクトル,Nは法線ベクトル,Vは視
点方向ベクトル,Hはハーフウェイベクトル(H=(V
+L)/|V+L|)を意味する。色情報Cは、自然界
に存在する環境光により照らされる図形の色Cglobal
と、図形そのものが放つ放射光の色Ceと、光源により
照らされる図形の環境反射光成分色Caiと、光源により
照らされる図形の拡散反射光成分色Cdiと、光源により
照らされる図形の鏡面反射光成分色Csiとの和で表され
る。すなわち、C=Cglobal+Ce+Σ(Cai+Cdi+Csi)よ
り求められる。ここで、Cは(Cr,Cg,Cb)の3成分
(赤,緑,青)から成り、iは光源番号を表す。また、
Ca,Ce,Cai,Cdi,Csi は、次式より求められる。
FIG. 9 shows an illumination model 6100 used in the luminance calculation 6000 in FIG. Ldir is a light source vector, L is a light source direction vector, N is a normal vector, V is a viewpoint direction vector, H is a halfway vector (H = (V
+ L) / | V + L |). The color information C is a color Cglobal of a figure illuminated by environmental light existing in the natural world.
, The color Ce of the emitted light emitted by the figure itself, the environment reflected light component color Cai of the figure illuminated by the light source, the diffuse reflected light component color Cdi of the figure illuminated by the light source, and the specular reflected light of the figure illuminated by the light source It is represented by the sum with the component color Csi. That is, it is obtained from C = Cglobal + Ce + Σ (Cai + Cdi + Csi). Here, C is composed of three components (red, green, blue) of (Cr, Cg, Cb), and i represents a light source number. Also,
Ca, Ce, Cai, Cdi, and Csi are obtained by the following equations.

【0029】 Cglobal=Ka×Lglobal Ce=Ke Cai=Ka×Lai×Latti×(−Ldiri・Li)^dropOffRate Cdi=Kd×Ldi×Latti×(−Ldiri・Li)^dropOffRate×(N・Li) Csi=Ks×Lsi×Latti×(−Ldiri・Li)^dropOffRate×(N・Hi)^shininess 但し、(−Ldiri・Li),(N・Li),(N・Hi)は内積であ
る。ここで、(Ka,Kd,Ks)は材質の反射係数、(La,L
d,Ls)は光源の色、Lglobalは自然界に存在する環境光
の色,Lattは光源の減衰係数,dropOffRateはスポット
光源の強さ指数、shininessは鏡面光の強さ指数であ
る。
Cglobal = Ka × Lglobal Ce = Ke Cai = Ka × Lai × Latti × (−Ldiri · Li) ^ dropOffRate Cdi = Kd × Ldi × Latti × (−Ldiri · Li) ^ dropOffRate × (N · Li) Csi = Ks × Lsi × Latti × (−Ldiri · Li) ^ dropOffRate × (N · Hi) ^ shininess where (−Ldiri · Li), (N · Li), and (N · Hi) are inner products. Here, (Ka, Kd, Ks) is the reflection coefficient of the material, and (La, L
d, Ls) are the color of the light source, Lglobal is the color of the ambient light existing in the natural world, Latt is the attenuation coefficient of the light source, dropOffRate is the intensity index of the spot light source, and shininess is the intensity index of the specular light.

【0030】尚、この計算式により求めた色情報Cは、
[0.0,1.0]の範囲にクランプする。
The color information C obtained by this formula is
Clamp in the range of [0.0, 1.0].

【0031】図10に、図3におけるソース画像選択7
000の詳細を示す。
FIG. 10 shows the source image selection 7 in FIG.
000 is shown.

【0032】まず、図3における輝度計算6000で算
出された色情報Cを元に、使用するソース画像の輝度レ
ベルLEVELを算出する。色情報CをC=(Cr,C
g,Cb)、予め用意したソース画像数をNs、輝度レ
ベル係数KsをKs=Ns−1すると、その計算は次式
で与えられる。
First, a luminance level LEVEL of a source image to be used is calculated based on the color information C calculated by the luminance calculation 6000 in FIG. The color information C is expressed as C = (Cr, C
g, Cb), when the number of source images prepared in advance is Ns and the luminance level coefficient Ks is Ks = Ns-1, the calculation is given by the following equation.

【0033】LEVEL=Cr×Ks この輝度レベルLEVELに対応するソース画像アドレ
スは、図8のソース画像テーブル2110を参照するこ
とで求める。更に、メモリ部2000の横方向をX,縦
方向をYとした場合のソース座標2310(TXS,T
YS)を上記ソース画像アドレスを元に算出する。ここ
では、色情報Cの赤成分Crを指標として輝度レベルL
EVELを算出したが、緑成分Cg又は青成分Cbを指
標として輝度レベルLEVELを算出してもよい。
LEVEL = Cr × Ks The source image address corresponding to the luminance level LEVEL is obtained by referring to the source image table 2110 in FIG. Further, source coordinates 2310 (TXS, TX) when the horizontal direction of the memory unit 2000 is X and the vertical direction is Y.
YS) is calculated based on the source image address. Here, the luminance level L is set using the red component Cr of the color information C as an index.
Although the EVEL is calculated, the luminance level LEVEL may be calculated using the green component Cg or the blue component Cb as an index.

【0034】次に、図10におけるソース画像選択70
00の拡張を図13に示す。
Next, source image selection 70 in FIG.
The extension of 00 is shown in FIG.

【0035】図10のソース画像選択7000による
と、使用するソース画像を予め全て用意しておく必要が
ある。この予め用意しておかなければならないソース画
像を減らし、本発明のテクスチャマッピングを実現する
手法を、図13に示す。今、図14に示すように、最も
暗い(輝度レベル0)ソース画像をソース画像アドレス
A0に、中間の明るさ(輝度レベル2)のソース画像を
ソース画像アドレスA2に、最も明るい(輝度レベル
4)ソース画像をソース画像アドレスA4に、予め用意
してあるものとする。
According to the source image selection 7000 in FIG. 10, it is necessary to prepare all source images to be used in advance. FIG. 13 shows a technique for reducing the number of source images that need to be prepared in advance and implementing the texture mapping of the present invention. Now, as shown in FIG. 14, the darkest (brightness level 0) source image is assigned to the source image address A0, the source image of intermediate brightness (brightness level 2) is assigned to the source image address A2, and the brightest (brightness level 4). It is assumed that the source image is prepared in advance at the source image address A4.

【0036】まず、図3における輝度計算6000で算
出された色情報Cを元に、使用するソース画像の輝度レ
ベルLEVELを算出する。色情報CをC=(Cr,C
g,Cb)、予め用意したソース画像数をNs、予め用
意したソース画像の内の2つを元に、その間を補間(以
下、フィルタ処理と呼ぶ)し新たに作成可能なソース画
像数を示すフィルタレベルをM、輝度レベル係数Ksを
Ks=Ns+M(Ns−1)−1とすると、その計算は
次式で与えられる。
First, the luminance level LEVEL of the source image to be used is calculated based on the color information C calculated by the luminance calculation 6000 in FIG. The color information C is expressed as C = (Cr, C
g, Cb), the number of source images prepared in advance is Ns, and the number of source images that can be newly created by interpolating between them (hereinafter referred to as filter processing) based on two of the prepared source images is shown. Assuming that the filter level is M and the luminance level coefficient Ks is Ks = Ns + M (Ns-1) -1, the calculation is given by the following equation.

【0037】LEVEL=Cr×Ks 次に、この輝度レベルLEVELに対応するソース画像
が存在するかどうかを判断する。
LEVEL = Cr × Ks Next, it is determined whether or not a source image corresponding to the luminance level LEVEL exists.

【0038】存在する場合、この輝度レベルLEVEL
に対応するソース画像アドレスを、図8のソース画像テ
ーブル2110を参照することで求める。更に、メモリ
部2000の横方向をX、縦方向をYとした場合のソー
ス座標2310(TXS,TYS)を上記ソース画像ア
ドレスを元に算出する。
If present, this luminance level LEVEL
Is obtained by referring to the source image table 2110 in FIG. Further, source coordinates 2310 (TXS, TYS) when the horizontal direction of the memory unit 2000 is X and the vertical direction is Y are calculated based on the source image address.

【0039】存在しない場合、既存のソース画像を元に
フィルタ処理7110し新たにソース画像を作成し、そ
の作成されたソース画像を、図14のソース画像バッフ
ァ2300に、その情報を図8のソース画像テーブル2
110に設定する。その後、存在しない場合と同様に、
ソース画像アドレスとメモリ部2000内ソース座標2
310(TXS,TYS)を算出する。ここでは、色情
報Cの赤成分Crを指標として輝度レベルLEVELを
算出したが、緑成分Cg又は青成分Cbを指標として輝
度レベルLEVELを算出してもよい。
If not, a new source image is created by performing a filtering process 7110 based on the existing source image, and the created source image is stored in the source image buffer 2300 in FIG. Image table 2
Set to 110. Then, as if it were not present,
Source image address and source coordinate 2 in memory unit 2000
310 (TXS, TYS) is calculated. Here, the luminance level LEVEL is calculated using the red component Cr of the color information C as an index, but the luminance level LEVEL may be calculated using the green component Cg or the blue component Cb as an index.

【0040】図14に、上記フィルタ処理7110の詳
細を示す。
FIG. 14 shows the details of the filtering process 7110.

【0041】今、予め用意されているソース画像の内の
2つを元に、その間をフィルタ処理7110し新たに作
成可能なソース画像数Mを1とする。
Now, based on two of the source images prepared in advance, filter processing 7110 is performed between them, and the number M of source images that can be newly created is set to one.

【0042】ここで、輝度レベル算出の結果であるLE
VELが、輝度レベル1を指しているとすると、輝度レ
ベル1のソース画像は予め用意されていないので、輝度
レベル0と輝度レベル2のソース画像を元にフィルタ処
理7110し、新たにソース画像を作成する。輝度レベ
ル0及び輝度レベル2のソース画像の1つのテクセル色
を夫々(T0r,T0g,T0b),(T2r,T2
g,T2b)とすると、新たに生成されるソース画像の
テクセル色は、M=1の場合、次式で与えられる。
Here, LE, which is the result of calculating the luminance level,
Assuming that VEL indicates the luminance level 1, since the source image of the luminance level 1 is not prepared in advance, the filter processing 7110 is performed based on the source images of the luminance level 0 and the luminance level 2 and a new source image is generated. create. One texel color of the source image of the luminance level 0 and the luminance level 2 is respectively (T0r, T0g, T0b), (T2r, T2
g, T2b), the texel color of the newly generated source image is given by the following equation when M = 1.

【0043】T1r=(T0r+T2r)×0.5 T1g=(T0g+T2g)×0.5 T1b=(T0b+T2b)×0.5 このテクセル毎の処理を、全テクセルに対して行うこと
で、新しいソース画像を作成する。この作成されたソー
ス画像は、図14のソース画像バッファ2300のアドレス
A1に格納する。また、新しく作成されたソース画像の
情報を、図8のソース画像テーブル2110に設定す
る。以上で、上記フィルタ処理7110が完了する。
T1r = (T0r + T2r) × 0.5 T1g = (T0g + T2g) × 0.5 T1b = (T0b + T2b) × 0.5 The processing for each texel is performed for all texels, so that a new source image is obtained. create. The created source image is stored in the address A1 of the source image buffer 2300 in FIG. Also, the information of the newly created source image is set in the source image table 2110 of FIG. Thus, the filtering process 7110 is completed.

【0044】次に、図13におけるソース画像選択70
00の拡張を図15に示す。
Next, source image selection 70 in FIG.
The extension of 00 is shown in FIG.

【0045】図13では、予め用意しておかなければな
らないソース画像を減らし、本発明のテクスチャマッピ
ングを実現する手法について述べた。しかし、この手法
では、予め用意すべきソース画像数を1つにすることは
できない。なぜなら、上記フィルタ処理7110におい
て必ず2つのソース画像を必要とするからである。ここ
では、その1つのソース画像を用意するだけで本発明の
テクスチャマッピングを実現する手法について示す。
FIG. 13 has described the method of realizing texture mapping of the present invention by reducing the number of source images that must be prepared in advance. However, this method cannot reduce the number of source images to be prepared in advance to one. This is because the filter processing 7110 always requires two source images. Here, a method for realizing the texture mapping of the present invention only by preparing the one source image will be described.

【0046】今、図16に示すように、中間の明るさ
(輝度レベル2)のソース画像をソース画像アドレスA
2に予め用意してあるものとする。
Now, as shown in FIG. 16, a source image having an intermediate brightness (brightness level 2) is assigned a source image address A
2 is prepared in advance.

【0047】まず、図3における輝度計算6000で算
出された色情報Cを元に、使用するソース画像の輝度レ
ベルLEVELを算出する。色情報CをC=(Cr,C
g,Cb)、ソース画像総数をNs、予め用意したソー
ス画像の輝度レベルをSlevel,輝度レベル係数KsをK
s=Ns−1とすると、その計算は次式で与えられる。
First, a luminance level LEVEL of a source image to be used is calculated based on the color information C calculated by the luminance calculation 6000 in FIG. The color information C is expressed as C = (Cr, C
g, Cb), the total number of source images is Ns, the luminance level of the prepared source image is Slevel, and the luminance level coefficient Ks is K
If s = Ns-1, the calculation is given by the following equation.

【0048】LEVEL=Cr×Ks 次に、この輝度レベルLEVELに対応するソース画像
が存在するかどうかを判断する。
LEVEL = Cr × Ks Next, it is determined whether or not a source image corresponding to the luminance level LEVEL exists.

【0049】存在する場合、この輝度レベルLEVEL
に対応するソース画像アドレスを、図8のソース画像テ
ーブル2110を参照することで求める。更に、メモリ
部2000の横方向をX、縦方向をYとした場合のメモ
リ部2000内座標(TXS,TYS)を上記ソース画像
アドレスを元に算出する。
If present, this luminance level LEVEL
Is obtained by referring to the source image table 2110 in FIG. Further, the coordinates (TXS, TYS) in the memory unit 2000 when the horizontal direction of the memory unit 2000 is X and the vertical direction is Y, are calculated based on the source image address.

【0050】存在しない場合、既存のソース画像を元に
輝度変更処理7210を行い新たにソース画像を作成
し、その作成されたソース画像を、図16のソース画像
バッファ2300に、その情報を図8のソース画像テー
ブル2110に設定する。その後、存在しない場合と同
様に、ソース画像アドレスとメモリ部2000内ソース
座標2310(TXS,TYS)を算出する。ここで
は、色情報Cの赤成分Crを指標として輝度レベルLE
VELを算出したが、緑成分Cg又は青成分Cbを指標
として輝度レベルLEVELを算出してもよい。
If not, a new source image is created by performing luminance change processing 7210 based on the existing source image, and the created source image is stored in the source image buffer 2300 in FIG. Is set in the source image table 2110. After that, the source image address and the source coordinates 2310 (TXS, TYS) in the memory unit 2000 are calculated in the same manner as in the case where they do not exist. Here, the luminance level LE is set using the red component Cr of the color information C as an index.
Although the VEL is calculated, the luminance level LEVEL may be calculated using the green component Cg or the blue component Cb as an index.

【0051】図16に、上記輝度変更処理7210の詳
細を示す。
FIG. 16 shows the details of the brightness change processing 7210.

【0052】ここで、輝度レベル算出の結果であるLE
VELが、輝度レベル3を指しているとすると、輝度レ
ベル3のソース画像は予め用意されていないので、輝度
レベル2のソース画像を元に輝度変更処理7210し、
新たにソース画像を作成する。輝度レベル2のソース画
像の1つのテクセル色を(T2r,T2g,T2b)と
すると、新たに生成されるソース画像のテクセル色は、
Slevel=2の場合、次式で与えられる。
Here, LE, which is the result of calculating the luminance level,
Assuming that VEL indicates the luminance level 3, since the source image of the luminance level 3 is not prepared in advance, the luminance change processing 7210 is performed based on the source image of the luminance level 2;
Create a new source image. Assuming that one texel color of the source image of luminance level 2 is (T2r, T2g, T2b), the texel color of the newly generated source image is
When Slevel = 2, it is given by the following equation.

【0053】T4r=T2r×Ku T4g=T2g×Ku T4b=T2b×Ku 但し、Ku=LEVEL/2であり、ソース画像内のテ
クセルで一定である。この輝度変更処理7210の結果
得られたテクセル色は、[0.0,1.0]の範囲を越え
る可能性があるため、クランプ処理7220を必要とす
る。
T4r = T2r × Ku T4g = T2g × Ku T4b = T2b × Ku where Ku = LEVEL / 2, which is constant at the texel in the source image. The texel color obtained as a result of the brightness change processing 7210 may exceed the range of [0.0, 1.0], and thus requires the clamp processing 7220.

【0054】このテクセル毎の処理を、全テクセルに対
して行うことで、新しいソース画像を作成する。この作
成されたソース画像は、図16のソース画像バッファ23
00のアドレスA4に格納する。また、新しく作成された
ソース画像の情報を、図8のソース画像テーブル211
0に設定する。以上で、上記輝度変更処理7210が完
了する。
The processing for each texel is performed for all texels to create a new source image. The created source image is stored in the source image buffer 23 shown in FIG.
00 is stored in the address A4. The information of the newly created source image is stored in the source image table 211 of FIG.
Set to 0. Thus, the brightness change processing 7210 is completed.

【0055】ここまでは、色情報がダイレクトカラーの
場合について述べてきた。次に、色情報がインデックス
カラーの場合について述べる。
The case where the color information is direct color has been described above. Next, a case where the color information is an index color will be described.

【0056】図17に、インデックスカラーにおいて本
発明を用いたグラフィックスシステムの構成例を示す。
表示プロセッサ部1300内にカラーパレット1310
を持つことが図1との異なる点である。これにより、イ
ンデックスカラーの場合でも本発明のテクスチャマッピ
ングを行うことが可能になる。この場合、ソース画像の
データとしては、(Cr,Cg,Cb)の色の3成分で
はなく、カラーパレット1310番号を示すindex であ
る。
FIG. 17 shows an example of the configuration of a graphics system using the present invention for index color.
Color palette 1310 in display processor unit 1300
Is a point different from FIG. As a result, the texture mapping of the present invention can be performed even in the case of index colors. In this case, the data of the source image is not the three components of the color (Cr, Cg, Cb) but the index indicating the color palette 1310 number.

【0057】図18に、カラーパレット1310の詳細
を示す。カラーパレット1310は16階調とし、inde
x0には背景をクリアするための予約色を、index1〜inde
x5には陰影付け(シェーディング)に用いる色を、index6
〜index15 にはソース画像で使用する色を設定したもの
である。ここで、陰影付け用色はindex1から暗い順に、
ソース画像用色はindex6から輝度レベルの低い順に設定
する。また、陰影付け用色のindex1〜index5は、[0.
0,1.0]に対応するとする。
FIG. 18 shows details of the color palette 1310. The color palette 1310 has 16 gradations,
x0 is a reserved color to clear the background, index1 to inde
x5 is the color used for shading, index6
In ~ index15, the color used in the source image is set. Here, the shading color is darker from index1,
The colors for the source image are set in ascending order of luminance level from index6. Also, index1 to index5 of the shading color are [0.
0, 1.0].

【0058】インデックスカラーの場合の図3における
輝度計算6000は、次式で与えられる。
The luminance calculation 6000 in FIG. 3 for the index color is given by the following equation.

【0059】 C=Cglobal+Ce+Σ(Cai+Cdi+Csi) Cglobal=Ka×Lglobal Ce=Ke Cai=Ka×Lai×Latti×(−Ldiri・Li)^dropOffRate Cdi=Kd×Ldi×Latti×(−Ldiri・Li)^dropOffRate×(N・Li) Csi=Ks×Lsi×Latti×(−Ldiri・Li)^dropOffRate×(N・Hi)^shininess 式自体は、ダイレクトカラーの場合と同様であるが、色
情報Cが(Cr,Cg,Cb)の3成分から成るのでは
なく、明暗を示すCvの1成分のみであることが異なる
点である。
C = Cglobal + Ce + Σ (Cai + Cdi + Csi) Cglobal = Ka × Lglobal Ce = Ke Cai = Ka × Lai × Latti × (−Ldiri · Li) ^ dropOffRate Cdi = Kd × Ldi × Latti × (−Ldiri · Li) ^ dropOffRate × (N · Li) Csi = Ks × Lsi × Latti × (−Ldiri · Li) ^ dropOffRate × (N · Hi) ^ shininess The expression itself is the same as in the case of direct color, but the color information C is (Cr, The difference is that the component is not composed of three components of Cg and Cb), but is composed of only one component of Cv indicating light and dark.

【0060】図3におけるソース画像選択7000は、
この輝度計算6000の結果であるC(=Cv)を元に
処理する。すなわち、ダイレクトカラーの場合には、輝
度レベルLEVELをCrを用いて、 LEVEL=Cr×Ks で算出するが、インデックスカラーの場合には、Crの
代わりにCvを用いて、 LEVEL=Cv×Ks で算出する。
The source image selection 7000 in FIG.
Processing is performed based on C (= Cv), which is the result of the luminance calculation 6000. That is, in the case of the direct color, the luminance level LEVEL is calculated by using Cr and LEVEL = Cr × Ks, whereas in the case of the index color, Cv is used instead of Cr and LEVEL = Cv × Ks calculate.

【0061】このようにすることによって、ダイレクト
カラーで実現した3種類のソース画像選択手法をインデ
ックスカラーでも実現できる。
In this manner, three types of source image selection methods realized by direct color can also be realized by index color.

【0062】また、図14のフィルタ処理7110に関
しては、次のようになる。輝度レベル0及び輝度レベル
2のソース画像の1つのテクセルのindexを夫々(index
6,index7),(index10,index11 )とすると、新たに生
成される輝度レベル1のソース画像のテクセルのind
exは、M=1の場合、次式で与えられる。
The filtering process 7110 shown in FIG. 14 is as follows. The index of one texel of the source image of the luminance level 0 and the luminance level 2 is set to (index
6, index7), (index10, index11), the ind of the texel of the newly generated source image of luminance level 1
ex is given by the following equation when M = 1.

【0063】index8=(index6+index10)×0.5 index9=(index7+index11)×0.5 更に、図16の輝度変更処理7210に関しては、次の
ようになる。輝度レベル2のソース画像の1つのテクセ
ルのindex を(index10,index11)とすると、新たに生成
される輝度レベル4のソース画像のテクセルのindex
は、Slevel=2の場合、次式で与えられる。
Index8 = (index6 + index10) × 0.5 index9 = (index7 + index11) × 0.5 Further, the brightness change processing 7210 in FIG. 16 is as follows. Assuming that the index of one texel of the source image of luminance level 2 is (index10, index11), the index of the texel of the newly generated source image of luminance level 4 is
Is given by the following equation when Slevel = 2.

【0064】index14=(index10−index6)×Ku+index6 index15=(index11−index7)×Ku+index7 但し、Ku=LEVEL/2であり、ソース画像内のテ
クセルで一定である。最後に、ここまで述べてきたCP
U部1100で処理するテクスチャマッピングの処理
は、専用ハードウェアにより実現することも可能であ
る。
Index14 = (index10−index6) × Ku + index6 index15 = (index11−index7) × Ku + index7 where Ku = LEVEL / 2, which is constant at the texel in the source image. Finally, the CP we have mentioned so far
The texture mapping process performed by the U unit 1100 can be realized by dedicated hardware.

【0065】次に、本発明のテクスチャマッピングを容
易に実現するためのグラフィックスライブラリについて
説明する。このグラフィックスライブラリは以下の関数
により実現される。
Next, a graphics library for easily realizing the texture mapping of the present invention will be described. This graphics library is realized by the following functions.

【0066】まず、QgGraphics3D_initialize関数の仕
様を示す。
First, the specifications of the QgGraphics3D_initialize function will be described.

【0067】QgGraphics3D_initialize(QgGraphics3D *
graphics3D)はフレームメモリに描画する図形を扱うグ
ラフィックスオブジェクトの初期化を行う。
QgGraphics3D_initialize (QgGraphics3D *
graphics3D) initializes a graphics object that handles graphics to be drawn in the frame memory.

【0068】 METHOD NAME QgGraphics3D_initialize SPECIFICATION void QgGraphics3D_initialize( QgGraphics3D *graphics3D ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_initialize SPECIFICATION void QgGraphics3D_initialize (QgGraphics3D * graphics3D) PARAMETERS Specifies a pointer to a graphics3D graphics object.

【0069】DESCRIPTION QgGraphics3D_initializeは、QgGraphics3D を初期化す
る。このメソッドはQgGraphics3Dを生成した後必ずコー
ルする必要がある。
Description QgGraphics3D_initialize initializes QgGraphics3D. This method must be called after creating QgGraphics3D.

【0070】ここで、METHOD NAMEは関数の名前であ
る。またSPECIFICATIONは関数の構文、PARAMETERSは引
数、DESCRIPTIONは関数の機能,動作の説明である。
Here, METHOD NAME is the name of the function. SPECIFICATION is the syntax of the function, PARAMETERS is the argument, and DESCRIPTION is the description of the function and operation of the function.

【0071】次にQgGraphics3D_drawPrimitive関数の仕
様を示す。
Next, the specifications of the QgGraphics3D_drawPrimitive function will be described.

【0072】QgGraphics3D_drawPrimitive(QgGraphics3
D *graphics3D,enum infoType,enum primitiveType,
short vertexNum,const FIX coordinate[],const F
IXcolor[],const FIX normal[],short textureI
D,const FIX texCoord[])は図形の描画を行う。この
時、座標変換,透視変換,輝度計算,クリッピング,陰
面消去の処理を行う。infoTypeには描画したい図形の法
線ベクトルとテクスチャの有無を設定する。primitiveT
ype には図形のタイプとして連続線,連続三角形,連続
四角形が設定可能である。vertexNumには図形の総頂点
数を設定する。coordinateには頂点座標を設定する。co
lorには頂点のカラーを設定する。
QgGraphics3D_drawPrimitive (QgGraphics3
D * graphics3D, enum infoType, enum primitiveType,
short vertexNum, const FIX coordinate [], const F
IXcolor [], const FIX normal [], short textureI
D, const FIX texCoord []) draws a figure. At this time, processing of coordinate transformation, perspective transformation, luminance calculation, clipping, and hidden surface elimination are performed. For infoType, set the normal vector of the shape you want to draw and the presence or absence of texture. primitiveT
In ype, continuous lines, continuous triangles, and continuous rectangles can be set as the figure type. For vertexNum, set the total number of vertices of the figure. Set vertex coordinates to coordinate. co
Set the vertex color to lor.

【0073】normal には頂点の法線ベクトルを設定す
る。textureIDにはテクスチャデータの番号を設定す
る。texCoordには頂点のテクスチャ座標を設定する。こ
こで、FIXとは変数の型であり、本実施例では整数部1
6ビット,小数部16ビットの固定小数点フォ−マット
を意味している。しかし、必ずしも固定小数点フォ−マ
ットである必要はない。
A normal vector of a vertex is set in normal. Set the texture data number in textureID. The texture coordinates of the vertices are set in texCoord. Here, FIX is a variable type, and in this embodiment, the integer part 1
This means a fixed-point format of 6 bits and a decimal part of 16 bits. However, it does not necessarily have to be in fixed-point format.

【0074】 METHOD NAME QgGraphics3D_drawPrimitive SPECIFICATION void QgGraphics3D_drawPrimitive( QgGraphics3D *graphics3D,enum infoType,enum primitiveType,short vertexNum,const FIX coordinate[], const FIX color[],const FIX normal[],short textureID, const FIX texCoord[] ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_drawPrimitive SPECIFICATION void QgGraphics3D_drawPrimitive (QgGraphics3D * graphics3D, enum infoType, enum primitiveType, short vertexNum, const FIX coordinate [], const FIX color [], const FIX normal [], short FIX normaltex] PARAMETERS graphics Specifies a pointer to a 3D graphics object.

【0075】infoType プリミティブオブジェクトの法線ベクトルとテクスチャ
の有無を指定する。
InfoType Specifies the normal vector of the primitive object and the presence / absence of a texture.

【0076】(QG_PRIMITIVE、QG_PRIMITIVET、QG_PRIMI
TIVEN、QG_PRIMITIVENT) primitiveType プリミティブタイプ(QG_LINE_STRIP,QG_TRIANGLE_STRI
P,QG_QUADRANGLE_STRIP) vertexNum 頂点数 coordinate[QG_PRIMITIVE_VERTEX_NUM*3] 頂点座標 color[QG_PRIMITIVE_VERTEX_NUM*3] 頂点カラー(0.0≦color≦1.0) normal[QG_PRIMITIVE_VERTEX_NUM*3](QG_PRIMITIVE,Q
G_PRIMITIVETでは記述しない) 頂点法線ベクトル textureID(QG_PRIMITIVE,QG_PRIMITIVENでは記述しな
い) テクスチャID texCoord[QG_PRIMITIVE_VERTEX_NUM*2](QG_PRIMITIV
E、QG_PRIMITIVENでは記述しない)頂点テクスチャ座標 DESCRIPTION QgGraphics3Dに対しプリミティブを描画する。この時、
座標変換,透視変換,輝度計算,クリッピング,陰面消
去の処理を行う。描画する基本図形は、連続線,連続三
角形,連続四角形の3種類存在する。“primitiveTyp
e” は、次の3つの値のいずれかをとる。
(QG_PRIMITIVE, QG_PRIMITIVET, QG_PRIMI
TIVEN, QG_PRIMITIVENT) primitiveType Primitive type (QG_LINE_STRIP, QG_TRIANGLE_STRI)
P, QG_QUADRANGLE_STRIP) vertexNum Number of vertices coordinate [QG_PRIMITIVE_VERTEX_NUM * 3] Vertex coordinates color [QG_PRIMITIVE_VERTEX_NUM * 3] Vertex color (0.0 ≦ color ≦ 1.0) normal [QG_PRIMITIVE_VERTEX_NUM * 3] (QG_PRIMITIVE, Q
Vertex normal vector textureID (not described in QG_PRIMITIVE, QG_PRIMITIVEN) texture ID texCoord [QG_PRIMITIVE_VERTEX_NUM * 2] (QG_PRIMITIV
E, not described by QG_PRIMITIVEN) Vertex texture coordinates DESCRIPTION Draw primitives for QgGraphics3D. At this time,
Performs coordinate transformation, perspective transformation, brightness calculation, clipping, and hidden surface removal. There are three types of basic figures to be drawn: continuous lines, continuous triangles, and continuous squares. “PrimitiveTyp
e "takes one of the following three values:

【0077】 QG_LINE_STRIP 連続線 QG_TRIANGLE_STRIP 連続三角形 QG_QUADRANGLE_STRIP 連続四角形 "coordinate"は、頂点数の3倍の1次元配列を必要とす
る(colorも同様)。
QG_LINE_STRIP Continuous line QG_TRIANGLE_STRIP Continuous triangle QG_QUADRANGLE_STRIP The continuous rectangle “coordinate” requires a one-dimensional array three times the number of vertices (similarly for color).

【0078】頂点座標(x0,y0,z0),(x1,y
1,z1),(x2,y2,z2),(x3,y3,z
3),(x4,y4,z4),(x5,y5,z5)を持つ
連続四角形を考える。
Vertex coordinates (x0, y0, z0), (x1, y
1, z1), (x2, y2, z2), (x3, y3, z
3) Consider a continuous rectangle having (x4, y4, z4) and (x5, y5, z5).

【0079】この時、配列には次のように値を格納す
る。
At this time, values are stored in the array as follows.

【0080】coordinate[]={x0,y0,z0,x
1,y1,z1,x2,y2,z2,x3,y3,z
3,x4,y4,z4,x5,y5,z5}; 図19に、本グラフィックスライブラリで取り扱い可能
なプリミティブを示す。
Coordinate [] = {x0, y0, z0, x
1, y1, z1, x2, y2, z2, x3, y3, z
3, x4, y4, z4, x5, y5, z5}; FIG. 19 shows primitives that can be handled by this graphics library.

【0081】図20に連続四角形の場合の頂点デ−タの
順序を示す。また、シェ−ドモデルやテクスチャマッピ
ングとプリミティブタイプとの関係を図21に示す。
FIG. 20 shows the order of vertex data in the case of a continuous square. FIG. 21 shows the relationship between a shade model or texture mapping and a primitive type.

【0082】次にQgGraphics3D_rotateMatrix関数の仕
様を示す。
Next, the specifications of the QgGraphics3D_rotateMatrix function are shown.

【0083】QgGraphics3D_rotateMatrix(QgGraphics3
D *graphics3D,FIX x,FIX y, FIX z,FIX angle)
はカレント行列に右から回転行列を乗算する。x,y,
zにはそれぞれ回転軸の方向ベクトルを設定する。ま
た、angle には回転する角度を設定する。
QgGraphics3D_rotateMatrix (QgGraphics3
D * graphics3D, FIX x, FIX y, FIX z, FIX angle)
Multiplies the current matrix by the rotation matrix from the right. x, y,
The direction vector of the rotation axis is set as z. Also, set the rotation angle in angle.

【0084】 METHOD NAME QgGraphics3D_rotateMatrix SPECIFICATION void QgGraphics3D_rotateMatrix( QgGraphics3D *graphics3D,FIX x, FIX y, FIX z, FIX angle ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_rotateMatrix SPECIFICATION void QgGraphics3D_rotateMatrix (QgGraphics3D * graphics3D, FIX x, FIX y, FIX z, FIX angle) PARAMETERS Specifies the pointer of the graphics object.

【0085】x,y,z ベクトルの“x”,“y”,“z”座標を各々指定す
る。
X, y, z The "x", "y", and "z" coordinates of the vector are specified, respectively.

【0086】angle 回転する角度を指定する。Angle Specifies the angle of rotation.

【0087】DESCRIPTION QgGraphics3D_rotateMatrix は、原点から点(x,y,
z)までのベクトルを軸に、オブジェクトを時計回りに
angle度回転させる"4*4”の変換行列を計算する。
Description QgGraphics3D_rotateMatrix is a point (x, y,
object clockwise around vector up to z)
Calculate a "4 * 4" transformation matrix to rotate by angle degrees.

【0088】カレント行列(QgGraphics3D_setMatrixMod
eを参照)に、この行列を右から乗算し、その結果をカレ
ント行列をする。つまり、“M”をカレント行列、
“R”を回転行列とすると、“M”は“M・R”で置換
される。
The current matrix (QgGraphics3D_setMatrixMod
multiply this matrix from the right and make the result the current matrix. That is, “M” is the current matrix,
If “R” is a rotation matrix, “M” is replaced by “M · R”.

【0089】カレント行列のモードが“QG_MODELVIEW”
か“QG_PROJECTION”の場合、QgGraphics3D_rotateMatr
ix を実行した後に描画する全てのオブジェクトが回転
する。必要に応じて、“QgGraphics3D_pushMatrix”と
“QgGraphics3D_popMatrix”で回転前の座標系を保存で
きる。
The mode of the current matrix is “QG_MODELVIEW”
QgGraphics3D_rotateMatr if or "QG_PROJECTION"
After executing ix, all objects to be drawn rotate. If necessary, the coordinate system before rotation can be saved with “QgGraphics3D_pushMatrix” and “QgGraphics3D_popMatrix”.

【0090】次にQgGraphics3D_translateMatrix関数の
仕様を示す。
Next, the specifications of the QgGraphics3D_translateMatrix function will be described.

【0091】QgGraphics3D_translateMatrix(QgGraphi
cs3D *graphics3D,FIX x,FIX y,FIX z)はカレント行
列に右から平行移動行列を乗算する。x,y,zにはそ
れぞれ移動量を設定する。
QgGraphics3D_translateMatrix (QgGraphi
cs3D * graphics3D, FIX x, FIX y, FIX z) multiplies the current matrix by the translation matrix from the right. For x, y, and z, the moving amounts are set.

【0092】 METHOD NAME QgGraphics3D_translateMatrix SPECIFICATION void QgGraphics3D_translateMatrix( QgGraphics3D *graphics3D, FIX x , FIX y, FIX z ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_translateMatrix SPECIFICATION void QgGraphics3D_translateMatrix (QgGraphics3D * graphics3D, FIXx, FIXy, FIXz) PARAMETERS Specifies a pointer to a graphics3D graphics object.

【0093】x,y,z 移動する座標値“x”,“y”,“z”を指定する。X, y, z Coordinate values “x”, “y”, “z” to be moved are designated.

【0094】DESCRIPTION QgGraphics3D_translateMatrixは、座標系の原点を点
(x,y,z)で指定した点に移動する“4*4”の変
換行列を計算する。変換行列は次の通り。
Description QgGraphics3D_translateMatrix calculates a “4 * 4” transformation matrix that moves the origin of the coordinate system to a point specified by a point (x, y, z). The transformation matrix is as follows.

【0095】 | 1 0 0 x | | 0 1 0 y | | 0 0 1 z | | 0 0 0 1 | カレント行列(QgGraphics3D_setMatrixModeを参照)に、
この行列を右から乗算し、その結果をカレント行列をす
る。つまり、“M”をカレント行列、“T”を平行移動
行列とすると、“M”は“M・T”で置換される。
| 100 x | | 0 1 0 y | | 0 0 1 z | | 0 0 0 1 | In the current matrix (see QgGraphics3D_setMatrixMode),
This matrix is multiplied from the right, and the result is made the current matrix. That is, if “M” is a current matrix and “T” is a translation matrix, “M” is replaced with “M · T”.

【0096】カレント行列のモードが“QG_MODELVIEW”
か“QG_PROJECTION”の場合、 QgGraphics3D_translat
eMatrixを実行した後に描画する全てのオブジェクトが
平行移動する。必要に応じて、“QgGraphics3D_pushMat
rix”と“QgGraphics3D_popMatrix”で平行移動前の座
標系を保存できる。
The mode of the current matrix is “QG_MODELVIEW”
QgGraphics3D_translat if or "QG_PROJECTION"
After executing eMatrix, all objects to be drawn move in parallel. If necessary, “QgGraphics3D_pushMat
“rix” and “QgGraphics3D_popMatrix” can save the coordinate system before translation.

【0097】次にQgGraphics3D_scaleMatrix関数の仕様
を示す。
Next, the specifications of the QgGraphics3D_scaleMatrix function will be described.

【0098】QgGraphics3D_scaleMatrix(QgGraphics3D
*graphics3D,FIX x,FIX y,FIX z)はカレント行列に右
から拡大,縮小、あるいはミラー反転行列を乗算する。
x,y,zにはそれぞれスケール係数を設定する。
QgGraphics3D_scaleMatrix (QgGraphics3D
* graphics3D, FIX x, FIX y, FIX z) multiplies the current matrix from the right by an enlargement, reduction, or mirror inversion matrix.
Scale coefficients are set for x, y, and z, respectively.

【0099】 METHOD NAME QgGraphics3D_scaleMatrix SPECIFICATION void QgGraphics3D_scaleMatrix( QgGraphics3D *graphics3D, FIX x, FIX y, FIX z ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_scaleMatrix SPECIFICATION void QgGraphics3D_scaleMatrix (QgGraphics3D * graphics3D, FIXx, FIXy, FIXz) PARAMETERS Specifies the pointer of the graphics3D graphics object.

【0100】x,y,z “x”,“y”,“z”軸各々のスケール係数を指定す
る。
X, y, z Specify the scale factor of each of the "x", "y", and "z" axes.

【0101】DESCRIPTION QgGraphics3D_scaleMatrixは、”x”,”y”,”z”
軸の各々について拡大/縮小/ミラー反転を行う。3つ
の引き数を軸各々のスケール係数とし、“4*4”の変
換行列を計算する。変換行列は次の通り。
Description QgGraphics3D_scaleMatrix is “x”, “y”, “z”
Enlarge / reduce / mirror invert is performed for each of the axes. Using the three arguments as scale factors for each axis, a "4 * 4" transformation matrix is calculated. The transformation matrix is as follows.

【0102】 | x 0 0 0 | | 0 y 0 0 | | 0 0 z 0 | | 0 0 0 1 | カレント行列(QgGraphics3D_setMatrixModeを参照)に、
この行列を右から乗算し、その結果をカレント行列とす
る。つまり、“M”をカレント行列、“S”を拡大/縮
小/ミラー反転行列とすると、“M”は“M・S”で置
換される。
| 0 y 0 0 | | 0 0 z 0 | | 0 0 0 1 | In the current matrix (see QgGraphics3D_setMatrixMode),
This matrix is multiplied from the right, and the result is set as the current matrix. That is, if “M” is a current matrix and “S” is an enlargement / reduction / mirror inversion matrix, “M” is replaced by “MS”.

【0103】カレント行列のモードが“QG_MODELVIEW”
か“QG_PROJECTION”の場合、QgGraphics3D_scaleMatri
xを実行した後に描画する全てのオブジェクトが拡大/
縮小/ミラー反転する。
The mode of the current matrix is “QG_MODELVIEW”
Or QgGraphics3D_scaleMatri for "QG_PROJECTION"
All objects to be drawn after executing x are enlarged /
Reduce / mirror flip.

【0104】必要に応じて、“QgGraphics3D_pushMatri
x”と“QgGraphics3D_popMatrix”で拡大/縮小/ミラ
ー反転前の座標系を保存できる。
If necessary, select “QgGraphics3D_pushMatri
“x” and “QgGraphics3D_popMatrix” can save the coordinate system before enlargement / reduction / mirror inversion.

【0105】次にQgGraphics3D_multMatrix関数の仕様
を示す。
Next, the specifications of the QgGraphics3D_multMatrix function will be described.

【0106】QgGraphics3D_multMatrix (QgGraphics3D
*graphics3D,const QbMat *m)はカレント行列に右か
ら指定された行列mを乗算する。
QgGraphics3D_multMatrix (QgGraphics3D
* graphics3D, const QbMat * m) multiplies the current matrix by the specified matrix m from the right.

【0107】 METHOD NAME QgGraphics3D_multMatrix SPECIFICATION void QgGraphics3D_multMatrix( QgGraphics3D *graphics3D, const QbMat &m ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_multMatrix SPECIFICATION void QgGraphics3D_multMatrix (QgGraphics3D * graphics3D, const QbMat & m) PARAMETERS Specifies a pointer to a graphics3D graphics object.

【0108】m 16個の連続した値を行優先順に配列した“4*4”の
行列のポインタを指定する。
M designates a pointer of a "4 * 4" matrix in which 16 consecutive values are arranged in the row priority order.

【0109】DESCRIPTION QgGraphics3D_multMatrix は、“m”で指定された行列
をカレント行列に乗算する。つまり、“M”をカレント
行列、“A”をQgGraphics3D_multMatrix で設定した行
列とすると、“M”は“M・A”で置換される。
Description QgGraphics3D_multMatrix multiplies the current matrix by the matrix specified by “m”. That is, if “M” is a current matrix and “A” is a matrix set by QgGraphics3D_multMatrix, “M” is replaced with “MA”.

【0110】カレント行列は、QgGraphics3D_setMatrix
Modeで指定した“QG_MODELVIEW”,“QG_PROJECTION”
のいずれかである。
The current matrix is QgGraphics3D_setMatrix
“QG_MODELVIEW”, “QG_PROJECTION” specified in Mode
Is one of

【0111】“m”は、行優先順に配列した32bit固
定小数点値(整数部:16bit,小数部:16bit)の
“4*4”の行列を指す。つまり、行列は以下のように
配列されている。
"M" indicates a "4 * 4" matrix of 32-bit fixed-point values (integer part: 16 bits, decimal part: 16 bits) arranged in row priority order. That is, the matrix is arranged as follows.

【0112】 | a0 a1 a2 a3 | | a4 a5 a6 a7 | | a8 a9 a10 a11 | | a12 a13 a14 a15 | 次にQgGraphics3D_setFrustum関数の仕様を示す。A0 a1 a2 a3 | | a4 a5 a6 a7 | | a8 a9 a10 a11 | | a12 a13 a14 a15 | Next, the specifications of the QgGraphics3D_setFrustum function are shown.

【0113】QgGraphics3D_setFrustum (QgGraphics3D
*graphics3D,FIX left,FIX right,FIX bottom,FIX
top,FIX near,FIX far)は透視投影用の投影行列を設
定する。left,rightにはそれぞれ前クリップ面の左右の
垂直座標を設定する。bottom,top にはそれぞれ前クリ
ップ面の上下の水平座標を設定する。near,far にはク
リップ面の奥行きをそれぞれ設定する。
QgGraphics3D_setFrustum (QgGraphics3D
* graphics3D, FIX left, FIX right, FIX bottom, FIX
top, FIX near, FIX far) set the projection matrix for perspective projection. For left and right, set the left and right vertical coordinates of the front clip plane. For bottom and top, set the horizontal coordinates of the top and bottom of the front clip plane. The depth of the clip plane is set for near and far.

【0114】 METHOD NAME QgGraphics3D_setFrustum SPECIFICATION void QgGraphics3D_setFrustum( QgGraphics3D *graphics3D,FIX left, FIX right, FIX bottom, FIX top, FIX near, FIX far ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_setFrustum SPECIFICATION void QgGraphics3D_setFrustum (QgGraphics3D * graphics3D, FIX left, FIX right, FIX bottom, FIX top, FIX near, FIX far) PARAMETERS Specifies the pointer of the graphics3D graphics object.

【0115】left,right 前クリップ面の左右の垂直座標を指定する。Left, right Specifies the left and right vertical coordinates of the front clip plane.

【0116】bottom,top 前クリップ面の上下の水平座標を指定する。Bottom, top Specify the horizontal coordinates of the top and bottom of the previous clip plane.

【0117】near,far クリップ面の奥行きである“near”と“far” 座標を指
定する。これらの値は視点からの距離を設定する。
Near, far The coordinates of “near” and “far”, which are the depth of the clip plane, are specified. These values set the distance from the viewpoint.

【0118】DESCRIPTION QgGraphics3D_setFrustumは、透視投影用の投影行列を
設定する。(left,bottom、-near)と(right,top,−
near)は、前クリップ面の左下と右上隅の座標を指定す
る。“−far”は後クリップ面の位置を指定する。“nea
r”と“far”は共に正数である必要がる。また、視点は
(0,0,0)であるとしている。このため、投影行列
Aij は以下のようになる。
Description QgGraphics3D_setFrustum sets a projection matrix for perspective projection. (left, bottom, -near) and (right, top,-
“near” specifies the coordinates of the lower left and upper right corners of the previous clip plane. "-Far" specifies the position of the rear clip plane. “Nea
“r” and “far” must both be positive numbers, and the viewpoint is (0, 0, 0).
Aij is as follows.

【0119】A11=(2*near)/(right−left) A12=0 A13=(right+left)/(right−left) A14=0 A21=0 A22=(2*near)/(top−bottom) A23=(top+bottom)/(top−bottom) A24=0 A31=0 A32=0 A33=−(far+near)/(far−near) A34=−(2*far*near)/(far−near) A41=0 A42=0 A43=−1 A44=0 この投影行列とカレント行列を乗算し、その結果がカレ
ント行列になる。つまり、“M”をカレント行列、
“F”をQgGraphics3D_setFrustum で設定した行列とす
ると、“M”は"M・F”で置換される。
A11 = (2 * near) / (right-left) A12 = 0 A13 = (right + left) / (right-left) A14 = 0 A21 = 0 A22 = (2 * near) / (top-bottom) A23 = (Top + bottom) / (top-bottom) A24 = 0 A31 = 0 A32 = 0 A33 =-(far + near) / (far-near) A34 =-(2 * far * near) / (far-near) A41 = 0 A42 = 0 A43 = −1 A44 = 0 This projection matrix is multiplied by the current matrix, and the result is the current matrix. That is, “M” is the current matrix,
If “F” is a matrix set by QgGraphics3D_setFrustum, “M” is replaced by “MF”.

【0120】必要に応じて、“QgGraphics3D_pushMatri
x”と“QgGraphics3D_popMatrix”で透視投影前の座標
系を保存できる。
If necessary, “QgGraphics3D_pushMatri
“x” and “QgGraphics3D_popMatrix” can save the coordinate system before perspective projection.

【0121】次にQgGraphics3D_setOrthographic関数の
仕様を示す。
Next, the specifications of the QgGraphics3D_setOrthographic function will be described.

【0122】QgGraphics3D_setOrthographic(QgGraphic
s3D *graphics3D,FIX left,FIX right,FIX bottom ,
FIX top,FIX near,FIX far)は平行投影用の投影行列
を設定する。left,right にはそれぞれ左右の垂直クリ
ップ面の座標を設定する。bottom,topにはそれぞれ上
下のクリップ面の座標を設定する。near,farにはクリ
ップ面の奥行きをそれぞれ設定する。
QgGraphics3D_setOrthographic (QgGraphic
s3D * graphics3D, FIX left, FIX right, FIX bottom,
FIX top, FIX near, and FIX far) set the projection matrix for parallel projection. Set the left and right coordinates of the left and right vertical clip planes. The coordinates of the upper and lower clip planes are set for bottom and top, respectively. The depth of the clip plane is set for near and far.

【0123】 METHOD NAME QgGraphics3D_setOrthographic SPECIFICATION void QgGraphics3D_setOrthographic( QgGraphics3D *graphics3D,FIX left, FIX right, FIX bottom, FIX top, FIX near, FIX far ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_setOrthographic SPECIFICATION void QgGraphics3D_setOrthographic (QgGraphics3D * graphics3D, FIX left, FIX right, FIX bottom, FIX top, FIX near, FIX far) PARAMETERS Specifies the pointer of the graphics3D graphics object.

【0124】left,right 左右の垂直クリップ面の座標を指定する。Left, right Specifies the coordinates of the left and right vertical clip planes.

【0125】bottom,top 上下の水平クリップ面の座標を指定する。Bottom, top Specifies the coordinates of the upper and lower horizontal clip planes.

【0126】near,far クリップ面の奥行きである“near”と“far” 座標を指
定する。これらの値は視点からの距離を設定する。
"Near", "far" Designate "near" and "far" coordinates, which are the depth of the clip plane. These values set the distance from the viewpoint.

【0127】DESCRIPTION QgGraphics3D_setOrthographicは、平行投影用の投影行
列を設定する。(left,bottom,−near)と(right,to
p,−near)は、前クリップ面の左下と右上隅の座標を指
定する。“−far”は後クリップ面の位置を指定する。
“near”と“far” は共に正/負のいずれかになる。ま
た、視点は(0,0,0)であるとしている。このた
め、投影行列Aijは以下のようになる。
Description QgGraphics3D_setOrthographic sets a projection matrix for parallel projection. (left, bottom, −near) and (right, to
p, -near) specifies the coordinates of the lower left and upper right corners of the previous clipping plane. "-Far" specifies the position of the rear clip plane.
“Near” and “far” are both positive / negative. The viewpoint is (0, 0, 0). Therefore, the projection matrix Aij is as follows.

【0128】A11=2/(right−left) A12=0 A13=0 A14=−(right+left)/(right−left) A21=0 A22=2/(top−bottom) A23=0 A24=−(top+bottom)/(top−bottom) A31=0 A32=0 A33=−2/(far−near) A34=−(far+near)/(far−near) A41=0 A42=0 A43=0 A44=1 この投影行列とカレント行列を乗算し、その結果がカレ
ント行列になる。つまり、“M”をカレント行列、
“0”をQgGraphics3D_setOrthographicで設定した行列
とすると、“M”は”M・O”で置換される。
A11 = 2 / (right-left) A12 = 0 A13 = 0 A14 =-(right + left) / (right-left) A21 = 0 A22 = 2 / (top-bottom) A23 = 0 A24 =-(top + bottom ) / (Top-bottom) A31 = 0 A32 = 0 A33 = -2 / (far-near) A34 =-(far + near) / (far-near) A41 = 0 A42 = 0 A43 = 0 A44 = 1 And the current matrix, and the result is the current matrix. That is, “M” is the current matrix,
If “0” is a matrix set by QgGraphics3D_setOrthographic, “M” is replaced by “MO”.

【0129】必要に応じて、“QgGraphics3D_pushMatri
x”と“QgGraphics3D_popMatrix”で平行投影前の座標
系を保存できる。
If necessary, “QgGraphics3D_pushMatri
“x” and “QgGraphics3D_popMatrix” can save the coordinate system before parallel projection.

【0130】次にQgGraphics3D_setMatrix関数とQgGrap
hics3D_getMatrix関数の仕様を示す。
Next, the QgGraphics3D_setMatrix function and the QgGraph
Shows the specification of hics3D_getMatrix function.

【0131】QgGraphics3D_setMatrix(QgGraphics3D *g
raphics3D,const QbMat *m)はカレント行列をmで指定
された行列で置換する。
QgGraphics3D_setMatrix (QgGraphics3D * g
raphics3D, const QbMat * m) replaces the current matrix with the matrix specified by m.

【0132】QgGraphics3D_getMatrix(QgGraphics3D *g
raphics3D,QbMat *m)はカレント行列をmに格納する。
QgGraphics3D_getMatrix (QgGraphics3D * g
raphics3D, QbMat * m) stores the current matrix in m.

【0133】 METHOD NAME QgGraphics3D_setMatrix QgGraphics3D_getMatrix SPECIFICATION void QgGraphics3D_setMatrix( QgGraphics3D *graphics3D、 const QbMat &m ) void QgGraphics3D_getMatrix( QgGraphics3D *graphics3D、 QbMat &m ) const PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。Method NAME QgGraphics3D_setMatrix QgGraphics3D_getMatrix SPECIFICATION void QgGraphics3D_setMatrix (QgGraphics3D * graphics3D, const QbMat & m) void QgGraphics3D_getMatrix (QgGrapsatm graphics and graphics object 3D_getMatrix)

【0134】m 16個の連続した値を行優先順に配列した“4*4”の
行列のポインタを指定する(得る)。
M A pointer of a “4 * 4” matrix in which 16 consecutive values are arranged in a row priority order is designated (obtained).

【0135】DESCRIPTION QgGraphics3D_setMatrixは、カレント行列を“m”で指
定した行列で置換する。また、QgGraphics3D_getMatrix
は、カレント行列を配列“m”に格納する。カレント行
列は、カレント行列のモードで設定されたモデルビュー
行列,投影行列のいずれかである(QgGraphics3D_setMat
rixModeを参照)。
Description QgGraphics3D_setMatrix replaces the current matrix with the matrix specified by "m". Also, QgGraphics3D_getMatrix
Stores the current matrix in the array "m". The current matrix is either the model view matrix or the projection matrix set in the current matrix mode (QgGraphics3D_setMat
See rixMode).

【0136】“m”は、行優先順に配列した32bit固
定小数点値(整数部:16bit,小数部:16bit)の
“4*4”の行列を指す。つまり、行列は以下のように
配列されている。
"M" indicates a "4 * 4" matrix of 32-bit fixed-point values (integer part: 16 bits, decimal part: 16 bits) arranged in row priority order. That is, the matrix is arranged as follows.

【0137】 | a0 a1 a2 a3 | | a4 a5 a6 a7 | | a8 a9 a10 a11 | | a12 a13 a14 a15 | 次にQgGraphics3D_setMatrixMode関数とQgGraphics3D_g
etMatrixMode関数の仕様を示す。QgGraphics3D_setMatr
ixMode(QgGraphics3D *graphics3D,enum mode)はカレン
ト行列のモードを設定する。カレント行列のモードとし
て、モデルビュー行列あるいは投影行列のどちらかをmo
deに設定する。
A0 a1 a2 a3 | | a4 a5 a6 a7 | | a8 a9 a10 a11 | | a12 a13 a14 a15 | Next, the QgGraphics3D_setMatrixMode function and the
Here is the specification of the etMatrixMode function. QgGraphics3D_setMatr
ixMode (QgGraphics3D * graphics3D, enum mode) sets the mode of the current matrix. Sets the mode of the current matrix to either the model view matrix or the projection matrix.
Set to de.

【0138】QgGraphics3D_getMatrixMode(QgGraphics3
D *graphics3D,short *mode)はQgGraphics3D_setMatr
ixModeで設定したカレント行列のモードを得る。
QgGraphics3D_getMatrixMode (QgGraphics3
D * graphics3D, short * mode) is QgGraphics3D_setMatr
Gets the mode of the current matrix set by ixMode.

【0139】 METHOD NAME QgGraphics3D_setMatrixMode QgGraphics3D_getMatrixMode SPECIFICATION void QgGraphics3D_setMatrixMode( QgGraphics3D *graphics3D, enum mode ) void QgGraphics3D_getMatrixMode( QgGraphics3D *graphics3D, short & mode ) const PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_setMatrixMode QgGraphics3D_getMatrixMode SPECIFICATION void QgGraphics3D_setMatrixMode (QgGraphics3D * graphics3D, enum mode) void QgGraphics3D_getMatrixMode for graphics objects 3D_getMatrixMode for QgGraphics3D_getMatrixMode (GgGraphics3D_graphics3D_graphicsDst Graphics3D graphics)

【0140】mode 行列演算の対象となる行列スタックを指定する(得
る)。次の2つのモードが有効である。
Mode Specifies (obtains) a matrix stack to be subjected to matrix operation. The following two modes are effective.

【0141】“QG_MODELVIEW”,“QG_PROJECTION”。“QG_MODELVIEW”, “QG_PROJECTION”.

【0142】DESCRIPTION QgGraphics3D_setMatrixModeは、カレント行列のモード
を設定する。また、QgGraphics3D_getMatrixModeは、カ
レント行列のモードを得る。“mode”は、次の2つの値
のいずれかをとる。
Description QgGraphics3D_setMatrixMode sets the mode of the current matrix. QgGraphics3D_getMatrixMode obtains the mode of the current matrix. “Mode” takes one of the following two values.

【0143】QG_MODELVIEW 行列演算の対象となる
行列スタックをモデルビュー行列にする。
QG_MODELVIEW The matrix stack to be subjected to the matrix operation is used as a model view matrix.

【0144】QG_PROJECTION 行列演算の対象となる
行列スタックを投影行列にする。 次にQgGraphics3D_pushMatrix関数とQgGraphics3D_popM
atrix関数の仕様を示す。QgGraphics3D_pushMatrix(QgG
raphics3D *graphics3D)はカレント行列スタックをプッ
シュする。
QG_PROJECTION The matrix stack to be subjected to the matrix operation is set as a projection matrix. Next, QgGraphics3D_pushMatrix function and QgGraphics3D_popM
Shows the specifications of the atrix function. QgGraphics3D_pushMatrix (QgG
raphics3D * graphics3D) pushes the current matrix stack.

【0145】QgGraphics3D_popMatrix(QgGraphics3D *g
raphics3D)はカレント行列スタックをポップする。
QgGraphics3D_popMatrix (QgGraphics3D * g
raphics3D) pops the current matrix stack.

【0146】 METHOD NAME QgGraphics3D_pushMatrix QgGraphics3D_popMatrix SPECIFICATION void QgGraphics3D_pushMatrix( QgGraphics3D *graphics3D ) void QgGraphics3D_popMatrix( QgGraphics3D *graphics3D ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。Method NAME QgGraphics3D_pushMatrix QgGraphics3D_popMatrix SPECIFICATION void QgGraphics3D_pushMatrix (QgGraphics3D * graphics3D) void QgGraphics3D_popMatrix (QgGraphics3D * graphics3D graphics object with graphics pointer 3D graphicsETERS)

【0147】DESCRIPTION 行列モード毎に夫々行列スタックが存在する。“QG_MOD
ELVIEW”モードでは、8段のスタックを持ち、“QG_PRO
JECTION"モードでは、2段のスタックを持つ。カレント
行列は、いずれのモードでも、そのモードのスタックの
最上位の行列である。
DESCRIPTION There is a matrix stack for each matrix mode. “QG_MOD
In “ELVIEW” mode, it has 8 stacks and “QG_PRO
In "JECTION" mode, it has a two-level stack. In either mode, the current matrix is the topmost matrix in the stack for that mode.

【0148】QgGraphics3D_pushMatrix は、カレントの
行列スタックをプッシュして、カレント行列をスタック
の最上部に複写する。つまり、QgGraphics3D_pushMatri
x の実行後は、スタックの最上部の行列はその下の行列
と等しいことを意味する。QgGraphics3D_popMatrix
は、カレント行列を1段下の行列と置換して、カレント
の行列スタックをポップする。初期設定では、スタック
各々には単位行列が1段のみ格納されている。
QgGraphics3D_pushMatrix pushes the current matrix stack and copies the current matrix to the top of the stack. In other words, QgGraphics3D_pushMatri
After executing x, this means that the matrix at the top of the stack is equal to the matrix below it. QgGraphics3D_popMatrix
Replaces the current matrix with the next lower matrix and pops the current matrix stack. In the initial setting, only one unit matrix is stored in each stack.

【0149】最大に格納されているスタックをプッシュ
したり、1つの行列しか格納されていないスタックをポ
ップした場合の動作は保証しない。
The operation when the stack stored at the maximum is pushed or when the stack storing only one matrix is popped is not guaranteed.

【0150】図22にモデルビュー行列と投影行列のス
タックを示す。
FIG. 22 shows a stack of the model view matrix and the projection matrix.

【0151】また、図23に行列スタックのプッシュと
ポップを示す。
FIG. 23 shows the push and pop of the matrix stack.

【0152】次にQgGraphics3D_setDepthRange関数の仕
様を示す。QgGraphics3D_setDepthRange(QgGraphics3D
*graphics3D,FIX near,FIX far)はZ値の物理デバイ
ス座標への線形写像を指定する。nearには前クリップ面
の物理デバイス座標への写像を設定する。far には後ク
リップ面の物理デバイス座標への写像を設定する。
Next, the specifications of the QgGraphics3D_setDepthRange function are shown. QgGraphics3D_setDepthRange (QgGraphics3D
* graphics3D, FIX near, FIX far) specifies a linear mapping of Z values to physical device coordinates. For near, a mapping to the physical device coordinates of the previous clip plane is set. For far, set the mapping of the rear clip plane to the physical device coordinates.

【0153】 METHOD NAME QgGraphics3D_setDepthRange SPECIFICATION void QgGraphics3D_setDepthRange(QgGraphics3D *graphics3D, FIX near , FIX far ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_setDepthRange SPECIFICATION void QgGraphics3D_setDepthRange (QgGraphics3D * graphics3D, FIX near, FIX far) PARAMETERS Specifies the pointer of the graphics3D graphics object.

【0154】near 前クリップ面の物理デバイス座標(PDC:Physical Device
Coordinates) 座標への写像を指定する。初期値は
“0.0"である。
Near Physical device coordinates (PDC: Physical Device) of the front clip plane
Coordinates) Specifies the mapping to coordinates. The initial value is "0.0".

【0155】far 後クリップ面の物理デバイス座標への写像を指定する。
初期値は“1.0” である。
The mapping of the post-far clip plane to the physical device coordinates is specified.
The initial value is "1.0".

【0156】DESCRIPTION クリッピング、“w”による除算の後、“z”座標は遠
近のクリップ面に対抗して[−1.0,1.0]の範囲
に設定される。
After the description clipping and division by "w", the "z" coordinate is set in the range [-1.0, 1.0] against the near and near clip plane.

【0157】QgGraphics3D_setDepthRangeは、この範囲
の正規化“z”値から物理デバイスの“z”値(範囲は
[0.0,1.0])への線形写像を指定する。
QgGraphics3D_setDepthRange specifies a linear mapping from the normalized “z” value in this range to the “z” value of the physical device (range is [0.0, 1.0]).

【0158】写像の初期値は、[0.0,1.0]であ
り、前クリップ面を“0.0” 、後クリップ面を“1.
0” に写像する。この場合の写像でデプスバッファの
範囲は最大限に活用される。
The initial value of the mapping is [0.0, 1.0]. The front clip plane is "0.0", and the rear clip plane is "1.
0 ". The mapping in this case makes the best use of the depth buffer range.

【0159】次にQgGraphics3D_setViewportRegion関数
の仕様を示す。QgGraphics3D_setViewportRegion(QgGra
phics3D *graphics3D,FIX x,FIX y,FIX width, FI
X height)は最終画像を写像するピクセル方形を設定す
る。写像の際にはクリッピング座標から物理デバイス座
標に変換される。x,y,width,height にはそれぞれ
ビューポート方形の左下隅の座標,幅,高さを設定す
る。
Next, the specifications of the QgGraphics3D_setViewportRegion function are shown. QgGraphics3D_setViewportRegion (QgGra
phics3D * graphics3D, FIX x, FIX y, FIX width, FI
X height) sets the pixel square that maps the final image. In mapping, the coordinates are converted from the clipping coordinates to the physical device coordinates. For x, y, width, and height, set the coordinates, width, and height of the lower left corner of the viewport rectangle, respectively.

【0160】 METHOD NAME QgGraphics3D_setViewportRegion SPECIFICATION void QgGraphics3D_setViewportRegion(QgGraphics3D *graphics3D,FIX x , FIX y, FIX width, FIX height ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_setViewportRegion SPECIFICATION void QgGraphics3D_setViewportRegion (QgGraphics3D * graphics3D, FIXx, FIXy, FIXwidth, FIXheight) PARAMETERS Specifies the pointer of the graphics3D graphics object.

【0161】x,y PDCにおけるビューポート方形の左下隅の座標を指定
する。
X, y Specify the coordinates of the lower left corner of the viewport rectangle in the PDC.

【0162】width,height PDCにおけるビューポート方形の幅と高さを指定す
る。
Width, height Specifies the width and height of the viewport rectangle in the PDC.

【0163】DESCRIPTION QgGraphics3D_setViewportRegionは、クリッピング座標
(CC:ClippingCoordinates)から物理デバイス座標(PD
C)に座標系を変換する。
Description QgGraphics3D_setViewportRegion is the clipping coordinates
(CC: ClippingCoordinates) to physical device coordinates (PD
Convert the coordinate system to C).

【0164】ビューポートの幅と高さは、動作環境に影
響される範囲(幅:QG_DISPLAY_WIDTH,高さ:QG_DISPLAY_
HEIGHT)を越えた場合、無条件にその範囲にクランプさ
れる。変換行列Aijは以下の通り。
The width and height of the viewport are in the range affected by the operating environment (width: QG_DISPLAY_WIDTH, height: QG_DISPLAY_
If (HEIGHT) is exceeded, it is unconditionally clamped to that range. The transformation matrix Aij is as follows.

【0165】A11=(width−1)/2 A12=0 A13=0 A14=x+(width−1)/2 A21=0 A22=−(height−1)/2 A23=0 A24=QG_DISPLAY_HEIGHT−y−(height+1)/2 A31=0 A32=0 A33=(far−near)/2 A34=(far+near)/2 A41=0 A42=0 A43=0 A44=1 ここで、near及びfarは、QgGraphics3D_setDepthRange
で指定された値である。
A11 = (width−1) / 2 A12 = 0 A13 = 0 A14 = x + (width−1) / 2 A21 = 0 A22 = − (height−1) / 2 A23 = 0 A24 = QG_DISPLAY_HEIGHT−y− (height + 1) / 2 A31 = 0 A32 = 0 A33 = (far-near) / 2 A34 = (far + near) / 2 A41 = 0 A42 = 0 A43 = 0 A44 = 1 Here, near and far are QgGraphics3D_setDepthRange
Is the value specified in.

【0166】次にQgGraphics3D_setMaterial関数の仕様
を示す。QgGraphics3D_setMaterial(QgGraphics3D *gr
aphics,enum valueName,const FIX *values)は輝度計
算に用いる材質のパラメータを設定する。valueName に
は設置したいパラメータの種類を設定する。また、valu
e にはパラメータを設定する。環境光のR,G,B,A
の反射係数、拡散光のR,G,B,Aの反射係数、鏡面
光のR,G,B,Aの反射係数、放射光のR,G,B,
Aの放射輝度、または鏡面光のR,G,B,Aの指数が
設定できる。
Next, the specifications of the QgGraphics3D_setMaterial function will be described. QgGraphics3D_setMaterial (QgGraphics3D * gr
aphics, enum valueName, and const FIX * values) set the parameters of the material used for luminance calculation. Set the type of parameter to be set in valueName. Also, valu
Set parameters in e. Ambient light R, G, B, A
, R, G, B, and A reflection coefficients of diffused light, R, G, B, and A reflection coefficients of specular light, and R, G, B, and radiated light.
The radiance of A or the index of R, G, B, and A of specular light can be set.

【0167】 METHOD NAME QgGraphics3D_setMaterial SPECIFICATION void QgGraphics3D_setMaterial( QgGraphics3D *graphics3D,enum value Name, const FIX *values ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_setMaterial SPECIFICATION void QgGraphics3D_setMaterial (QgGraphics3D * graphics3D, enum value Name, const FIX * values) PARAMETERS Specifies the pointer of the graphics3D graphics object.

【0168】valueName 値を設定したい材質のパラメータの種類を、“QG_AMBIE
NT”,“QG_DIFFUSE”,“QG_SPECULAR”,“QG_EMISSI
ON”,“QG_SHININESS”のいずれかで指定する。
ValueName The parameter type of the material whose value is to be set is set to “QG_AMBIE
NT "," QG_DIFFUSE "," QG_SPECULAR "," QG_EMISSI
ON "or" QG_SHININESS ".

【0169】values “valueName”に設定する値のポインタを指定する。Values Specifies a pointer to the value to be set in "valueName".

【0170】DESCRIPTION QgGraphics3D_setMaterialは、カレントの材質パラメー
タ(前方面)を指定する。このパラメータは、全てのプリ
ミティブの輝度計算に用いられる。
Description QgGraphics3D_setMaterial specifies the current material parameter (front surface). This parameter is used for luminance calculation of all primitives.

【0171】QgGraphics3D_setMaterialで指定するパラ
メータは次の意味を持つ。
The parameter specified by QgGraphics3D_setMaterial has the following meaning.

【0172】QG_AMBIENT “values”は、環境光RGBAの反射係数である4つの
固定小数点値である(Q3では浮動小数点サポート予
定)。値の範囲は無制限であるが、[0.0,1.0]が
よく用いられる。前方面の材質パラメータの環境光の反
射係数の初期値は(0.2,0.2,0.2,1.0)であ
る。
QG_AMBIENT “values” are four fixed-point values which are the reflection coefficients of the ambient light RGBA (floating point support is planned for Q3). The value range is unlimited, but [0.0, 1.0] is often used. The initial value of the environmental light reflection coefficient of the material parameter of the front surface is (0.2, 0.2, 0.2, 1.0).

【0173】QG_DIFFUSE “values”は、拡散光RGBAの反射係数である4つの
固定小数点値である(Q3では浮動小数点サポート予
定)。値の範囲は無制限であるが、[0.0,1.0]が
よく用いられる。前方面の材質パラメータの拡散光の反
射係数の初期値は(0.8,0.8,0.8,1.0)であ
る。
QG_DIFFUSE “values” are four fixed-point values which are the reflection coefficients of the diffused light RGBA (floating point support is planned for Q3). The value range is unlimited, but [0.0, 1.0] is often used. The initial value of the reflection coefficient of the diffused light of the material parameter of the front surface is (0.8, 0.8, 0.8, 1.0).

【0174】QG_SPECULAR “values”は、鏡面光RGBAの反射係数である4つの
固定小数点値である(Q3では浮動小数点サポート予
定)。値の範囲は無制限であるが、[0.0,1.0]が
よく用いられる。前方面の材質パラメータの鏡面光の反
射係数の初期値は(0.0,0.0,0.0,1.0)であ
る。
QG_SPECULAR “values” are four fixed-point values which are reflection coefficients of specular light RGBA (floating point support will be made in Q3). The value range is unlimited, but [0.0, 1.0] is often used. The initial value of the reflection coefficient of the mirror light of the material parameter of the front surface is (0.0, 0.0, 0.0, 1.0).

【0175】QG_EMISSION “values”は、放射光RGBAの放射輝度である4つの
固定小数点値である(Q3では浮動小数点サポート予
定)。値の範囲は無制限であるが、[0.0,1.0]がよ
く用いられる。前方面の材質パラメータの放射光の放射
輝度の初期値は(0.0,0.0,0.0,1.0)であ
る。
QG_EMISSION “values” are four fixed-point values that are the radiance of the emitted light RGBA (floating point support is planned for Q3). The value range is unlimited, but [0.0, 1.0] is often used. The initial value of the radiance of the radiated light of the material parameter of the front surface is (0.0, 0.0, 0.0, 1.0).

【0176】QG_SHININESS “values”は、鏡面光RGBAの指数である1つの固定
小数点値である(Q3では浮動小数点サポート予定)。
値は[0.0,128.0]が有効である。この範囲以外
の値を指定した場合、動作の保証はしない。前方面の材
質パラメータの鏡面光の指数の初期値は0.0 である。
QG_SHININESS “values” is one fixed-point value which is an index of specular light RGBA (floating point support will be made in Q3).
The value [0.0, 128.0] is effective. If a value outside this range is specified, the operation is not guaranteed. The initial value of the index of the specular light of the material parameter of the front surface is 0.0.

【0177】次にQgGraphics3D_setLightModel関数の仕
様を示す。QgGraphics3D_setLightModel(QgGraphics3D
*graphics,enum valueName,const FIX *values)は輝
度計算に用いる照光モデルのパラメータを設定する。
Next, the specifications of the QgGraphics3D_setLightModel function will be described. QgGraphics3D_setLightModel (QgGraphics3D
* graphics, enum valueName, const FIX * values) sets the parameters of the illumination model used for luminance calculation.

【0178】 METHOD NAME QgGraphics3D_setLightModel SPECIFICATION void QgGraphics3D_setLightModel( QgGraphics3D *graphics3D,enum valueName, const FIX *values ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_setLightModel SPECIFICATION void QgGraphics3D_setLightModel (QgGraphics3D * graphics3D, enum valueName, const FIX * values) PARAMETERS Specifies the pointer of the graphics3D graphics object.

【0179】valueName 値を設定したい照光モデルのパラメータの種類を、“QG
_GLOBAL_AMBIENT"で指定する。
ValueName The parameter type of the illumination model whose value is to be set is set to “QG
_GLOBAL_AMBIENT ".

【0180】values “valueName”に設定する値のポインタを指定する。Values Specifies a pointer to the value to be set in "valueName".

【0181】DESCRIPTION QgGraphics3D_setLightModelは、カレントの照光モデル
のパラメータを指定する。このパラメータは、全てのプ
リミティブの輝度計算に用いられる。
Description QgGraphics3D_setLightModel specifies the parameters of the current illumination model. This parameter is used for luminance calculation of all primitives.

【0182】QgGraphics3D_setLightModelで指定するパ
ラメータは次の意味を持つ。
The parameter specified by QgGraphics3D_setLightModel has the following meaning.

【0183】QG_GLOBAL_AMBIENT “values”は、全景の環境光RGBAの輝度である4つ
の固定小数点値である(Q3では浮動小数点サポート予
定)。値の範囲は無制限であるが、[0.0,1.0]が
よく用いられる。全景の環境光の輝度の初期値は(0.
2,0.2,0.2,1.0)である。
QG_GLOBAL_AMBIENT “values” are four fixed-point values which are the luminance of the ambient light RGBA of the whole scene (floating point support is planned in Q3). The value range is unlimited, but [0.0, 1.0] is often used. The initial value of the ambient light brightness of the whole view is (0.
2, 0.2, 0.2, 1.0).

【0184】RGBAモードにおける輝度計算の方程式
を以下に示す。面の任意の点における輝度計算後の輝度
をIとすると、Iは、全景の環境反射光成分Ig及び材
質の放射反射光成分Ieと、有効な光源の環境反射光成
分Ia,拡散反射光成分Id,鏡面反射光成分Isの合
計となる(RGBの各成分は、下式 により独立に計算
する)。
The equation for calculating the luminance in the RGBA mode is shown below. Assuming that the luminance at an arbitrary point on the surface after the luminance calculation is I, I is the environment reflection light component Ig of the whole view and the radiation reflection light component Ie of the material, the environment reflection light component Ia of the effective light source, and the diffuse reflection light component. Id and the sum of the specular reflected light component Is (the RGB components are independently calculated by the following formula).

【0185】 ここで、変数の意味は下記のとおりである。[0185] Here, the meanings of the variables are as follows.

【0186】NUM:有効な光源数 N:法線ベクトル L:光源方向ベクトル Ldir:光源ベクトル H:(V+L)/|V+L| V:視点方向ベクトル dropOffRate:スポット光源の強さ指数 shininess:鏡面光の強さ指数 La:光源の環境光輝度 Ld:光源の拡散光輝度 Ls:光源の鏡面光輝度 Latt:光源の減衰係数 Ka:材質の環境光反射係数 Kd:材質の拡散光反射係数 Ks:材質の鏡面光反射係数 Ke:材質の放射光輝度 次にQgGraphics3D_setLight関数の仕様を示す。QgGraph
ics3D_setLight(QgGraphics3D *graphics,enum light
No,enum valueName,const FIX*values)は輝度計算
に用いる複数個の光源のパラメータを設定する。lightN
oにはパラメータを設定したい光源の番号を設定する。v
alueName には光源のパラメータの種類を設定可能であ
り、光源の種類として平行光源,点光源,スポット光源
のいずれかが有効である。あるいは、モデルクリッピン
グ座標系における光源の座標を設定できる。あるいは、
環境光のR,G,B,Aの輝度の各成分、拡散光のR,
G,B,Aの輝度の各成分、または鏡面光のR,G,
B,Aの輝度の各成分が設定可能である。あるいは、光
源の減衰係数、スポット光源のスポット指数、スポット
光源の最大放射角度、またはモデルクリッピング座標系
におけるスポット光源の方向を設定することが可能であ
る。
NUM: number of effective light sources N: normal vector L: light source direction vector Ldir: light source vector H: (V + L) / | V + L | V: viewpoint direction vector dropOffRate: intensity index of spot light source shininess: mirror light Intensity index La: Ambient light brightness of light source Ld: Diffusion light brightness of light source Ls: Specular brightness of light source Latt: Attenuation coefficient of light source Ka: Ambient light reflection coefficient of material Kd: Diffusion light reflection coefficient of material Ks: Material Specular light reflection coefficient Ke: Radiant light intensity of material Next, the specifications of the QgGraphics3D_setLight function are shown. QgGraph
ics3D_setLight (QgGraphics3D * graphics, enum light
No, enum valueName, const FIX * values) set the parameters of multiple light sources used for luminance calculation. lightN
For o, set the number of the light source for which you want to set parameters. v
The parameter type of the light source can be set in alueName, and any of the parallel light source, point light source, and spot light source is effective as the light source type. Alternatively, the coordinates of the light source in the model clipping coordinate system can be set. Or,
R, G, B, A luminance components of ambient light, R,
Each component of luminance of G, B, A, or R, G,
Each component of the luminance of B and A can be set. Alternatively, the attenuation coefficient of the light source, the spot index of the spot light source, the maximum emission angle of the spot light source, or the direction of the spot light source in the model clipping coordinate system can be set.

【0187】 METHOD NAME QgGraphics3D_setLight SPECIFICATION void QgGraphics3D_setLight( QgGraphics3D *graphics3D,enum lightNo ,enum valueName, const FIX *values ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。METHOD NAME QgGraphics3D_setLight SPECIFICATION void QgGraphics3D_setLight (QgGraphics3D * graphics3D, enum lightNo, enum valueName, const FIX * values) PARAMETERS Specifies the pointer of the graphics3D graphics object.

【0188】lightNo 値を設定したい光源の番号を、“QG_LIGHTi”で指定す
る。但し、iは0≦i≦3である。
The number of the light source whose lightNo value is to be set is designated by “QG_LIGHTi”. Here, i is 0 ≦ i ≦ 3.

【0189】valueName 値を設定したい光源のパラメータの種類を、“QG_AMBIE
NT”,“QG_DIFFUSE”,“QG_SPECULAR”,“QG_EMISSI
ON”,“QG_SHININESS”のいずれかで指定する。
ValueName The type of the light source parameter whose value is to be set is set to “QG_AMBIE
NT "," QG_DIFFUSE "," QG_SPECULAR "," QG_EMISSI
ON "or" QG_SHININESS ".

【0190】values “valueName"に設定する値のポインタを指定する。Values Specifies a pointer to the value to be set in "valueName".

【0191】DESCRIPTION QgGraphics3D_setLight は、光源のパラメータを指定す
る。指定できる光源数は4つである。輝度計算は、引き
数“QG_LIGHTING”の“QgGraphics3D_enable”,“QgGr
aphics3D_disable”によって、有効/無効にできる。初
期設定は、無効である。輝度計算が有効な場合には、有
効になっている光源が輝度計算に用いられる。光源
“i”は、引き数“QG_LIGHTi”の“QgGraphics3D_enab
le”,“QgGraphics3D_disable”によって、有効/無効
にできる。QgGraphics3D_setLightで指定するパラメー
タは次の意味を持つ。
Description QgGraphics3D_setLight specifies the parameters of the light source. The number of light sources that can be specified is four. The brightness calculation is performed using the “QgGraphics3D_enable” and “QgGr” of the argument “QG_LIGHTING”.
It can be enabled / disabled by “aphics3D_disable”. The default setting is disabled. When the brightness calculation is enabled, the enabled light source is used for the brightness calculation. The light source “i” is an argument “QG_LIGHTi”. “QgGraphics3D_enab”
le "and" QgGraphics3D_disable "to enable / disable the parameter specified by QgGraphics3D_setLight has the following meaning.

【0192】QG_TYPE “values”は、光源の種類である。光源の種類は、平行
光源,点光源(Q3サポート予定),スポット光源(Q
3サポート予定)が有効である。
QG_TYPE “values” is the type of light source. Light source types are parallel light source, point light source (Q3 will be supported), spot light source (Q
3 support planned) is effective.

【0193】 平行光源 QG_DIRECTIONAL_LIGHT 点光源 QG_DIRECTIONAL_LIGHT スポット光源 QG_DIRECTIONAL_LIGHT QG_POSITION “values”は、MC座標系における光源の位置である3
つの固定小数点値である(Q3では浮動小数点サポート
予定)。QgGraphics3D_setLight を実行した場合、モデ
ルビュー行列でVRC座標系に変換された後保存される。
Parallel light source QG_DIRECTIONAL_LIGHT Point light source QG_DIRECTIONAL_LIGHT Spot light source QG_DIRECTIONAL_LIGHT QG_POSITION “values” is the position of the light source in the MC coordinate system.
There are two fixed point values (floating point support is planned for Q3). When QgGraphics3D_setLight is executed, it is saved after being converted to the VRC coordinate system by the model view matrix.

【0194】QG_AMBIENT “values”は、環境光RGBAの輝度である4つの固定
小数点値である(Q3では浮動小数点サポート予定)。
値の範囲は無制限であるが、[0.0,1.0]がよく用
いられる。光源パラメータの環境光の輝度の初期値は
(0.0,0.0,0.0,1.0)である。
QG_AMBIENT “values” are four fixed-point values which are the luminance of the ambient light RGBA (floating point support is planned for Q3).
The value range is unlimited, but [0.0, 1.0] is often used. The initial value of the luminance of the ambient light of the light source parameter is (0.0, 0.0, 0.0, 1.0).

【0195】QG_DIFFUSE “values”は、拡散光RGBAの輝度である4つの固定
小数点値である(Q3では浮動小数点サポート予定)。
値の範囲は無制限であるが、[0.0,1.0]がよく用
いられる。光源パラメータの拡散光の輝度の初期値は
(0.0,0.0,0.0,1.0)である。
QG_DIFFUSE “values” are four fixed-point values that are the luminance of the diffused light RGBA (floating point support is planned for Q3).
The value range is unlimited, but [0.0, 1.0] is often used. The initial value of the luminance of the diffused light of the light source parameter is (0.0, 0.0, 0.0, 1.0).

【0196】QG_SPECULAR “values”は、鏡面光RGBAの輝度である4つの固定
小数点値である(Q3では浮動小数点サポート予定)。
値の範囲は無制限であるが、[0.0,1.0]がよく用
いられる。光源パラメータの鏡面光の輝度の初期値は
(0.0,0.0,0.0,1.0)である。
QG_SPECULAR "values" are four fixed-point values which are the luminance of the specular light RGBA (floating point support is planned for Q3).
The value range is unlimited, but [0.0, 1.0] is often used. The initial value of the luminance of the specular light of the light source parameter is (0.0, 0.0, 0.0, 1.0).

【0197】QG_ATTENUATION “values”は、光源の減衰要素である3つ(定数要素,
1次要素,2次要素)の固定小数点値である(Q3では
浮動小数点サポート予定)。値は、負の数以外が有効で
ある。これは、位置的なものに影響し、定数要素,1次
要素×光源と照光される点との距離,2次要素×同距離
の自乗の合計の逆数で減衰する。光源パラメータの減衰
要素の初期値は(1.0,0.0,0.0)であり、減衰は
起こらない。
QG_ATTENUATION “values” are three (constant elements,
It is a fixed-point value of the primary element and the secondary element) (floating point support is planned in Q3). A value other than a negative number is valid. This affects the position, and attenuates by the reciprocal of the sum of the constant element, the primary element × the distance between the light source and the illuminated point, and the secondary element × the square of the same distance. The initial value of the attenuation factor of the light source parameter is (1.0, 0.0, 0.0), and no attenuation occurs.

【0198】QG_DROP_OFF_RATE “values”は、スポット光源のスポット指数(輝度分
布)である1つの整数値である(Q3では浮動小数点サ
ポート予定)。値の範囲は、[0,128]のみ有効で
あり、更に8の倍数である必要がある。このスポット指
数が大きいほど光源は絞られる。光源パラメータのスポ
ット指数の初期値は0であり、光の分布は均一となる。
QG_DROP_OFF_RATE “values” is one integer value which is the spot index (luminance distribution) of the spot light source (floating point support is planned in Q3). The value range is only valid for [0,128] and must be a multiple of eight. The larger the spot index, the narrower the light source. The initial value of the spot index of the light source parameter is 0, and the light distribution is uniform.

【0199】QG_CUT_OFF_ANGLE “values”は、スポット光源の最大放射角度である1つ
の固定小数点値である(Q3では浮動小数点サポート予
定)。値の範囲は、[0.0,90.0]のみ有効であ
る。
QG_CUT_OFF_ANGLE “values” is one fixed-point value that is the maximum radiation angle of the spot light source (floating point support is planned in Q3). The range of values is only valid for [0.0, 90.0].

【0200】QG_DIRECTION “values”は、MC座標系におけるスポット光源の方向
である3つの固定小数点値である(Q3では浮動小数点
サポート予定)。QgGraphics3D_setLight を実行した場
合、モデルビュー行列の逆行列の転置行列でVRC座標
系に変換された後保存される。光源パラメータのスポッ
ト光源の方向の初期値は(0.0,0.0,−1.0)であ
る。
QG_DIRECTION “values” are three fixed point values which are the directions of the spot light source in the MC coordinate system (floating point support will be made in Q3). When QgGraphics3D_setLight is executed, it is saved after being transformed into the VRC coordinate system by the transpose of the inverse matrix of the model view matrix. The initial value of the direction of the spot light source of the light source parameter is (0.0, 0.0, -1.0).

【0201】次にQgGraphics3D_setShadeModel関数とQg
Graphics3D_getShadeModel関数の仕様を示す。QgGraphi
cs3D_setShadeModel(QgGraphics3D *graphics,enum mo
de)はシェーディング方法を設定する。シェーディング
方法にはフラットシェーディング,グーロシェーディン
グ,フォンシェーディングがあり、いずれかをmodeに設
定する。
Next, the QgGraphics3D_setShadeModel function and Qg
Shows the specifications of Graphics3D_getShadeModel function. QgGraphi
cs3D_setShadeModel (QgGraphics3D * graphics, enum mo
de) sets the shading method. There are flat shading, Gouraud shading, and Phong shading as shading methods, and one of them is set to mode.

【0202】QgGraphics3D_getShadeModel(QgGraphics
3D *graphics3D,short *mode)はQgGraphics3D_setSha
deModelで設定したシェーディング方法の情報を得る。
QgGraphics3D_getShadeModel (QgGraphics
3D * graphics3D, short * mode) is QgGraphics3D_setSha
Obtains information on the shading method set in deModel.

【0203】 METHOD NAME QgGraphics3D_setShadeModel QgGraphics3D_getShadeModel SPECIFICATION void QgGraphics3D_setShadeModel(QgGraphics3D *graphics3D, enum mode) void QgGraphics3D_getShadeModel( QgGraphics3D *graphics3D, short *mode ) const PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。Method NAME QgGraphics3D_setShadeModel QgGraphics3D_getShadeModel SPECIFICATION void QgGraphics3D_setShadeModel (QgGraphics3D * graphics3D, enum mode) void QgGraphics3D_getShadeModel (QgGraphics3D * getShade3)

【0204】mode シェーディングの手法を、“QG_FLAT",“QG_GAURAUD"
(Q3サポート予定),“QG_PHONG"(Q3サポート予定)で指
定する(得る)。
The mode shading method is set to “QG_FLAT”, “QG_GAURAUD”
Specify (obtain) with (Q3 support planned) and "QG_PHONG" (Q3 support planned).

【0205】DESCRIPTION QgGraphics3D_setShadeModelは、カレントのシェーディ
ング手法を指定する。また、QgGraphics3D_getShadeMod
elは、カレントのシェーディング手法を得る。シェーデ
ィング手法には、フラットシェーディング,グーロシェ
ーディング,フォンシェーディングの3種類が有効であ
る。初期設定のフラットシェーディングである。
Description QgGraphics3D_setShadeModel specifies the current shading method. Also, QgGraphics3D_getShadeMod
el gets the current shading method. Three types of shading methods, flat shading, Gouraud shading, and Phong shading, are effective. This is the default flat shading.

【0206】QG_FLAT 最も簡単なシェーディング手法であり、平面であるポリ
ゴンをそのままフラットな平面として表す。即ち、ポリ
ゴン内を同一色で濃淡付けするため、計算量が少なく高
速な画像生成が可能であるが、計算結果の画像はリアル
とは言い難い。 QG_GAURAUD フラットシェーディングでは、ポリゴン内を同一色で濃
淡付けするが、グーロシェーディングでは、ポリゴン頂
点の色をポリゴン内で線形に補間することにより、平面
ではなく近似的な曲面を表現することができる。しか
し、色による補間は複雑な曲面表現には不向きであり、
マッハバンドと呼ばれる縞模様が物体表面に出現する可
能性がある。
QG_FLAT This is the simplest shading method, and represents a plane polygon as it is as a flat plane. That is, since the same color is shaded in the polygon, the amount of calculation is small and high-speed image generation is possible, but the image of the calculation result is hardly real. QG_GAURAUD In flat shading, the inside of a polygon is shaded with the same color. In Gouraud shading, an approximate curved surface can be expressed instead of a plane by linearly interpolating the colors of the polygon vertices within the polygon. However, interpolation by color is not suitable for complex surface expression,
A striped pattern called a Mach band may appear on the object surface.

【0207】QG_PHONG フォンシェーディングでは、グーロシェーディングで行
っていた色の補間ではなく、ポリゴンが持つ法線ベクト
ルの補間を行うことにより、マッハバンドの発生を防ぐ
ことができる。更に、フォンシェーディングは、光源か
ら物体に反射して目に至る鏡面反射成分(スペキュラ成
分)をサポートするため、物体表面に発生する特別明る
い部分(ハイライト)の表現が可能である。
In QG_PHONG phone shading, generation of a Mach band can be prevented by performing interpolation of normal vectors of polygons instead of interpolation of colors performed in Gouraud shading. Further, since the Phong shading supports a specular reflection component (specular component) that is reflected from the light source to the object and reaches the eyes, it is possible to express a special bright portion (highlight) generated on the surface of the object.

【0208】図24にフラットシェーディングに用いる
代表色を算出するためのルールを示す。
FIG. 24 shows rules for calculating a representative color used for flat shading.

【0209】次にQgGraphics3D_enable関数とQgGraphic
s3D_disable関数の仕様を示す。 QgGraphics3D_enable
(QgGraphics3D *graphics、enum cap)は輝度計算,光
源,隠面消去の各機能を有効にする。cap に有効にした
い機能を設定する。
Next, the QgGraphics3D_enable function and the QgGraphic
Shows the specification of s3D_disable function. QgGraphics3D_enable
(QgGraphics3D * graphics, enum cap) enables brightness calculation, light source and hidden surface removal. Set the function you want to enable in cap.

【0210】QgGraphics3D_disable(QgGraphics3D *gra
phics,enum cap)はQgGraphics3D_enable で有効になっ
ている機能を無効にする。capに無効にしたい機能を設
定する。
QgGraphics3D_disable (QgGraphics3D * gra
phics, enum cap) disables the features enabled by QgGraphics3D_enable. Set the function to be disabled in cap.

【0211】 METHOD NAME QgGraphics3D_enable QgGraphics3D_disable SPECIFICATION void QgGraphics3D_enable( QgGraphics3D *graphics3D, enum cap ) void QgGraphics3D_disable( QgGraphics3D *graphics3D, enum cap ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。Method NAME QgGraphics3D_enable QgGraphics3D_disable SPECIFICATION void QgGraphics3D_enable (QgGraphics3D * graphics3D, enum cap) void QgGraphics3D_disable (QgGraphics3D * graphics3D for graphics object of graphics graphics object 3D, enum caps)

【0212】cap 有効にしたい機能を指定する。“QG_LIGHTING”,“QG_
LIGHTi”(但し、0≦i≦3),“QG_HSR”が指定可能
である。
Cap Specifies the function to be activated. “QG_LIGHTING”, “QG_
LIGHTi ”(where 0 ≦ i ≦ 3) and“ QG_HSR ”can be specified.

【0213】DESCRIPTION QgGraphics3D_enableは、指定された機能を有効にし、Q
gGraphics3D_disableは、指定された機能を無効にす
る。引き数としては、以下のものが有効である。 QG_LIGHTING 有効な場合、輝度計算を行う。
Description QgGraphics3D_enable enables the specified function,
gGraphics3D_disable disables the specified function. The following are valid arguments. QG_LIGHTING If enabled, calculate brightness.

【0214】QG_LIGHTi 有効な場合、光源"i"による影響を考慮し輝度計算を行
う。
QG_LIGHTi When valid, brightness calculation is performed in consideration of the influence of the light source "i".

【0215】QG_HSR 有効な場合、隠面消去を行う。QG_HSR If valid, erase hidden surface.

【0216】次にQgGraphics3D_setHint関数の仕様を示
す。QgGraphics3D_setHint(QgGraphics3D *graphics3
D,enum target,short hint)はヒントを設定する対象
とその値を示す。targetには、ヒントとして設定したい
種類を設定する。また、hintにはtargetで指定した種類
に、設定したい値を設定する。
Next, the specifications of the QgGraphics3D_setHint function will be described. QgGraphics3D_setHint (QgGraphics3D * graphics3
D, enum target, and short hint) indicate the target for setting the hint and its value. For target, set the type you want to set as a hint. In hint, set the value to be set to the type specified by target.

【0217】 METHOD NAME QgGraphics3D_setHint SPECIFICATION void QgGraphics3D_setHint( QgGraphics3D *graphics3D, enum target、 s hort hint ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。Method NAME QgGraphics3D_setHint SPECIFICATION void QgGraphics3D_setHint (QgGraphics3D * graphics3D, enum target, short hint) PARAMETERS Specifies a pointer to a graphics3D graphics object.

【0218】target ヒントとして、設定したい種類を指定する。The type to be set is specified as a target hint.

【0219】hint targetで指定された種類に設定したい値を設定する。A value to be set to the type specified by hint target is set.

【0220】DESCRIPTION QgGraphics3D_setHintは、ヒントを設定する対象とその
値(ヒント)を設定する。targetには値を設定したい種類
を指定する。QG_LIGHTING_HINTを設定すると、輝度計算
に用いる環境光/拡散光/鏡面光を制御できる。target
にQG_LIGHTING_HINTが設定された場合、環境光/拡散光
/鏡面光の制御はそれぞれQG_AMPBIEN/QG_DIFFUSE/QG
_SPECULAR で行う。複数の種類を同時に指定したけれ
ば、論理和で設定する。
Description QgGraphics3D_setHint sets a hint setting target and its value (hint). For target, specify the type whose value you want to set. By setting QG_LIGHTING_HINT, it is possible to control the ambient light / diffuse light / specular light used for luminance calculation. target
When QG_LIGHTING_HINT is set to, the ambient light / diffuse light / specular light control is QG_AMPBIEN / QG_DIFFUSE / QG
Perform with _SPECULAR. If you want to specify multiple types at the same time, set them by OR.

【0221】QG_AMPBIENT 環境光を処理するモード QG_DIFFUSE 拡散光を処理するモード QG_SPECULAR 鏡面光を処理するモード 次にQgGraphics3D_setHiddenSurfaceRemovalType関数と
QgGraphics3D_getHiddenSurfaceRemovalType関数の仕様
を示す。QgGraphics3D_setHiddenSurfaceRemovalType(Q
gGraphics3D *graphics,enum type)は隠面消去のタイ
プをtypeに設定する。隠面消去タイプにはZバッファ法
と、描画図形の第一頂点のZ値を代表値としたZソート
法,描画図形の頂点の最小Z値を代表値としたZソート
法、そして描画図形の重心のZ値を代表値としたZソー
ト法のいずれかが設定可能である。隠面消去のタイプは
typeに設定する。
QG_AMPBIENT Mode for processing ambient light QG_DIFFUSE Mode for processing diffused light QG_SPECULAR Mode for processing specular light Next, QgGraphics3D_setHiddenSurfaceRemovalType function
Shows the specifications of QgGraphics3D_getHiddenSurfaceRemovalType function. QgGraphics3D_setHiddenSurfaceRemovalType (Q
gGraphics3D * graphics, enum type) sets the type of hidden surface removal to type. The hidden surface elimination type includes a Z buffer method, a Z sort method using the Z value of the first vertex of the drawing graphic as a representative value, a Z sort method using the minimum Z value of the vertex of the drawing graphic as a representative value, and Any of the Z sorting methods using the Z value of the center of gravity as a representative value can be set. The type of hidden surface removal is
Set to type.

【0222】QgGraphics3D_getHiddenSurfaceRemovalTy
pe(QgGraphics3D *graphics,short*type)はQgGraphics
3D_setHiddenSurfaceRemovalTypeで設定した隠面消去の
タイプ情報を得る。
[0222] QgGraphics3D_getHiddenSurfaceRemovalTy
pe (QgGraphics3D * graphics, short * type) is QgGraphics
Get the type information of hidden surface removal set by 3D_setHiddenSurfaceRemovalType.

【0223】 METHOD NAME QgGraphics3D_setHiddenSurfaceRemovalType QgGraphics3D_getHiddenSurfaceRemovalType SPECIFICATION void QgGraphics3D_setHiddenSurfaceRemovalType( QgGraphics3D *graphi cs3D,enum type ) void QgGraphics3D_getHiddenSurfaceRemovalType( QgGraphics3D *graphi cs3D,short *type ) const PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。[0223] METHOD NAME QgGraphics3D_setHiddenSurfaceRemovalType QgGraphics3D_getHiddenSurfaceRemovalType SPECIFICATION void QgGraphics3D_setHiddenSurfaceRemovalType (QgGraphics3D * graphi cs3D, enum type) void QgGraphics3D_getHiddenSurfaceRemovalType (QgGraphics3D * graphi cs3D, short * type) to specify a pointer to const PARAMETERS graphics3D graphics objects.

【0224】type 有効にしたい機能を指定する(得る)。“QG_ZSORT0”,
“QG_ZSORT1”,“QG_ZSORT2”,“QG_ZBUFFER”(Q3
サポート予定)が指定可能である。
Type Specifies (gets) the function to be validated. “QG_ZSORT0”,
“QG_ZSORT1”, “QG_ZSORT2”, “QG_ZBUFFER” (Q3
Support planned) can be specified.

【0225】DESCRIPTION QgGraphics3D_setHiddenSurfaceRemovalTypeは、カレン
トの隠面消去のタイプを指定する。また、QgGraphics3D
_getHiddenSurfaceRemovalTypeは、カレントの隠面消去
のタイプを得る。隠面消去のタイプとしては、以下のも
のが有効である。
Description QgGraphics3D_setHiddenSurfaceRemovalType specifies the current hidden surface removal type. Also, QgGraphics3D
_getHiddenSurfaceRemovalType gets the current hidden surface removal type. The following are effective as types of hidden surface removal.

【0226】QG_ZSORT0 ピースの第一頂点のz値を代表値としたソーティングに
より隠面消去を行う。 QG_ZSORT1 ピースの頂点の最小z値を代表値としたソーティングに
より隠面消去を行う。 QG_ZSORT2 ピースの重心のz値を代表値としたソーティングにより
隠面消去を行う。
QG_ZSORT0 The hidden surface is erased by sorting using the z value of the first vertex of the piece as a representative value. QG_ZSORT1 Performs hidden surface removal by sorting using the minimum z value of the vertex of the piece as a representative value. QG_ZSORT2 Performs hidden surface removal by sorting using the z-value of the center of gravity of the piece as a representative value.

【0227】QG_ZBUFFER ピースのz値をzバッファに格納することにより隠面消
去を行う。
QG_ZBUFFER The hidden surface is erased by storing the z value of the piece in the z buffer.

【0228】次にQgGraphics3D_flush関数の仕様を示
す。QgGraphics3D_flush(QgGraphics3D *graphics3D)は
描画プロセッサに対して、フレームバッファへの描画の
起動をかける。
Next, the specifications of the QgGraphics3D_flush function will be described. QgGraphics3D_flush (QgGraphics3D * graphics3D) activates the drawing processor to start drawing to the frame buffer.

【0229】 METHOD NAME QgGraphics3D_flush SPECIFICATION void QgGraphics3D_flush( QgGraphics3D *graphics3D ) PARAMETERS graphics3D グラフィックスオブジェクトのポインタを指定する。Method NAME QgGraphics3D_flush SPECIFICATION void QgGraphics3D_flush (QgGraphics3D * graphics3D) PARAMETERS Specifies a pointer to a graphics3D graphics object.

【0230】DESCRIPTION QgGraphics3D_flushは、ハードウェア(Q2またはQ3)に対
し描画の起動をかける。
Description QgGraphics3D_flush starts the drawing of hardware (Q2 or Q3).

【0231】次にQiImage_initialize関数の仕様を示
す。QiImage_initialize(QiImage*image、enum flameBu
fferType、enum colorType、enum dataType、enumsortM
ode)はフレームバッファのデータ,テクスチャデー
タ,Zソート用データを扱うイメージオブジェクトの初
期化を行う。flameBuffertype はフレームバッファをダ
ブルバッファあるいはトリプルバッファの選択を行う。
フレームバッファをトリプルバッファとするとフレーム
バッファに描画したデータをテクスチャデータとして使
用することが可能になる。colorType にはイメージデー
タの種類を設定する。colorTypeにはRGB,RGB
A,INDEXがある。dataType は扱う描画コマンド
のタイプを設定する。描画コマンドには、1フレーム毎
に更新される描画コマンドと複数フレームに対して有効
な描画コマンドがある。また、sortModeには、Zソート
を行うか行わないかを設定する。
Next, the specifications of the QiImage_initialize function will be described. QiImage_initialize (QiImage * image, enum flameBu
fferType, enum colorType, enum dataType, enumsortM
ode) initializes an image object that handles frame buffer data, texture data, and Z sort data. flameBuffertype selects between double buffer and triple buffer for the frame buffer.
If the frame buffer is a triple buffer, data drawn in the frame buffer can be used as texture data. Set the type of image data in colorType. RGB, RGB for colorType
A, INDEX. dataType sets the type of drawing command to be handled. The drawing commands include a drawing command updated for each frame and a drawing command valid for a plurality of frames. In the sortMode, whether to perform Z sorting or not is set.

【0232】 METHOD NAME QiImage_Initialize SPECIFICATION void QiImage_Initialize( QiImage *image, enum flameBufferType, enum colorType,enum dataType, enum sortMode ) PARAMETERS image イメージオブジェクトのポインタを指定する。METHOD NAME QiImage_Initialize SPECIFICATION void QiImage_Initialize (QiImage * image, enum flameBufferType, enum colorType, enum dataType, enum sortMode) PARAMETERS image Specifies a pointer to an image object.

【0233】flameBufferType ダブルバッファ/トリプルバッファ用メモリ領域 Q_DOUBLE(0) ダブルバッファ Q_TRIPLE(1) トリプルバッファ colorType カラータイプ Q_RGB(0) RGB Q_RGBA(1) RGBA Q_INDEX8(2) 単一の値からなるカラー指標 dataType 使用データ種別 Q_INSTSNT(0) 1フレーム毎に更新されるデータのみを
扱う。
FlameBufferType memory area for double buffer / triple buffer Q_DOUBLE (0) double buffer Q_TRIPLE (1) triple buffer colorType color type Q_RGB (0) RGB Q_RGBA (1) RGBA Q_INDEX8 (2) color index consisting of a single value dataType Use data type Q_INSTSNT (0) Handles only data that is updated every frame.

【0234】 Q_PERMANENT(1) 半恒久的なデータも使用する。Q_PERMANENT (1) Use semi-permanent data.

【0235】sortMode ソート用メモリ確保種別 Q_ZSORT_ON(0) Zソート用のメモリを確保する。SortMode Sort memory reservation type Q_ZSORT_ON (0) Reserves Z sort memory.

【0236】 Q_ZSORT_OFF(1) Zソート用のメモリを確保しない。Q_ZSORT_OFF (1) Does not secure memory for Z sort.

【0237】DESCRIPTION QiImage_initializeはイメージオブジェクトの初期化を
行う。イメージオブジェクトに関するパラメータを設定
する。このパラメータにはトリプルバッファ用のメモリ
領域確保(ダブル/トリプルバッファ),カラータイ
プ,半恒久的なデータ使用の有無、そしてZソート用メ
モリの確保の設定がある。
Description QiImage_initialize initializes an image object. Set the parameters for the image object. These parameters include setting of memory area for triple buffer (double / triple buffer), color type, semi-permanent use of data, and setting of memory for Z sort.

【0238】flameBufferModeにQ_DOUBLEを設定すれ
ば、ダブルバッファを利用することが可能である。
If Q_DOUBLE is set in flameBufferMode, a double buffer can be used.

【0239】Q_TRIPLEをセットしておけば、トリプルバ
ッファを利用することができ、途中でダブルバッファ/
トリプルバッファを切り替えることができる。
If Q_TRIPLE is set, a triple buffer can be used.
You can switch between triple buffers.

【0240】colorTypeにQ_INDEX8を設定すれば、Q_RGB
を使用することはできないが、Q_RGBを設定していれ
ば、Q_INDEX8に切り替えることは可能である。
If Q_INDEX8 is set for colorType, Q_RGB
Cannot be used, but it is possible to switch to Q_INDEX8 if Q_RGB is set.

【0241】dataTypeでQ_PERMANENT を設定すると半恒
久的なデータを扱うことが可能になる。Q_INSTANTを設
定すると、1フレーム毎に更新されるデータのみを扱う
ことができる。
When Q_PERMANENT is set in dataType, semi-permanent data can be handled. When Q_INSTANT is set, only data that is updated every frame can be handled.

【0242】sortModeに対して、Q_ZSORT_ONを設定する
とZソートを行うことが可能となる。Q_ZSORT_OFFを設
定するとZソートを行うことはできない。
When Q_ZSORT_ON is set for sortMode, Z sorting can be performed. If Q_ZSORT_OFF is set, Z sort cannot be performed.

【0243】QiImage_InitializeはQiImage を生成した
後、必ずコールする必要がある。このとき、flameBuffe
rType, colorType, dataType, sortMode は必ず設定
しなければならない。また、ワークプレーンの初期化を
行う。
It is necessary to call QiImage_Initialize after generating QiImage. At this time, flameBuffe
rType, colorType, dataType, and sortMode must be set. Also, the work plane is initialized.

【0244】次にQiImage_getColorType関数の仕様を示
す。QiImage_getColorType(QiImage*image,short *col
orType)は上記QiImage_initializeで設定したイメージ
データの種類に関する情報を得ることが可能である。
Next, the specifications of the QiImage_getColorType function will be described. QiImage_getColorType (QiImage * image, short * col
orType) can obtain information on the type of image data set in QiImage_initialize.

【0245】 METHOD NAME QiImage_getColorType SPECIFICATION void QiImage_getColorType( QiImage *image, short *colorType ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_getColorType SPECIFICATION void QiImage_getColorType (QiImage * image, short * colorType) PARAMETERS image Specifies a pointer to an image object.

【0246】colorType カラータイプ Q_RGB(0) RGB Q_RGBA(1) RGBA Q_INDEX8(2) 単一の値からなるカラー指標 DESCRIPTION QiImage_getColorTypeはQiImage_initializeで設定され
たカラータイプ情報を取得する。描画コマンドを生成す
るとき、このメソッドによりカラータイプ情報を得る。
ColorType color type Q_RGB (0) RGB Q_RGBA (1) RGBA Q_INDEX8 (2) Color index consisting of a single value DESCRIPTION QiImage_getColorType acquires the color type information set by QiImage_initialize. When generating a drawing command, color type information is obtained by this method.

【0247】次にQiImage_setInputDataConvert関数とQ
iImage_getInputDataConvert関数の仕様を示す。QiImag
e_setInputDataType(QiImage *image,enum dataIn)は
テクスチャデータの変換方式を設定する。dataInにテク
スチャデータの変換方式にはYUVデータからRGBデ
ータへの変換,ΔYUVデータからRGBデータへの変
換、あるいはRGBデータからRGBデータへの無変換
を設定可能である。
Next, the QiImage_setInputDataConvert function and Q
Shows the specifications of the iImage_getInputDataConvert function. QiImag
e_setInputDataType (QiImage * image, enum dataIn) sets the texture data conversion method. The conversion method of texture data to dataIn can be set to conversion from YUV data to RGB data, conversion from ΔYUV data to RGB data, or no conversion from RGB data to RGB data.

【0248】QiImage_getInputDataType(QiImage *imag
e,short *dataIn)はQiImage_setInputDataConvertによ
り設定したテクスチャデータの変換方式情報を得る。 METHOD NAME QiImage_setInputDataConvert QiImage_getInputDataConvert SPECIFICATION void QiImage_setInputDataConvert( QiImage *image、 enum dataIn ) void QiImage_getInputDataConvert( QiImage *image、 short *dataIn ) PARAMETERS image イメージオブジェクトのポインタを指定する。
QiImage_getInputDataType (QiImage * imag
e, short * dataIn) obtains texture data conversion method information set by QiImage_setInputDataConvert. METHOD NAME QiImage_setInputDataConvert QiImage_getInputDataConvert SPECIFICATION void QiImage_setInputDataConvert (QiImage * image, enum dataIn) void QiImage_getInputDataConvert (QiImage * image, short * dataIn) PARAMETERS Specifies the image object pointer.

【0249】dataIn テクスチャデータとして転送するデータの変換方式 Q_NOOP(0) データ変換をしない(RGB−>RG
B)。
DataIn Conversion method of data transferred as texture data Q_NOOP (0) No data conversion (RGB-> RG
B).

【0250】Q_YUV2RGB(1) YUVデータ(4:2:
2)をRGBデータ(5:6:5)へ変換する。
Q_YUV2RGB (1) YUV data (4: 2:
2) is converted to RGB data (5: 6: 5).

【0251】Q_dYUV2RGB(2) ΔYUVデータ(4:
4:4)をRGBデータ(5:6:5)へ変換する。
Q_dYUV2RGB (2) ΔYUV data (4:
4: 4) to RGB data (5: 6: 5).

【0252】DESCRIPTION QiImage_setInputDataConvertはテクスチャデータとし
て転送するデータの変換方式を設定する。また、QiImag
e_getInputDataConvertはテクスチャデータとして転送
するデータの変換方式の情報を得る。
Description QiImage_setInputDataConvert sets the conversion method of data to be transferred as texture data. Also, QiImag
e_getInputDataConvert obtains information on a conversion method of data to be transferred as texture data.

【0253】次にQiImage_setOutputDataConvert関数と
QiImage_getOutputDataConvert関数の仕様を示す。QiIm
age_setOutputDataType(QiImage *image、enum dataOu
t)はフレームバッファのデータを出力する際のデータ
変換方式をdataOut に設定する。変換方式にはRGBデ
ータをYCrCb データへの変換あるいはRGBデータから
RGBデータへの無変換が設定可能である。
Next, the QiImage_setOutputDataConvert function and
Shows the specifications of the QiImage_getOutputDataConvert function. QiIm
age_setOutputDataType (QiImage * image, enum dataOu
In (t), the data conversion method used when outputting frame buffer data is set to dataOut. The conversion method can be set to convert RGB data to YCrCb data or no conversion from RGB data to RGB data.

【0254】QiImage_getOutputDataType(QiImage *ima
ge、short *dataOut)はQiImage_ setOutputDataで設定
したフレームバッファの出力時の変換方式情報を得る。
QiImage_getOutputDataType (QiImage * ima
ge, short * dataOut) obtains the conversion method information at the time of output of the frame buffer set by QiImage_setOutputData.

【0255】 METHOD NAME QiImage_setOutputDataConvert QiImage_getOutputDataConvert SPECIFICATION void QiImage_setOutputDataConvert( QiImage *image、 enum dataOut ) void QiImage_getOutputDataConvert( QiImage *image、 short *dataOut ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_setOutputDataConvert QiImage_getOutputDataConvert SPECIFICATION void QiImage_setOutputDataConvert (QiImage * image, enum dataOut) void QiImage_getOutputDataConvert (QiImage * image, short * dataOut) PARAMETERS Specifies the image object pointer.

【0256】dataOut 表示用に転送されるデータの変換方式 Q_NOOP(0) データ変換をしない(RGB−>RG
B)。
DataOut Conversion method of data transferred for display Q_NOOP (0) No data conversion (RGB-> RG
B).

【0257】Q_RGB2YC(1) RGBデータ(6:6:
6)をYCbCrデータ(4:2:2)へ変換する。
Q_RGB2YC (1) RGB data (6: 6:
6) is converted to YCbCr data (4: 2: 2).

【0258】DESCRIPTION QiImage_setOutputDataConvertは表示用として転送する
データの変換方式を設定する。また、QiImage_getOutpu
tDataConvertは表示用として転送するデータの変換方式
に関する情報を得る。
Description QiImage_setOutputDataConvert sets the conversion method of data to be transferred for display. Also, QiImage_getOutpu
tDataConvert obtains information on the conversion method of data to be transferred for display.

【0259】次にQiImage_setImageDataType関数とQiIm
age_getImageDataType関数の仕様を示す。QiImage_setI
mageDataType(QiImage *image,enum imgDataType)は描
画コマンドの種類を設定する。imgDataType に描画コマ
ンドの種類を設定する。描画コマンドの種類として、1
フレーム描画後に更新される描画コマンド、あるいは複
数フレームの描画に対して有効な描画コマンドのいずれ
かが設定可能である。QiImage_getImageDataType(QiIma
ge *image,short *imgDataType)はQiImage_setImageDa
taTypeで設定した、描画コマンドの種類に関する情報を
得る。
Next, the QiImage_setImageDataType function and QiIm
Show the specification of age_getImageDataType function. QiImage_setI
mageDataType (QiImage * image, enum imgDataType) sets the type of drawing command. Set the type of drawing command in imgDataType. The type of drawing command is 1
Either a drawing command updated after drawing a frame or a drawing command effective for drawing a plurality of frames can be set. QiImage_getImageDataType (QiIma
ge * image, short * imgDataType) is QiImage_setImageDa
Gets information about the type of drawing command set in taType.

【0260】 METHOD NAME QiImage_setImageDataType QiImage_getImageDataType SPECIFICATION void QiImage_setImageDataType( QiImage *image, enum imgDataType ) void QiImage_getImageDataType( QiImage *image, short *imgDataType ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_setImageDataType QiImage_getImageDataType SPECIFICATION void QiImage_setImageDataType (QiImage * image, enum imgDataType) void QiImage_getImageDataType (QiImage * image, short * imgDataType) PARAMETERS Specifies the image object pointer.

【0261】imgDataType イメージデータタイプ Q_INSTANT(0) 1フレーム毎に更新されるデータ。ImgDataType Image data type Q_INSTANT (0) Data updated for each frame.

【0262】 Q_PERMANENT(1) 半恒久的に使用されるデータ。Q_PERMANENT (1) Data used semi-permanently.

【0263】DESCRIPTION QiImage_setImageDataTypeはこれから描画しようとして
いるイメージデータのタイプを設定する。また、QiImag
e_getImageDataTypeはイメージデータのタイプに関する
情報を取得する。データのタイプには2種類あり、Q_IN
STANT を設定した後のデータは1フレーム描画後に失わ
れる。Q_PERMANENT が設定されていれば、連続した複数
フレームの描画に使用することができる。ただし、QiIm
age_setImageModeにより、Q_PERMANENTが設定されてい
なければならない。
Description QiImage_setImageDataType sets the type of image data to be drawn. Also, QiImag
e_getImageDataType gets information about the type of image data. There are two types of data, Q_IN
Data after setting STANT is lost after drawing one frame. If Q_PERMANENT is set, it can be used to draw multiple consecutive frames. However, QiIm
Q_PERMANENT must be set by age_setImageMode.

【0264】図25にimgModeとimgDataTypeの関係を示
す。
FIG. 25 shows the relationship between imgMode and imgDataType.

【0265】次にQiImage_setImageMode関数とQiImage_
getImageMode関数の仕様を示す。
Next, the QiImage_setImageMode function and QiImage_
Show the specification of getImageMode function.

【0266】QiImage_setImageMode(QiImage *image,e
num imgMode)は複数フレームに対して有効な描画コマン
ドの使用開始あるいは使用終了をimdModeに設定する。
QiImage_setImageMode (QiImage * image, e
num imgMode) sets the use start or use end of the drawing command effective for a plurality of frames in imdMode.

【0267】QiImage_getImageMode(QiImage *image,s
hort *imgMode)はQiImage_setImageModeで設定した複数
フレームに対して有効な描画コマンドの使用開始あるい
は使用終了の情報を得る。
QiImage_getImageMode (QiImage * image, s
hort * imgMode) obtains information about the start or end of use of a drawing command effective for a plurality of frames set by QiImage_setImageMode.

【0268】 METHOD NAME QiImage_setImageMode QiImage_getImageMode SPECIFICATION void QiImage_setImageMode( QiImage *image, enum imgMode ) void QiImage_getImageMode( QiImage *image, short *imgMode )const PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_setImageMode QiImage_getImageMode SPECIFICATION void QiImage_setImageMode (QiImage * image, enum imgMode) void QiImage_getImageMode (QiImage * image, short * imgMode) const PARAMETERS Specifies the pointer of the image object.

【0269】imgMode イメージモード Q_INSTANT(0) 1フレーム毎に更新されるデータを使用
する。
ImgMode Image mode Q_INSTANT (0) Uses data that is updated every frame.

【0270】 Q_PERMANENT(1) 半恒久的なデータを使用する。Q_PERMANENT (1) Use semi-permanent data.

【0271】DESCRIPTION QiImage_setImageModeは半恒久的なデータ使用の有無を
設定する。また、QiImage_getImageModeはイメージモー
ドに関する情報を得る。imgModeにQ_INSTANT を設定す
ればデータは1フレーム描画後に失われる。Q_PERMANEN
T を設定すれば、連続した複数フレームの描画に対して
有効なデータ使用することができる。ただし、半恒久的
なデータを扱いたい場合には、QiImage_initializeによ
り、dataTypeにQ_PERMANENTが設定されていなければな
らない。QiImage_setImageModeにより、Q_PERMANENTが
設定されている場合、QiImage_setImageDataTypeによ
り、Q_PERMANENT を設定すれば、半恒久的なデータを用
いた描画を行うことが可能となる。
Description QiImage_setImageMode sets whether or not to use semi-permanent data. QiImage_getImageMode obtains information on the image mode. If Q_INSTANT is set to imgMode, data will be lost after drawing one frame. Q_PERMANEN
If T is set, effective data can be used for drawing a plurality of continuous frames. However, to handle semi-permanent data, Q_PERMANENT must be set in dataType by QiImage_initialize. When Q_PERMANENT is set by QiImage_setImageMode, drawing using semi-permanent data can be performed by setting Q_PERMANENT by QiImage_setImageDataType.

【0272】図26にdataTypeとimgModeの関係を示
す。
FIG. 26 shows the relationship between dataType and imgMode.

【0273】次にQiImage_setBufferMode関数とQiImage
_getBufferMode関数の仕様に示す。QiImage_setBufferM
ode(QiImage *image,enum bufMode)はフレームバッフ
ァのモードを設定する。bufMode にフレームバッファの
モードとしてダブルバッファとトリプルバッファが設定
可能である。
Next, the QiImage_setBufferMode function and the QiImage
See the specification of the _getBufferMode function. QiImage_setBufferM
ode (QiImage * image, enum bufMode) sets the mode of the frame buffer. Double buffer and triple buffer can be set as frame buffer mode in bufMode.

【0274】QiImage_getBufferMode(QiImage *image,
short *bufMode)はQiImage_setBufferModeで設定したフ
レームバッファのモード情報を得る。
QiImage_getBufferMode (QiImage * image,
short * bufMode) obtains the mode information of the frame buffer set by QiImage_setBufferMode.

【0275】 METHOD NAME QiImage_setBufferMode QiImage_getBufferMode SPECIFICATION void QiImage_setBufferMode(QiImage *image, enum bufMode ) void QiImage_getBufferMode(QiImage *image, short *bufMode ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_setBufferMode QiImage_getBufferMode SPECIFICATION void QiImage_setBufferMode (QiImage * image, enum bufMode) void QiImage_getBufferMode (QiImage * image, short * bufMode) PARAMETERS image Specifies the pointer of the image object.

【0276】bufMode バッファのモード Q_DOUBLE(0) ダブルバッファ Q_TRIPLE(1) トリプルバッファ DESCRIPTION QiImage_setBufferModeはフレームバッファのモードを
設定する。また、QiImage_getBufferModeはフレームバ
ッファのモードに関する情報を取得する。モードにはダ
ブルバッファ(Q_DOUBLE)とトリプルバッファ(Q_TRIPLE)
がある。トリプルバッファを指定すると描画したイメー
ジデータをテクスチャデータとして使用することが可能
になる。ただし、ダブルバッファからトリプルバッファ
へ変更した場合には、データが破壊される場合がある。
Q_TRIPLEが有効となるためにはQiImage_initialize に
より、flameBufferに対してQ_TRIPLEが設定されていな
ければならない。
BufMode Buffer mode Q_DOUBLE (0) Double buffer Q_TRIPLE (1) Triple buffer DESCRIPTION QiImage_setBufferMode sets the mode of the frame buffer. QiImage_getBufferMode obtains information on the mode of the frame buffer. Modes include double buffer (Q_DOUBLE) and triple buffer (Q_TRIPLE)
There is. If a triple buffer is specified, the rendered image data can be used as texture data. However, when changing from the double buffer to the triple buffer, data may be destroyed.
In order for Q_TRIPLE to be valid, Q_TRIPLE must be set for flameBuffer by QiImage_initialize.

【0277】また、QiImage_storeImage を実行するた
めには、bufModeにQ_TRIPLEが設定されていなければな
らない。
In order to execute QiImage_storeImage, Q_TRIPLE must be set in bufMode.

【0278】図27にflameBufferTypeとbufModeの関係
を示す。
FIG. 27 shows the relationship between flameBufferType and bufMode.

【0279】次にQiImage_setDrawMode関数の仕様を示
す。QiImage_setDrawMode(QiImage*image,enum drawMo
de)はフレームバッファあるいはワークプレーンに図形
を描画する際の属性を設定する。属性はdrawModeに設定
され、フレームバッファに描画するときのワークプレー
ンの参照/非参照,テクスチャデータを全て参照/半分
参照,ネット描画,シザーテスト,テクスチャの反復処
理,2値テクスチャの透過/非透過,画素指定を設定す
ることができる。
Next, the specifications of the QiImage_setDrawMode function will be described. QiImage_setDrawMode (QiImage * image, enum drawMo
de) sets attributes for drawing a figure on the frame buffer or work plane. The attribute is set to drawMode, and reference / non-reference of the work plane when drawing to the frame buffer, reference / half reference to all texture data, net drawing, scissor test, texture repetition processing, transparency / non-transparency of binary texture , Pixel designation can be set.

【0280】 METHOD NAME QiImage_setDrawMode SPECIFICATION void QiImage_setDrawMode( QiImage *image, enum drawMode ) PARAMETERS image イメージオブジェクトのポインタを指定する。METHOD NAME QiImage_setDrawMode SPECIFICATION void QiImage_setDrawMode (QiImage * image, enum drawMode) PARAMETERS image Specifies a pointer to an image object.

【0281】drawMode ドローモード Q_WORK_ON 描画時にワークプレーンのデータを参照
する。
DrawMode Draw mode Q_WORK_ON Refers to work plane data when drawing.

【0282】Q_WORK_OFF 描画時にワークプレーンの
データを参照しない。
Q_WORK_OFF Does not refer to work plane data when drawing.

【0283】Q_SOURCE_ALL テクスチャデータを全て参
照して描画する。
Q_SOURCE_ALL Renders with reference to all texture data.

【0284】Q_SOURCE_HALF 縮小時にテクスチャデー
タの半分を参照する。尚、奇数画素/偶数画素のどちら
を参照するかはQ_BIT_SELECT_EVEN/Q_BIT_SELECT_ODD
に依存する。
Q_SOURCE_HALF Refers to half of the texture data at the time of reduction. It should be noted that whether to refer to an odd pixel or an even pixel is determined by Q_BIT_SELECT_EVEN / Q_BIT_SELECT_ODD.
Depends on.

【0285】Q_BIT_SELECT_EVEN ネット描画,テクス
チャ参照指定を行う際に参照する画素を選択する。偶数
画素を指定。また、ワークプレーンに“0”で折れ線描
画を行うときに使用する。
Q_BIT_SELECT_EVEN Selects a pixel to be referred when performing net drawing and texture reference designation. Specify even-numbered pixels. Also, it is used when a polygonal line drawing is performed on the work plane with “0”.

【0286】Q_BIT_SELECT_ODD ネット描画,テクスチ
ャ参照指定を行う際に参照する画素を選択する。奇数画
素を指定。また、ワークプレーンに“1”で折れ線描画
を行うときに使用する。
Q_BIT_SELECT_ODD Selects a pixel to be referred to when performing net drawing and texture reference designation. Specify odd pixels. Also, it is used when a polygonal line drawing is performed on the work plane with "1".

【0287】Q_NET_ON ネット描画(疑似アルフ
ァブレンド)を行う。
Q_NET_ON Performs net drawing (pseudo alpha blending).

【0288】Q_NET_OFF ネット描画をしない。Q_NET_OFF Do not draw nets.

【0289】Q_CLIP_ON ユーザーリッピング(シ
ザーテスト)を行う。
Q_CLIP_ON Performs user ripping (scissor test).

【0290】Q_CLIP_OFF ユーザーリッピングをし
ない。
Q_CLIP_OFF Does not perform user ripping.

【0291】Q_WRAP_REPEAT テクスチャデータを拡
大、または縮小して描画する。
Q_WRAP_REPEAT The texture data is drawn by enlarging or reducing.

【0292】Q_WRAP_LINEAR テクスチャデータを繰り
返し参照して描画する。
Q_WRAP_LINEAR Drawing is performed by repeatedly referring to texture data.

【0293】Q_TRANSIT_ON 2値ソースデータをカラ
ー展開する時、透過にする。
Q_TRANSIT_ON Transparency of binary source data when color-developed.

【0294】Q_TRANSIT_OFF 2値ソースデータをカラ
ー展開する時、非透過にする。
Q_TRANSIT_OFF When the binary source data is developed in color, it is made non-transparent.

【0295】DESCRIPTION QiImage_setDrawMode はプリミティブを描画する際の属
性パラメータを設定する。属性として、ワークプレーン
の指定,クリッピング(シザーテスト)指定,透過指
定,テクスチャの反復処理,ネット描画(疑似アルファ
ブレンド),テクスチャ参照指定,画素指定を設定す
る。
Description QiImage_setDrawMode sets an attribute parameter for drawing a primitive. Attributes such as work plane designation, clipping (scissor test) designation, transparency designation, texture repetition processing, net drawing (pseudo alpha blending), texture reference designation, and pixel designation are set.

【0296】次にQiImage_setScissorArea関数の仕様を
示す。QiImage_setScissorArea(QiImage *image,FIX x
Min,FIX yMin,FIX xMax,FIX yMax)はシザーテスト用
領域を設定する。(xMin,yMin),(xMax,yMin),(xMa
x,yMax),(xMin,yMax)の4頂点から成る矩形領域がク
リッピング領域となる。QiImage_setDrawMode でシザー
テストが有効に設定されていれば、フレームバッファあ
るいはワークプレーンに図形を描画する際、この矩形領
域内にある場合のみ描画される。
Next, the specification of the QiImage_setScissorArea function is shown. QiImage_setScissorArea (QiImage * image, FIX x
Min, FIX yMin, FIX xMax, FIX yMax) set the scissor test area. (xMin, yMin), (xMax, yMin), (xMa
A rectangular area including four vertices of (x, yMax) and (xMin, yMax) is a clipping area. If the scissor test is enabled in QiImage_setDrawMode, when drawing a figure on the frame buffer or work plane, it will only be drawn if it is within this rectangular area.

【0297】 METHOD NAME QiImage_setScissorArea SPECIFICATION void QiImage_setScissorArea( QiImage *image, FIX xMin, FIX yMin, FIX xMax, FIX yMax ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_setScissorArea SPECIFICATION void QiImage_setScissorArea (QiImage * image, FIX xMin, FIX yMin, FIX xMax, FIX yMax) PARAMETERS image Specifies the pointer of the image object.

【0298】xMin クリッピング領域の左上の座標のx成分(絶対座標)。XMin x component (absolute coordinate) of the upper left coordinate of the clipping area.

【0299】yMin クリッピング領域の左上の座標のy成分(絶対座標)。YMin The y component (absolute coordinate) of the upper left coordinate of the clipping area.

【0300】xMax クリッピング領域の右下の座標のx成分(絶対座標)。XMax x component (absolute coordinate) of the lower right coordinate of the clipping area.

【0301】yMax クリッピング領域の右下の座標のy成分(絶対座標)。YMax y component (absolute coordinates) of the lower right coordinate of the clipping area.

【0302】DESCRIPTION QiImage_setScissorAreaはユーザーリッピング(シザー
テスト)のための領域(矩形領域)を設定する。このユ
ーザーリッピングはフレームバッファ,ワークプレーン
両方への描画に対して有効であり、ユーザーリッピング
領域内にある場合のみ描画される。また、発行時にシス
テムクリッピング領域(表示領域)を越えてはならな
い。ドローモードは全て無効である。
Description QiImage_setScissorArea sets an area (rectangular area) for user ripping (scissor test). This user ripping is effective for drawing on both the frame buffer and the work plane, and is drawn only when it is within the user ripping area. At the time of issuance, it must not exceed the system clipping area (display area). All draw modes are disabled.

【0303】図28に、フレームバッファあるいはワー
クプレーンに対する、矩形領域のクリッピングを示す。
FIG. 28 shows clipping of a rectangular area to a frame buffer or a work plane.

【0304】次にQiImage_drawWorkLine関数の仕様を示
す。QiImage_drawWorkLine(QiImage*image,FIX n,con
st FIX *work)はワークプレーンへ折れ線を描画する。
nには折れ線の頂点数,workには折れ線の頂点座標デー
タをそれぞれ設定する。
Next, the specifications of the QiImage_drawWorkLine function will be described. QiImage_drawWorkLine (QiImage * image, FIX n, con
st FIX * work) draws a polygonal line on the work plane.
In n, the number of vertices of the polygonal line is set, and in work, the vertex coordinate data of the polygonal line is set.

【0305】 METHOD NAME QiImage_drawWorkLine SPECIFICATION void QiImage_drawWorkLine( QiImage *image、 FIX n、 const FIX *work ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_drawWorkLine SPECIFICATION void QiImage_drawWorkLine (QiImage * image, FIX n, const FIX * work) PARAMETERS Specifies the pointer of the image object.

【0306】n 折れ線の総頂点数。N Total number of vertices of the polygonal line.

【0307】work 折れ線の頂点の座標値を格納している配列のポインタを
指定する。但し、一次元配列でなければならない。座標
値は絶対座標を用いる。
Work Specifies the pointer of the array storing the coordinate values of the vertices of the polygonal line. However, it must be a one-dimensional array. The coordinate values use absolute coordinates.

【0308】DESCRIPTION QiImage_drawWorkLineはワークプレーンへ折れ線を2値
描画する。“0”描画を行う場合はドローモードでQ_BI
T_SELECT_EVENを設定する必要がある。“1”描画を行
うには同様にQ_BIT_SELECT_ODDを設定しなければならな
い。ドローモードはユーザーリッピングと画素指定が有
効であり、その他は無効である。
Description QiImage_drawWorkLine draws a polygonal line on the work plane in binary. When drawing “0”, Q_BI in draw mode
T_SELECT_EVEN needs to be set. To perform “1” drawing, Q_BIT_SELECT_ODD must be set similarly. In the draw mode, user ripping and pixel designation are valid, and the others are invalid.

【0309】図29にワークプレーンへの折れ線描画を
示す。
FIG. 29 shows a polygonal line drawing on the work plane.

【0310】次にQiImage_drawWorkPolygon関数の仕様
を示す。QiImage_drawWorkPolygon(QiImage *image,FI
X n,const FIX *work)はワークプレーンへポリゴンを
描画する。nにはポリゴンの頂点数,workにはポリゴン
の頂点座標データをそれぞれ設定する。尚、ワークプレ
ーンには2値のEORで描画される。
Next, the specifications of the QiImage_drawWorkPolygon function will be described. QiImage_drawWorkPolygon (QiImage * image, FI
Xn, const FIX * work) draws a polygon on the work plane. The number of vertices of the polygon is set to n, and the vertex coordinate data of the polygon is set to work. Note that the work plane is drawn by binary EOR.

【0311】 METHOD NAME QiImage_drawWorkPolygon SPECIFICATION void QiImage_drawWorkPolygon( QiImage *image, FIX n, const FIX *work ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_drawWorkPolygon SPECIFICATION void QiImage_drawWorkPolygon (QiImage * image, FIX n, const FIX * work) PARAMETERS image Specifies a pointer to an image object.

【0312】n ポリゴンの総頂点数。N Total number of vertices of polygon.

【0313】work ポリゴンの頂点の座標値を格納している配列のポインタ
を指定する。但し、一次元配列でなければならない。座
標値は絶対座標を用いる。
[0313] A pointer to an array that stores the coordinate values of the vertices of the work polygon is specified. However, it must be a one-dimensional array. The coordinate values use absolute coordinates.

【0314】DESCRIPTION QiImage_drawWorkPolygon はワークプレーンへポリゴン
を描画する。描画時にはワークプレーンのデータに対し
て2値のEOR描画を行う。ドローモードはユーザーク
リッピングのみが有効であり、その他は無効である。
Description QiImage_drawWorkPolygon draws a polygon on the work plane. At the time of drawing, binary EOR drawing is performed on the data of the work plane. In the draw mode, only the user clipping is valid, and the others are invalid.

【0315】図30に、ワークプレーンへのポリゴン描
画を示す。
FIG. 30 shows polygon drawing on the work plane.

【0316】次にQiImage_clearWorkPlane関数の仕様を
示す。QiImage_clearWorkPlane(QiImage *image,FIX
xMin,FIX yMin,FIX xMax,FIX yMax)はワークプレー
ンを初期化する。xMin,yMin),(xMax,yMin),(xMax,
yMax),(xMin,yMax)の4頂点から成る矩形領域をクリ
アする。
Next, the specifications of the QiImage_clearWorkPlane function are shown. QiImage_clearWorkPlane (QiImage * image, FIX
xMin, FIX yMin, FIX xMax, FIX yMax) initialize the work plane. xMin, yMin), (xMax, yMin), (xMax,
Clears a rectangular area consisting of four vertices (yMax) and (xMin, yMax).

【0317】 METHOD NAME QiImage_clearWorkPlane SPECIFICATION void QiImage_clearWorkPlane( QiImage *image, FIX xMin, FIX yMin, FIX xMax, FIX yMax ) PARAMETERS image イメージオブジェクトのポインタを指定する。METHOD NAME QiImage_clearWorkPlane SPECIFICATION void QiImage_clearWorkPlane (QiImage * image, FIX xMin, FIX yMin, FIX xMax, FIX yMax) PARAMETERS Specifies the pointer of the image object.

【0318】xMin クリア領域の左上の座標のx成分(絶対座標)。XMin x component (absolute coordinate) of the upper left coordinate of the clear area.

【0319】yMin クリア領域の左上の座標のy成分(絶対座標)。YMin The y component (absolute coordinates) of the upper left coordinate of the clear area.

【0320】xMax クリア領域の右下の座標のx成分(絶対座標)。XMax x component (absolute coordinate) of the lower right coordinate of the clear area.

【0321】yMax クリア領域の右下の座標のy成分(絶対座標)。YMax y component (absolute coordinates) of the lower right coordinate of the clear area.

【0322】DESCRIPTION QiImage_clearWorkPlaneはワークプレーンの指定された
矩形領域を“0”でクリアする。ドローモードはユーザ
ークリッピングのみが有効で、その他は全て無効であ
る。
Description QiImage_clearWorkPlane clears the specified rectangular area of the work plane with “0”. In the draw mode, only user clipping is valid, and all others are invalid.

【0323】図31にワークプレーンに対する、矩形領
域のクリアを示す。
FIG. 31 shows clearing of a rectangular area on the work plane.

【0324】次にQiImage_loadTexture関数の仕様を示
す。QiImage_loadTexture(QiImage*image,enum textur
eType,enum mipmapType,short levelNum,short *id,
…)はテクスチャデータを描画プロセッサがアクセス可
能なメモリ領域にロードする。textureType には、テク
スチャデータのタイプを設定する。テクスチャデータの
タイプとしては2値テクスチャデータあるいは多値テク
スチャデータがある。mipmapTypeにはミップマップのタ
イプを設定する。ミップマップのタイプには、ミップマ
ップ,輝度ミップマップ,ミップマップ無しのいずれか
である。
Next, the specifications of the QiImage_loadTexture function are shown. QiImage_loadTexture (QiImage * image, enum textur
eType, enum mipmapType, short levelNum, short * id,
..) Loads the texture data into a memory area accessible by the drawing processor. In textureType, set the type of texture data. Texture data types include binary texture data and multi-valued texture data. Set the mipmap type in mipmapType. The type of mipmap is one of mipmap, luminance mipmap, and no mipmap.

【0325】levelNumにはミップマップのレベル数を設
定する。また、テクスチャidとして、ロードされたテク
スチャデータのidを得ることができる。上記loadTextur
e の引数…にはテクスチャデータを設定する。テクスチ
ャデータの数はレベルと同じにする必要がある。
[0325] In levelNum, the number of levels of the mipmap is set. Also, the id of the loaded texture data can be obtained as the texture id. LoadTextur above
The texture data is set as the argument of e. The number of texture data needs to be the same as the level.

【0326】 METHOD NAME QiImage_loadTexture SPECIFICATION void QiImage_loadTexture( QiImage *image, enum textureType, enum mipmapType,FIX levelNum, short *id, … ) PARAMETERS image イメージオブジェクトのポインタを指定する。METHOD NAME QiImage_loadTexture SPECIFICATION void QiImage_loadTexture (QiImage * image, enum textureType, enum mipmapType, FIX levelNum, short * id, ...) PARAMETERS image Specifies the pointer of the image object.

【0327】textureType テクスチャデータのタイプ Q_TWO(0) 2値のテクスチャデータ Q_MULTI(1) 多値のテクスチャデータ mipmapType ミップマップのタイプ Q_MIPMAP(0) ミップマップ Q_LUMIMANCE_MIPMAP(1) 輝度ミップマップ Q_NORMAL(2) 通常のテクスチャ levelNum ミップマップのレベル id ロードしたテクスチャデータのID番号を返す。TextureType Texture data type Q_TWO (0) Binary texture data Q_MULTI (1) Multi-valued texture data mipmapType Mipmap type Q_MIPMAP (0) Mipmap Q_LUMIMANCE_MIPMAP (1) Luminance mipmap Q_NORMAL (2) Texture levelNum Mipmap level id Returns the ID number of the loaded texture data.

【0328】DESCRIPTION QiImage_loadTexture はテクスチャデータをロードす
る。その際、データ変換タイプを参照するため、QiImag
e_setDataTranslateにより変換形式を設定していなけれ
ばならない。ロードされたテクスチャはID番号で管理
されており、設定値よりも多くのテクスチャデータはロ
ードできない。テクスチャデータが2値データであれ
ば、textureTypeにQ_TWOを、また多値データであれば、
Q_MULTI を設定する。
Description QiImage_loadTexture loads texture data. At that time, to refer to the data conversion type, QiImag
The conversion format must be set by e_setDataTranslate. The loaded texture is managed by an ID number, so that more texture data than the set value cannot be loaded. If the texture data is binary data, Q_TWO is used for textureType.
Set Q_MULTI.

【0329】mipmapTypeはミップマップのタイプを指定
する。Q_NORMALはミップマップ無しのテクスチャデータ
である。Q_MIPMAPは通常のミップマップ用のデータであ
る。また、Q_LUMINANCE_MIPMAPは輝度階調付きテクスチ
ャの場合に指定する。
MipmapType specifies the type of mipmap. Q_NORMAL is texture data without a mipmap. Q_MIPMAP is data for a normal mipmap. Q_LUMINANCE_MIPMAP is specified in the case of a texture with luminance gradation.

【0330】levelNumでは、ミップマップのレベルであ
る。mipmapTypeでQ_NORMALを設定した場合には、1を設
定しなければならない。Q_MIPMAP, Q_LUMINANCE_MIPMA
P を設定した場合には、適当なレベル数を設定する必要
がある。
[0330] levelNum is the level of the mipmap. When Q_NORMAL is set in mipmapType, 1 must be set. Q_MIPMAP, Q_LUMINANCE_MIPMA
When P is set, it is necessary to set an appropriate number of levels.

【0331】テクスチャデータは一次元配列として扱
い、ミップマップのレベル数に応じて、引数…のところ
で設定する必要がある。
The texture data is treated as a one-dimensional array, and it is necessary to set it at the argument...

【0332】次にQiImage_storeImage関数の仕様を示
す。QiImage_storeImage(QiImage*image,short *id)は
フレームバッファのイメージデータをストアする。この
storeImageにより、フレームバッファに描画したデータ
をテクスチャとして利用することが可能になる。
Next, the specifications of the QiImage_storeImage function will be described. QiImage_storeImage (QiImage * image, short * id) stores the image data of the frame buffer. this
With storeImage, data drawn in the frame buffer can be used as a texture.

【0333】 METHOD NAME QiImage_storeImage SPECIFICATION void QiImage_storeImage( QiImage *image, short *id )const PARAEMTERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_storeImage SPECIFICATION void QiImage_storeImage (QiImage * image, short * id) const PARAEMTERS image Specifies a pointer to an image object.

【0334】id ストアしたイメージデータのテクスチャID番号。Id The texture ID number of the stored image data.

【0335】DESCRIPTION 描画したフレームバッファのイメージデータを、テクス
チャとして使用することが可能になる。但し、フレーム
バッファタイプとしてsetBufferTypeでQ_TRIPLEを設定
していなければならない。storeImageを複数回コールす
れば、最後にコールしたもののみが有効になり、前にコ
ールしたときのイメージデータは失われる。Q_DOUBLEを
設定している場合には無視される。テクスチャとして使
用する場合には戻り値であるテクスチャID番号を用い
る。
Description The image data of the drawn frame buffer can be used as a texture. However, Q_TRIPLE must be set in setBufferType as the frame buffer type. If you call storeImage multiple times, only the last call is valid, and the image data from the previous call is lost. Ignored if Q_DOUBLE is set. When used as a texture, a texture ID number which is a return value is used.

【0336】次にQiImage_copyImage関数の仕様に示
す。QiImage_copyImage(QiImage*image,unsigned shor
t srcX,unsigned short srcY,unsigned short widt
h,unsigned short height,unsigned short destX,un
signed short destY)は図形データのコピーを行う。src
X,srcY,width,height にはそれぞれコピー元の図形
の座標,幅,高さを設定する。destX,destYにはコピー
先の座標を設定する。 METHOD NAME QiImage_copyImage SPECIFICATION void QiImage_copyImage( QiImage *image, unsigned short srcX, srcY, unsigned short width, unsigned short height,short destX, short destY) PARAMETERS image イメージオブジェクトのポインタを指定する。
Next, the specifications of the QiImage_copyImage function are shown. QiImage_copyImage (QiImage * image, unsigned shor
t srcX, unsigned short srcY, unsigned short widt
h, unsigned short height, unsigned short destX, un
signed short destY) copies figure data. src
In X, srcY, width, and height, set the coordinates, width, and height of the source figure. The coordinates of the copy destination are set in destX and destY. METHOD NAME QiImage_copyImage SPECIFICATION void QiImage_copyImage (QiImage * image, unsigned short srcX, srcY, unsigned short width, unsigned short height, short destX, short destY) PARAMETERS image Specify the pointer of the image object.

【0337】srcX コピーするイメージデータの左上のxアドレス。SrcX The upper left x address of the image data to be copied.

【0338】srcY コピーするイメージデータの左上のyアドレス。SrcY The upper left y address of the image data to be copied.

【0339】width イメージデータの幅。Width The width of the image data.

【0340】height イメージデータの高さ。Height Height of image data.

【0341】destX コピー先の座標のx成分。DestX x component of copy destination coordinates.

【0342】destY コピー先の座標のy成分。DestY The y component of the coordinates of the copy destination.

【0343】DESCRIPTION メモリ上のイメージデータをコピーする。イメージデー
タのコピーは矩形領域単位で行う。
[0343] DESCRIPTION The image data on the memory is copied. Image data is copied in units of rectangular areas.

【0344】次にQiImage_setPaletteColor関数とQiIma
ge_getPaletteColor関数の仕様を示す。QiImage_setPal
etteColor(QiImage *image,short n,const FIX *pc)
はcolorType にINDEXを設定した場合に参照するR
GBカラーを設定する。nはカラーパレットの番号を設
定する。pcにはR,G,Bのデータを設定する。
Next, the QiImage_setPaletteColor function and the QiIma
Shows the specifications of the ge_getPaletteColor function. QiImage_setPal
etteColor (QiImage * image, short n, const FIX * pc)
Is R to be referred when INDEX is set to colorType.
Set the GB color. n sets the number of the color palette. R, G, and B data are set in pc.

【0345】QiImage_getPaletteColor(QiImage *imag
e,short n,FIX *pc)はQiImage_setPaletteColorで設
定したカラーパレットのカラー情報を得る。
[0345] QiImage_getPaletteColor (QiImage * imag
e, short n, FIX * pc) obtains the color information of the color palette set by QiImage_setPaletteColor.

【0346】 METHOD NAME QiImage_setPaletteColor QiImage_getPaletteColor SPECIFICATION void QiImage_setPaletteColor( QiImage *image, short n, const FIX *pc ) void QiImage_getpaletteColor( QiImage *image, short n, FIX *pc ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_setPaletteColor QiImage_getPaletteColor SPECIFICATION void QiImage_setPaletteColor (QiImage * image, short n, const FIX * pc) void QiImage_getpaletteColor (QiImage * image, short n, FIX * pc) PARAMETERS image Specifies the pointer of the image object.

【0347】n 設定しようとするカラーパレットの番号。N The number of the color palette to be set.

【0348】pc カラーパレットに設定するカラーの配列。An array of colors set in the pc color palette.

【0349】DESCRIPTION QiImage_setPaletteColorはsetColorTypeでQ_INDEX8 を
設定した場合に参照される、カラーパレットを設定す
る。また、QiImage_getPaletteColor はカラーパレット
の色情報を取得する。
Description QiImage_setPaletteColor sets a color palette that is referred to when Q_INDEX8 is set by setColorType. QiImage_getPaletteColor gets the color information of the color palette.

【0350】カラーパレットに設定するデータはRGB
である。0番目のカラーパレットは画面クリア用に使用
されるため、QiImage_setPaletteColor で設定すること
はできない。また、0番目のカラーパレットの色情報を
QiImage_getPaletteColor で得ることはできない。
The data set in the color palette is RGB.
It is. Since the 0th color palette is used for clearing the screen, it cannot be set with QiImage_setPaletteColor. Also, the color information of the 0th color palette is
It cannot be obtained with QiImage_getPaletteColor.

【0351】次にQiImage_setForeGroundColor関数とQi
Image_getForeGroundColor関数の仕様を示す。QiImage_
setForeGroundColor(QiImage *image,const FIX *c)は
2値のテクスチャデータ参照時の非透過部分のカラーを
設定する。cにカラーを設定する。
Next, the QiImage_setForeGroundColor function and Qi
Shows the specifications of the Image_getForeGroundColor function. QiImage_
setForeGroundColor (QiImage * image, const FIX * c) sets the color of the opaque part when referring to binary texture data. Set color to c.

【0352】QiImage_getForeGroundColor(QiImage *im
age,FIX *c)はQiImage_setForeGroundColorで設定した
非透過部分のカラー情報を得る。
QiImage_getForeGroundColor (QiImage * im
age, FIX * c) obtains the color information of the non-transparent part set by QiImage_setForeGroundColor.

【0353】 METHOD NAME QiImage_setForeGroundColor QiImage_getForeGroundColor SPECIFICATION void QiImage_setForeGroundColor( QiImage *image, const FIX *c ) void QiImage_getForeGroundColor( QiImage *image, FIX *c ) PARAMETERS image イメージオブジェクトのポインタを指定する。METHOD NAME QiImage_setForeGroundColor QiImage_getForeGroundColor SPECIFICATION void QiImage_setForeGroundColor (QiImage * image, const FIX * c) void QiImage_getForeGroundColor (QiImage * image, FIX * c) PARAMETERS image Specifies the pointer of the image object.

【0354】c 非透過カラーとして参照するカラーを設定する。C Set a color to be referred to as a non-transparent color.

【0355】DESCRIPTION QiImage_setForeGroundColorは非透過カラーとして参照
するカラーデータを設定する。また、QiImage_getForeG
roundColorは非透過カラーとして参照するカラーデータ
情報を得る。
Description QiImage_setForeGroundColor sets color data to be referred to as a non-transparent color. Also, QiImage_getForeG
roundColor obtains color data information referred to as a non-transparent color.

【0356】2値のテクスチャデータを参照しながら図
形を描画する際に、2値データを拡張することが可能で
ある。そのとき、“1”データに置き変わるカラーを設
定する。
When drawing a figure while referring to binary texture data, it is possible to extend the binary data. At this time, a color to be replaced with “1” data is set.

【0357】図32に、colorType の違いによるカラー
cのデータを示す。尚、これは下記のQiImage_setBackG
roudColor,QiImage_setClearColorでも同様である。
FIG. 32 shows the data of color c depending on the difference in colorType. In addition, this is the following QiImage_setBackG
The same applies to roudColor and QiImage_setClearColor.

【0358】次にQiImage_setBackGroundColor関数とQi
Image_getBackGroundColor関数の仕様を示す。QiImage_
setBackGroundColor(QiImage *image,const FIX *c)は
QiImage_setDrawModeで非透過指定を行い、2値のテク
スチャデータ参照する際の背景部分のカラーを設定す
る。cにカラーを設定する。
Next, the QiImage_setBackGroundColor function and Qi
Shows the specifications of the Image_getBackGroundColor function. QiImage_
setBackGroundColor (QiImage * image, const FIX * c)
Specify non-transparency with QiImage_setDrawMode, and set the color of the background when referring to binary texture data. Set color to c.

【0359】QiImage_getBackGroundColor(QiImage *im
age,FIX *c)はQiImage_setBackGroundColorで設定した
背景部分のカラー情報を得る。
[0359] QiImage_getBackGroundColor (QiImage * im
age, FIX * c) gets the color information of the background part set by QiImage_setBackGroundColor.

【0360】 METHOD NAME QiImage_setBackGroundColor QiImage_getBackGroundColor SPECIFICATION void QiImage_setBackGroundColor( QiImage *image, const FIX *c ) void QiImage_getBackGroundColor( QiImage *image, FIX *c ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_setBackGroundColor QiImage_getBackGroundColor SPECIFICATION void QiImage_setBackGroundColor (QiImage * image, const FIX * c) void QiImage_getBackGroundColor (QiImage * image, FIX * c) PARAMETERS image Specifies a pointer to an image object.

【0361】c 透過カラーとして参照するカラーを設定する。C Set a color to be referred to as a transmission color.

【0362】DESCRIPTION QiImage_setBackGroundColorは透過カラーとして参照す
るカラーデータを設定する。また、QiImage_getBackGro
undColorは透過カラーとして参照するカラーデータ情報
を得る。
Description QiImage_setBackGroundColor sets color data to be referred to as a transparent color. Also, QiImage_getBackGro
undColor obtains color data information referred to as a transparent color.

【0363】2値のテクスチャデータを参照しながら図
形を描画する際に、2値データを拡張することが可能で
ある。そのとき、“0”データに置き変わるカラーを設
定する。
When drawing a figure while referring to binary texture data, it is possible to extend the binary data. At this time, a color to be replaced with “0” data is set.

【0364】次にQiImage_setClearColor関数とQiImage
_getClearColor関数の仕様を示す。QiImage_setClearCo
lor(QiImage *image,const FIX *c)は描画フレーム切
り替えの際にフレームバッファをクリア時参照するカラ
ーを設定する。cにカラーを設定する。
Next, the QiImage_setClearColor function and the QiImage
Shows the specifications of the _getClearColor function. QiImage_setClearCo
lor (QiImage * image, const FIX * c) sets the color to be referred when clearing the frame buffer when switching drawing frames. Set color to c.

【0365】QiImage_getClearColor(QiImage *image,
FIX *c)はQiImage_setClearColorで設定した、フレーム
バッファをクリアするカラー情報を得る。
[0365] QiImage_getClearColor (QiImage * image,
FIX * c) obtains the color information that clears the frame buffer, set with QiImage_setClearColor.

【0366】 METHOD NAME QiImage_setClearColor QiImage_getClearColor SPECIFICATION void QiImage_setClearColor( QiImage *image, const FIX *c ) void QiImage_getClearColor( QiImage *image, FIX *c ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_setClearColor QiImage_getClearColor SPECIFICATION void QiImage_setClearColor (QiImage * image, const FIX * c) void QiImage_getClearColor (QiImage * image, FIX * c) PARAMETERS image Specifies a pointer to an image object.

【0367】c 画面クリアに参照するカラーを設定する。C Set the color to be referred to when clearing the screen.

【0368】DESCRIPTION QiImage_setClearColorは画面クリア用に使用するカラ
ーを設定する。また、QiImage_getClearColorは画面ク
リア用に使用するカラー上方を得る。QiImage_initiali
zeで設定するcolorTypeがQ_INDEX8の場合、カラーパレ
ットの0番目は画面クリア用に使用される。
Description QiImage_setClearColor sets the color used for clearing the screen. Also, QiImage_getClearColor gets the upper color used for clearing the screen. QiImage_initiali
When the colorType set by ze is Q_INDEX8, the 0th color palette is used for clearing the screen.

【0369】次にQiImage_setLightingPaletteNumber関
数とQiImage_getLightingPaletteNumber関数の仕様を示
す。QiImage_setLightingPaletteNumber(QiImage *imag
e,short sNum,short lNum)はインデックスモードで輝
度計算を行う場合のカラーパレット情報を設定する。sN
umには輝度計算時に参照するカラーパレットの開始番号
を設定する。またlNumにはレベル数を設定する。
Next, the specifications of the QiImage_setLightingPaletteNumber function and the QiImage_getLightingPaletteNumber function are shown. QiImage_setLightingPaletteNumber (QiImage * imag
e, short sNum, short lNum) sets color pallet information when performing luminance calculation in the index mode. sN
In um, the start number of the color palette to be referred to when calculating the luminance is set. Also, the number of levels is set in lNum.

【0370】QiImage_getLightingPaletteNumber(QiIma
ge *image,short *sNum,short*lNum)はインデックス
モードで輝度計算を行う場合のカラーパレット情報を得
る。
[0370] QiImage_getLightingPaletteNumber (QiIma
ge * image, short * sNum, short * lNum) obtains color palette information when performing luminance calculation in the index mode.

【0371】 METHOD NAME QiImage_setLightingPaletteNumber QiImage_getLightingPaletteNumber SPECIFICATION void QiImage_setLightingPaletteNumber( QiImage *image, short sNum, short lNum ) void QiImage_getLightingPaletteNumber( QiImage *image, short *sNum, short *lNum ) PARAMETERS image イメージオブジェクトのポインタを指定する。Method NAME QiImage_setLightingPaletteNumber QiImage_getLightingPaletteNumber SPECIFICATION void QiImage_setLightingPaletteNumber (QiImage * image, short sNum, short lNum) void QiImage_getLightingPaletteNumber (QiImage * image, short * sNum, short * lNERS Pointer image object that points to RAM image.

【0372】sNum インデックスカラーモードで輝度計算を行う際に参照す
るカラーパレットの開始番号を設定する。
SNum Set the start number of the color palette to be referred to when calculating the luminance in the index color mode.

【0373】lNum インデックスカラーモードで輝度計算を行う際のインデ
ックスカラーのレベル数を設定する。
1Num Sets the number of index color levels when performing luminance calculation in the index color mode.

【0374】DESCRIPTION QiImage_setLightingPaletteNumberはcolorTypeがQ_IND
EX8 で、輝度計算を行う場合のカラーパレットの情報を
設定する。また、QiImage_getLightingPaletteNumberは
colorTypeがQ_INDEX8 で、輝度計算を行う場合のカラー
パレットの情報を得る。尚、輝度計算時に参照するカラ
ーパレットは連続して設定されていなければならない。
[0374] Description QiImage_setLightingPaletteNumber has colorType Q_IND.
Set color pallet information for brightness calculation in EX8. Also, QiImage_getLightingPaletteNumber is
Gets color palette information when calculating luminance with colorType of Q_INDEX8. It should be noted that the color palette to be referred to at the time of luminance calculation must be set continuously.

【0375】次にQiImage_flush関数の仕様を示す。QiI
mage_flush(QiImage *image)は描画プロセッサに対し
て、ワークプレーンへの描画の起動をかける。
Next, the specifications of the QiImage_flush function are shown. QiI
mage_flush (QiImage * image) activates the drawing processor to start drawing on the work plane.

【0376】 [0376]

【0377】DESCRIPTION QiImage_flushはワークプレーンへの図形描画等を開始
する。QiImage_setScissorArea, QiImage_drawWorkLin
e,QiImage_drawWorkPolygon,QiImage_clearWorkPlan
e, QiImage_copyImageを実行した後、プリミティブ描
画を開始する前に実行しなければならない。
[0377] DESCRIPTION QiImage_flush starts drawing a figure on the work plane. QiImage_setScissorArea, QiImage_drawWorkLin
e, QiImage_drawWorkPolygon, QiImage_clearWorkPlan
e, After executing QiImage_copyImage, it must be executed before starting primitive drawing.

【0378】次にQiImage_swapBuffer関数の仕様を示
す。QiImage_swapBuffer(QiImage*image)は描画バッフ
ァと表示バッファを切り替える。
Next, the specifications of the QiImage_swapBuffer function are shown. QiImage_swapBuffer (QiImage * image) switches between a drawing buffer and a display buffer.

【0379】 [0379]

【0380】DESCRIPTION QiImage_swapBufferは描画/表示用のフレームバッファ
を切り替える。
Description QiImage_swapBuffer switches the drawing / display frame buffer.

【0381】次に上記の関数を用いて、本発明のテクス
チャマッピングを適用した立方体を描画するためのコー
ディング例を以下に示す。
Next, a coding example for drawing a cube to which the texture mapping of the present invention is applied by using the above function is shown below.

【0382】 #include “Qg_define.h” #include “Qg_memo.h” #include “QiGlobal.h” /** img **/ #include “QiDefine.h” /** img **/ #include “QiImage.h” /** img **/ #include ”mif.h” extern void FIN( void ); long texM0[32*32+3]; long texM1[32*32+3]; long texM2[32*32+3]; long texM3[32*32+3]; long texM4[32*32+3]; long texM5[32*32+3]; long texM6[32*32+3]; void main() { FIX col[4]; QiImage *img; short id; long loop ; QbMat m = { 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000 }; QgGraphics3D *g = QgCreate(); texture(); QiImage_initialize( img, Q_DOUBLE, Q_INDEX8, Q_INSTANT, Q_ZSORT_ON ); QiImage_setDrawMode( img, Q_WORK_OFF ); QiImage_setDrawMode( img, Q_SOURCE_ALL ); QiImage_setDrawMode( img, Q_BIT_SELECT_ODD ); QiImage_setDrawMode( img, Q_NET_OFF ); QiImage_setDrawMode( img, Q_CLIP_OFF ); QiImage_setDrawMode( img, Q_WRAP_LINEAR ); QiImage_setDrawMode( img, Q_TRANSIT_OFF ); col[0] = 0x0; col[1] = 0x00000480; col[2] = 0x0; QiImage_setPaletteColor( img, 1, col ); col[0] = 0x00000480; col[1] = 0x0; col[2] = 0x0; QiImage_setPaletteColor( img, 2, col ); col[0] = 0x0; col[1] = 0x00000900; col[2] = 0x0; QiImage_setPaletteColor( img, 3, col ); col[0] = 0x00000900; col[1] = 0x0; col[2] = 0x0; QiImage_setPaletteColor( img, 4, col ); col[0] = 0x0; col[1] = 0x00001080; col[2] = 0x0; QiImage_setPaletteColor( img, 5, col ); col[0] = 0x00001080; col[1] = 0x0; col[2] = 0x0; QiImage_setPaletteColor( img, 6, col ); col[0] = 0x0; col[1] = 0x00002480; col[2] = 0x00000b00; QiImage_setPaletteColor( img, 7, col ); col[0] = 0x00002480; col[1] = 0x00000b00; col[2] = 0x0; QiImage_setPaletteColor( img, 8, col ); col[0] = 0x0; col[1] = 0x00003e00; col[2] = 0x00001780; QiImage_setPaletteColor( img, 9, col ); col[0] = 0x00003e00; col[1] = 0x00001780; col[2] = 0x0; QiImage_setPaletteColor( img, 10, col ); col[0] = 0x00000c80; col[1] = 0x00006600; col[2] = 0x00003980; QiImage_setPaletteColor( img, 11, col ); col[0] = 0x00006600; col[1] = 0x00003980; col[2] = 0x00000c80; QiImage_setPaletteColor( img, 12, col ); col[0] = 0x00003180; col[1] = 0x00006480; col[2] = 0x00004b00; QiImage_setPaletteColor( img, 13, col ); col[0] = 0x00006480; col[1] = 0x00004b00; col[2] = 0x00003180; QiImage_setPaletteColor( img, 14, col ); col[0] = 0x0000; col[1] = 0x0000; col[2] = 0x0000ffff; QiImage_setClearColor( img, col ); QiImage_setInputDataConvert( img, Q_NOOP ); QiImage_setOutputDataConvert( img, Q_NOOP ); QiImage_loadTexture( img, Q_MULTI, Q_MIPMAP, 0x00070000, &id, texM0, texM1, texM2 , texM3 , texM4 , texM5 , texM6 ); QiImage_setBufferMode( img, Q_DOUBLE ); QiImage_setImageMode( img, Q_DOUBLE ); QiImage_setImageDataType( img, Q_INSTANT ); QiImage_setLightingPaletteNumber( img, 0, 7 ); QgGraphics3D_setOrthographic( g , 0xFF380000, 0x00C80000, 0xFF380000, 0x00C80000, 0x000A0000, 0x01900000 );/*−200,200,−200,200,10,400*/ QgGraphics3D_setDepthRange( g , 0x00000000, 0x00010000 ); QgGraphics3D_setViewportRegion(g , 0x00000000, 0x00000000 , 0x01400000 , 0x00F00000 ); setModel( g ); /* CUBE data */ QgGraphics3D_enable( g , QG_LIGHTING ); QgGraphics3D_enable( g , QG_LIGHT0 ); QgGraphics3D_setHSRType( g , QG_ZSORT0 ); /* sort on */ QgGraphics3D_setShadeModel( g , QG_FLAT ); while(1){ for( loop=0x00000000 ; loop <0x01680000 ; loop=loop+0x00010000 ){ QgGraphics3D_setMatrix( g , m ); QgGraphics3D_translateMatrix( g , 0x00000000, 0x00000000 , 0xFF6A0000 ); QgGraphics3D_rotateMatrix( g , 0x00000000, 0x00010000 , 0x00000000 , loop ); drawModel( g , id ); QgGraphics3D_flush( g ); QiImage_swapBuffer( &img ); } } FIN(); } 図33に本発明のテクスチャマッピングを適用した描画
の例を示す。尚、この例は上記のコーディング例により
得られたものである。
#Include “Qg_define.h” #include “Qg_memo.h” #include “QiGlobal.h” / ** img ** / #include “QiDefine.h” / ** img ** / #include “QiImage. h ”/ ** img ** / #include“ mif.h ”extern void FIN (void); long texM0 [32 * 32 + 3]; long texM1 [32 * 32 + 3]; long texM2 [32 * 32 + 3]; long texM3 [ Long texM4 [32 * 32 + 3]; long texM5 [32 * 32 + 3]; long texM6 [32 * 32 + 3]; void main () {FIX col [4]; QiImage * img; short id; long loop; QbMat m = {0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000}; QgGraphicsg * (gg) (img, Q_DOUBLE, Q_INDEX8, Q_INSTANT, Q_ZSORT_ON); QiImage_setDrawMode (img, Q_WORK_OFF); QiImage_setDrawMode (img, Q_SOURCE_ALL); QiImage_setDrawMode (img, Q_BIT_SELECT_ODD); QiImage_Set DrawMode (img, Q_CLIP_OFF); QiImage_setDrawMode (img, Q_WRAP_LINEAR); QiImage_setDrawMode (img, Q_TRANSIT_OFF); col [0] = 0x0; col [1] = 0x00000480; col [2] = 0x0; QiImage_setPaletteColor img Col [0] = 0x00000480; col [1] = 0x0; col [2] = 0x0; QiImage_setPaletteColor (img, 2, col); col [0] = 0x0; col [1] = 0x00000900; col [2] = 0x0; QiImage_setPaletteColor (img, 3, col); col [0] = 0x00000900; col [1] = 0x0; col [2] = 0x0; QiImage_setPaletteColor (img, 4, col); col [0] = 0x0; col [ 1] = 0x00001080; col [2] = 0x0; QiImage_setPaletteColor (img, 5, col); col [0] = 0x00001080; col [1] = 0x0; col [2] = 0x0; QiImage_setPaletteColor (img, 6, col) Col [0] = 0x0; col [1] = 0x00002480; col [2] = 0x00000b00; QiImage_setPaletteColor (img, 7, col); col [0] = 0x00002480; col [1] = 0x00000b00; col [2] = 0x0; QiImage_setPaletteColor (img, 8, col); col [0] = 0x0; col [1] = 0x00003e00; col [2] = 0x00001780; QiImage_setPaletteColor (im col [0] = 0x00003e00; col [1] = 0x00001780; col [2] = 0x0; QiImage_setPaletteColor (img, 10, col); col [0] = 0x00000c80; col [1] = 0x00006600 Col [2] = 0x00003980; QiImage_setPaletteColor (img, 11, col); col [0] = 0x00006600; col [1] = 0x00003980; col [2] = 0x00000c80; QiImage_setPaletteColor (img, 12, col); col [0 Col [1] = 0x00006480; col [2] = 0x00004b00; QiImage_setPaletteColor (img, 13, col); col [0] = 0x00006480; col [1] = 0x00004b00; col [2] = 0x00003180; QiImage_setPaletteColor ( col [0] = 0x0000; col [1] = 0x0000; col [2] = 0x0000ffff; QiImage_setClearColor (img, col); QiImage_setInputDataConvert (img, Q_NOOP); QiImage_setOutputDataConvert (img, Q_NOOP); QiImage_Text (img, Q_MULTI, Q_MIPMAP, 0x00070000, & id, texM0, texM1, texM2, texM3, texM4, texM5, texM6); QiImage_setBufferMode (img, Q_DOUBLE); T); QiImage_setLightingPaletteNumber (img, 0, 7); QgGraphics3D_setOrthographic (g, 0xFF380000, 0x00C80000, 0xFF380000, 0x00C80000, 0x000A0000, 0x01900000, eps; (g, 0x00000000, 0x00000000, 0x01400000, 0x00F00000); setModel (g); / * CUBE data * / QgGraphics3D_enable (g, QG_LIGHTING); QgGraphics3D_enable (g, QG_LIGHT0); While (1) {for (loop = 0x00000000; loop <0x01680000; loop = loop + 0x00010000) {QgGraphics3D_setMatrix (g, m); , 0x00010000, 0x00000000, loop); drawModel (g, id); QgGraphics3D_flush (g); QiImage_swapBuffer (&img);}} FIN ();} FIG. 33 shows the texture mapping of the present invention. Here is an example of the applied drawing. This example is obtained by the above coding example.

【0383】[0383]

【発明の効果】本発明によれば、画素毎のブレンド処理
を必要としないため、低コスト(少ないハードウェア物
量)で高速な表示が可能になる。また、γ補正等の高品
質化処理を事前に行うことができるため、性能を劣化さ
せることなく高品質な表示が可能となる。
According to the present invention, since a blending process is not required for each pixel, high-speed display can be performed at low cost (a small amount of hardware). In addition, since high quality processing such as γ correction can be performed in advance, high quality display can be performed without deteriorating performance.

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

【図1】本発明を用いたグラフィックスシステムの構成
図(ダイレクトカラーの場合)。
FIG. 1 is a configuration diagram of a graphics system using the present invention (in the case of direct color).

【図2】本発明によるテクスチャマッピングの概説図。FIG. 2 is a schematic diagram of texture mapping according to the present invention.

【図3】CPU部で行われる本発明のテクスチャマッピ
ング処理フロー。
FIG. 3 is a flowchart of a texture mapping process of the present invention performed by a CPU unit.

【図4】図3における各種パラメータ設定の詳細。FIG. 4 shows details of various parameter settings in FIG.

【図5】図4におけるソース画像設定の詳細。FIG. 5 shows details of a source image setting in FIG. 4;

【図6】輝度の異なる複数のソース画像とその関連情
報。
FIG. 6 shows a plurality of source images having different luminances and related information.

【図7】ソース画像バッファに格納された輝度の異なる
複数のソース画像。
FIG. 7 shows a plurality of source images having different luminances stored in a source image buffer.

【図8】ソース画像テーブルの詳細。FIG. 8 shows details of a source image table.

【図9】照光モデル。FIG. 9 is an illumination model.

【図10】図3におけるソース画像選択の詳細。FIG. 10 shows details of source image selection in FIG. 3;

【図11】ソース座標とデバイス座標の関係。FIG. 11 shows a relationship between source coordinates and device coordinates.

【図12】コマンドの詳細。FIG. 12 shows details of a command.

【図13】図10におけるソース画像選択の拡張。FIG. 13 is an extension of the source image selection in FIG.

【図14】フィルタ処理。FIG. 14 shows a filtering process.

【図15】図13におけるソース画像選択の拡張。FIG. 15 is an extension of the source image selection in FIG.

【図16】輝度変更処理の詳細。FIG. 16 shows details of a brightness change process.

【図17】本発明を用いたグラフィックスシステムの構
成図(インデックスカラーの場合)。
FIG. 17 is a configuration diagram of a graphics system using the present invention (in the case of index color).

【図18】カラーパレットの詳細。FIG. 18 shows details of a color palette.

【図19】本グラフィックスライブラリで取り扱い可能
なプリミティブ。
FIG. 19 shows primitives that can be handled by the graphics library.

【図20】連続四角形の場合の頂点の順序。FIG. 20 shows the order of vertices in the case of a continuous rectangle.

【図21】シェードモデルやテクスチャマッピングとプ
リミティブタイプとの関係。
FIG. 21 shows a relationship between a shade model or texture mapping and a primitive type.

【図22】モデルビュー行列と投影行列のスタック。FIG. 22 shows a stack of a model view matrix and a projection matrix.

【図23】行列スタックのプッシュとポップ。FIG. 23. Push and pop of a matrix stack.

【図24】フラットシェーディングに用いる代表色の算
出ルール。
FIG. 24 shows a calculation rule of a representative color used for flat shading.

【図25】imgModeとimgDataTypeの関係。FIG. 25 shows the relationship between imgMode and imgDataType.

【図26】dataTypeとimgModeの関係。FIG. 26 shows the relationship between dataType and imgMode.

【図27】flameBufferTypeとbufModeの関係。FIG. 27 shows the relationship between flameBufferType and bufMode.

【図28】フレームバッファあるいはワークプレーンの
クリッピング。
FIG. 28 shows clipping of a frame buffer or a work plane.

【図29】ワークプレーンへの折れ線描画。FIG. 29 is a polygonal line drawing on a work plane.

【図30】ワークプレーンへのポリゴン描画。FIG. 30 is a drawing of a polygon on a work plane.

【図31】ワークプレーンのクリア。FIG. 31 shows clearing of a work plane.

【図32】colorTypeとカラーの関係。FIG. 32 shows the relationship between colorType and color.

【図33】本グラフィックスライブラリを用いた図形描
画の例。
FIG. 33 shows an example of graphic drawing using the graphics library.

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

1000…グラフィックス処理部、1100…CPU、
1200…グラフィックスプロセッサ、1210…コマ
ンドバッファ制御部、1220…ソース画像バッファ制
御部、1230…フレームバッファ制御部、1300…
表示プロセッサ、1310…カラーパレット、1400
…メモリコントローラ、2000…メモリ部、2100
…主記憶、2110…ソース画像テーブル、2200…
コマンドバッファ、2300…ソース画像バッファ、2
310…ソース座標系、2320…輝度レベル0のソー
ス画像、2330…輝度レベル2のソース画像、234
0…輝度レベル4のソース画像、2400…フレームバ
ッファ、2410…デバイス座標系、3000…表示
部、3500…入出力処理部、4000…各種パラメー
タ設定、4100…座標変換行列設定、4200…光源
パラメータ設定、4300…材質パラメータ設定、44
00…投影変換行列設定、4500…ソース画像設定、
4510…ソース画像ID設定、4520…輝度レベル
設定、4530…ソース画像データ設定、4540…ソ
ース画像テーブル設定、5000…座標変換、6000
…輝度計算、6100…照光モデル、7000…ソース
画像選択、7110…フィルタ処理、7210…輝度変
更処理、7220…クランプ処理、8000…投影変
換、9000…コマンド作成。
1000: graphics processing unit, 1100: CPU,
1200 Graphics processor 1210 Command buffer controller 1220 Source image buffer controller 1230 Frame buffer controller 1300
Display processor, 1310 ... Color palette, 1400
... Memory controller, 2000 ... Memory section, 2100
... Main memory, 2110 ... Source image table, 2200 ...
Command buffer, 2300: source image buffer, 2
310: Source coordinate system, 2320: Source image of luminance level 0, 2330: Source image of luminance level 2, 234
0: source image of luminance level 4, 2400: frame buffer, 2410: device coordinate system, 3000: display unit, 3500: input / output processing unit, 4000: various parameter settings, 4100: coordinate conversion matrix setting, 4200: light source parameter setting , 4300: material parameter setting, 44
00: Projection transformation matrix setting, 4500: Source image setting,
4510: source image ID setting, 4520: brightness level setting, 4530: source image data setting, 4540: source image table setting, 5000: coordinate conversion, 6000
... luminance calculation, 6100 ... illumination model, 7000 ... source image selection, 7110 ... filter processing, 7210 ... brightness change processing, 7220 ... clamp processing, 8000 ... projection conversion, 9000 ... command creation.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 佐藤 潤 東京都小平市上水本町五丁目20番1号 株 式会社日立製作所半導体事業部内 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Jun Sato 5-2-1, Josuihoncho, Kodaira-shi, Tokyo In the semiconductor division of Hitachi, Ltd.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】3次元空間で定義される図形が2次元空間
に投影され、その投影された図形にソース画像を張り付
けるグラフィックス表示装置において、 図形に付けられた指標によりソース画像を選択するCP
U部又は/及び手段と、 輝度の異なる複数のソース画像を格納するメモリ部又は
/及び手段とを具備することにより、低コストで高速か
つ高品質にテクスチャマッピングできることを特徴とす
るグラフィックス表示装置及び方法。
1. A graphics display device in which a figure defined in a three-dimensional space is projected onto a two-dimensional space and a source image is pasted on the projected figure, wherein a source image is selected based on an index attached to the figure. CP
A graphics display device comprising: a U section or / and means; and a memory section or / and means for storing a plurality of source images having different luminances, whereby texture mapping can be performed at high speed and with high quality at low cost. And methods.
【請求項2】請求項1記載の装置及び方法において、 図形に付けられた指標として、ユーザから予め与えられ
た輝度を用いることを特徴とするグラフィックス表示装
置及び方法。
2. A graphics display apparatus and method according to claim 1, wherein a luminance given in advance by a user is used as an index attached to the figure.
【請求項3】請求項1記載の装置及び方法において、 図形に付けられた指標として、輝度計算をした結果を用
いることを特徴とするグラフィックス表示装置及び方
法。
3. The graphics display device and method according to claim 1, wherein a result of luminance calculation is used as an index attached to the figure.
【請求項4】請求項1記載の装置及び方法において、 要求するソース画像がメモリ部に存在しない場合に新た
にソース画像を生成することを特徴とするグラフィック
ス表示装置及び方法。
4. The graphics display apparatus and method according to claim 1, wherein a new source image is generated when the requested source image does not exist in the memory unit.
【請求項5】3次元空間で定義される図形が2次元空間
に投影され、その投影された図形にソース画像を張り付
けるグラフィックス表示装置において、 メモリ部,グラフィックス処理部を具備し、かつ、 輝度の異なる複数のソース画像をメモリ部に格納するた
めのインターフェース(手段)を有することにより、低
コストで高速かつ高品質にテクスチャマッピングできる
ことを特徴とするグラフィックス表示装置及び方法。
5. A graphics display device for projecting a graphic defined in a three-dimensional space onto a two-dimensional space and pasting a source image to the projected graphic, comprising a memory unit and a graphics processing unit; A graphics display device and method capable of performing high-speed and high-quality texture mapping at low cost by having an interface (means) for storing a plurality of source images having different luminances in a memory unit.
JP8236164A 1996-09-06 1996-09-06 Device and method for displaying graphics Withdrawn JPH1083180A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8236164A JPH1083180A (en) 1996-09-06 1996-09-06 Device and method for displaying graphics

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8236164A JPH1083180A (en) 1996-09-06 1996-09-06 Device and method for displaying graphics

Publications (1)

Publication Number Publication Date
JPH1083180A true JPH1083180A (en) 1998-03-31

Family

ID=16996726

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8236164A Withdrawn JPH1083180A (en) 1996-09-06 1996-09-06 Device and method for displaying graphics

Country Status (1)

Country Link
JP (1) JPH1083180A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001160152A (en) * 1999-12-03 2001-06-12 Namco Ltd Image generation system and information storage medium
JP2005275797A (en) * 2004-03-24 2005-10-06 Namco Ltd Program, information storage medium, image generation system
JP2009539147A (en) * 2006-06-01 2009-11-12 クゥアルコム・インコーポレイテッド Apparatus and method for selectively double buffering part of displayable content
JP5002742B2 (en) * 2000-03-17 2012-08-15 ヒューレット・パッカード・カンパニー Apparatus and method for rendering 3D objects using parametric texture maps
JP2013225318A (en) * 2009-12-23 2013-10-31 Intel Corp Grouping pixels to be textured

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001160152A (en) * 1999-12-03 2001-06-12 Namco Ltd Image generation system and information storage medium
JP5002742B2 (en) * 2000-03-17 2012-08-15 ヒューレット・パッカード・カンパニー Apparatus and method for rendering 3D objects using parametric texture maps
JP2005275797A (en) * 2004-03-24 2005-10-06 Namco Ltd Program, information storage medium, image generation system
JP4502678B2 (en) * 2004-03-24 2010-07-14 株式会社バンダイナムコゲームス Program, information storage medium, and image generation system
JP2009539147A (en) * 2006-06-01 2009-11-12 クゥアルコム・インコーポレイテッド Apparatus and method for selectively double buffering part of displayable content
JP2013225318A (en) * 2009-12-23 2013-10-31 Intel Corp Grouping pixels to be textured

Similar Documents

Publication Publication Date Title
JP2682559B2 (en) Apparatus and method for displaying image of object on display device and computer graphics display system
Rezk-Salama et al. Interactive volume on standard pc graphics hardware using multi-textures and multi-stage rasterization
US6914610B2 (en) Graphics primitive size estimation and subdivision for use with a texture accumulation buffer
US6038031A (en) 3D graphics object copying with reduced edge artifacts
US6947057B2 (en) Rendering lines with sample weighting
US6888544B2 (en) Apparatus for and method of rendering 3D objects with parametric texture maps
US8144158B2 (en) Display system having floating point rasterization and floating point framebuffering
US5949426A (en) Non-linear texture map blending
JP3359120B2 (en) Image data processing method and apparatus
US6532013B1 (en) System, method and article of manufacture for pixel shaders for programmable shading
US6734851B2 (en) Analytic warping
CA2301607C (en) An improved method and apparatus for per pixel mip mapping and trilinear filtering
US6515674B1 (en) Apparatus for and of rendering 3d objects with parametric texture maps
US6806886B1 (en) System, method and article of manufacture for converting color data into floating point numbers in a computer graphics pipeline
US6762760B2 (en) Graphics system configured to implement fogging based on radial distances
US6833836B2 (en) Image rendering process for displaying three-dimensional image information on a two-dimensional screen
US6906729B1 (en) System and method for antialiasing objects
EP1058912B1 (en) Subsampled texture edge antialiasing
JPH1083180A (en) Device and method for displaying graphics
US7116333B1 (en) Data retrieval method and system
US6927775B2 (en) Parallel box filtering through reuse of existing circular filter
JP2777577B2 (en) Apparatus and method for generating shading value of graphic object
WO1998050890A1 (en) Spotlight characteristic forming method and image processor using the same
US6750862B1 (en) Method and system for performing enhanced lighting functions for texture map data
US6847368B2 (en) Graphics system with a buddy / quad mode for faster writes

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20040309

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060322

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20060517