JPH08110951A - Texture mapping device - Google Patents

Texture mapping device

Info

Publication number
JPH08110951A
JPH08110951A JP27044794A JP27044794A JPH08110951A JP H08110951 A JPH08110951 A JP H08110951A JP 27044794 A JP27044794 A JP 27044794A JP 27044794 A JP27044794 A JP 27044794A JP H08110951 A JPH08110951 A JP H08110951A
Authority
JP
Japan
Prior art keywords
texture
fill
coordinates
address
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP27044794A
Other languages
Japanese (ja)
Inventor
Koichi Kaneko
幸市 金子
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.)
Yamaha Corp
Original Assignee
Yamaha Corp
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 Yamaha Corp filed Critical Yamaha Corp
Priority to JP27044794A priority Critical patent/JPH08110951A/en
Priority to TW084106984A priority patent/TW278162B/zh
Priority to US08/541,670 priority patent/US5764237A/en
Publication of JPH08110951A publication Critical patent/JPH08110951A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE: To allocate texture data in various states and to effectively utilize a memory. CONSTITUTION: The two-dimensional (2D) display data of a three-dimensional (3D) object are stored in a frame memory 4 by a fill coordinate system corresponding to a display screen. Texture data to be mapped on the surface of the 3D object are stored in a texture memory 5 by a texture coordinate system. A texture mappling part 1 inputs fill coordinates and texture coordinates obtained by regulating a range for texture mapping by both the fill coordinate system and texture coordinate system, successively generates fill addresses of respective picture elements in the range regulated by the fill coordinates and generates texture addresses in the texture coordinate system which correspond to the generated fill addresses. And, texture data are read out from a storage location in the memory 5 which is specified by a certain generated texture address and stored in a storage location of the memory 4 which is specified by the fill address.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、3次元グラフィック
スシステム等において、ディスプレイ装置に表示された
3次元モデルの表面に任意のテクスチャを付与するため
のテクスチャマッピング装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a texture mapping device for giving an arbitrary texture to the surface of a three-dimensional model displayed on a display device in a three-dimensional graphics system or the like.

【0002】[0002]

【従来の技術】コンピュータグラフィックスにおいて、
3次元対象物の表示のリアリティを高める手法の一つと
してテクスチャマッピングが知られている。テクスチャ
マッピングは、図12に示すように、3次元表示対象物
31の表面に表面粗さや特定のパターン32を貼りつけ
て、表示対象物31の表面を写実的に表示する手法であ
る。これを実現するシステムでは、マッピングされるテ
クスチャデータを記憶するためのテクスチャメモリが備
えられる。そして、2次元表示平面に対応するフィル座
標で指定された塗り潰すべきポリゴンの頂点座標に基づ
いて、そのポリゴンの頂点座標によって規定される形状
と同一形状のテクスチャをテクスチャメモリ上に規定
し、その範囲内のテクスチャデータをテクスチャメモリ
から読み出して、指定されたポリゴン内に割り付けてい
く。
2. Description of the Related Art In computer graphics,
Texture mapping is known as one of methods for increasing the reality of displaying a three-dimensional object. The texture mapping is a method of realistically displaying the surface of the display object 31 by pasting a surface roughness or a specific pattern 32 on the surface of the three-dimensional display object 31, as shown in FIG. A system that achieves this is equipped with a texture memory for storing texture data to be mapped. Then, based on the vertex coordinates of the polygon to be filled specified by the fill coordinates corresponding to the two-dimensional display plane, a texture having the same shape as the shape defined by the vertex coordinates of the polygon is specified in the texture memory, The texture data within the range is read from the texture memory and allocated within the designated polygon.

【0003】[0003]

【発明が解決しようとする課題】しかし、上述した従来
のテクスチャマッピング装置では、指定したポリゴンの
頂点座標によって規定される形状と同一形状のテクスチ
ャをテクスチャメモリ上に規定するように構成している
ので、例えば、図12(a)のような立方体にテクスチ
ャマッピングする場合、(ア)面、(イ)面及び(ウ)
面はそれぞれの面の法線方向から見れば正方形であるに
も拘らず、(ア)面、(イ)面及び(ウ)面のそれぞれ
の面に対応したテクスチャを記憶する必要がある。言い
換えると、図12(b)の(ア)面に着目した場合、こ
の立方体をx軸を中心に90度矢印方向に回転させる
と、(ア)面は(イ)面のように現れ、同様に、この立
方体をy軸を中心に90度回転させると、(ア)面は
(ウ)面のように現れるようにしたいが、それぞれのテ
クスチャを各々記憶しなければならない。要するに、あ
る面に貼り付けられる同一のテクスチャであるにも拘ら
ず、従来のテクスチャマッピング装置では、面の回転、
移動、拡大等を考慮したテクスチャをも記憶しなければ
ならなかったため、メモリの容量が増えるという問題が
あった。メモリ容量を増やしたところで自ずと限界があ
り、割り付け態様の自由度が小さい。メモリ容量を増や
さない場合には、図12(c)のような不自然なテクス
チャしかマッピングすることができない。
However, in the above-mentioned conventional texture mapping device, since the texture having the same shape as the shape defined by the vertex coordinates of the designated polygon is defined in the texture memory. For example, when texture mapping is performed on a cube as shown in FIG. 12A, the (A) plane, the (A) plane, and the (C) plane
Although the surface is a square when viewed from the normal direction of each surface, it is necessary to store the texture corresponding to each of the (A) surface, the (A) surface, and the (C) surface. In other words, when focusing on the (A) plane in FIG. 12B, when this cube is rotated in the direction of the arrow by 90 degrees about the x axis, the (A) plane appears like the (A) plane, and Then, when this cube is rotated 90 degrees about the y-axis, it is desired that the (A) plane appears like the (C) plane, but each texture must be stored. In short, in the conventional texture mapping device, even if the same texture is pasted on a certain surface, the surface rotation,
There is a problem that the memory capacity increases because the texture that takes into consideration the movement, the enlargement, and the like must be stored. There is a limit naturally in increasing the memory capacity, and the degree of freedom in the allocation mode is small. If the memory capacity is not increased, only an unnatural texture as shown in FIG. 12C can be mapped.

【0004】この発明は、このような問題点に鑑みてな
されたもので、テクスチャデータを種々の態様で割り付
けることができ、メモリの容量も少なくできるテクスチ
ャマッピング装置を提供することを目的とする。
The present invention has been made in view of the above problems, and an object of the present invention is to provide a texture mapping device capable of allocating texture data in various modes and reducing the memory capacity.

【0005】[0005]

【課題を解決するための手段】この発明に係るテクスチ
ャマッピング装置は、3次元対象物の2次元表示データ
を記憶するフレーム記憶手段と、前記3次元対象物の表
面にマッピングされるテクスチャデータを記憶するテク
スチャ記憶手段と、テクスチャマッピングすべき範囲を
規定したフィル座標及びテクスチャ座標を入力し、前記
フィル座標により規定される範囲の内部の各画素のフィ
ルアドレスを順次生成すると共に、生成されたフィルア
ドレスに対応するテクスチャアドレスを生成し、この生
成されたテクスチャアドレスで指定される前記テクスチ
ャ記憶手段の記憶場所からテクスチャデータを読み出し
て、前記フィルアドレスで指定される前記フレーム記憶
手段の記憶場所に格納するマッピング手段とを有するこ
とを特徴とする。
A texture mapping device according to the present invention stores frame storage means for storing two-dimensional display data of a three-dimensional object and texture data to be mapped on the surface of the three-dimensional object. The texture storage means for inputting the fill coordinates and the texture coordinates defining the range to be texture-mapped are sequentially generated, and the fill address of each pixel within the range defined by the fill coordinates is sequentially generated. Texture address is generated, texture data is read from the storage location of the texture storage means specified by the generated texture address, and stored in the storage location of the frame storage means specified by the fill address. And a mapping means.

【0006】[0006]

【作用】この発明によれば、テクスチャマッピングすべ
き範囲をフィル座標及びテクスチャ座標の双方で与える
と、マッピング手段は、前記フィル座標により規定され
る範囲の内部の各画素のフィルアドレスを順次生成する
と共に、生成されたフィルアドレスに対応するテクスチ
ャアドレスを生成し、この生成されたテクスチャアドレ
スで指定される前記テクスチャ記憶手段の記憶場所から
テクスチャデータを読み出して、前記フィルアドレスで
指定される前記フレーム記憶手段の記憶場所に格納する
ので、フィル座標に対するテクスチャ座標の与え方によ
って、テクスチャデータを任意に拡大、縮小、回転及び
変形させて割り付けることができる。このため、多様な
態様のマッピングを行うことができると共に、テクスチ
ャ記憶手段には、標準的なパターンのみを記憶しておけ
ばよいので、メモリ容量も削減することができる。
According to the present invention, when the range to be texture-mapped is given by both the fill coordinate and the texture coordinate, the mapping means sequentially generates the fill address of each pixel inside the range defined by the fill coordinate. At the same time, a texture address corresponding to the generated fill address is generated, texture data is read from the storage location of the texture storage means specified by the generated texture address, and the frame storage specified by the fill address is stored. Since the data is stored in the memory location of the means, the texture data can be arbitrarily expanded, reduced, rotated, and deformed and allocated depending on how the texture coordinates are given to the fill coordinates. Therefore, various modes of mapping can be performed, and since only the standard pattern needs to be stored in the texture storage unit, the memory capacity can be reduced.

【0007】通常、3次元の動画を表示する場合、一旦
表示されたポリゴンは、拡大、縮小、回転等しながら、
しばらくの間は画面上に表示され続けることが多い。そ
の際、この発明のテクスチャマッピング装置を使用すれ
ば、外部のCPUは、各ポリゴンに対応して、そのテク
スチャ座標だけを記憶しておけば良く、そのため、動画
の変化によるフィル座標の変化に対して記憶されている
テクスチャ座標をそのまま使用することにより、動画の
変化に応じてテクスチャマッピングの処理が可能とな
る。よって、自然なテクスチャマッピングを行うことが
でき、外部のCPUの負担を軽減することができる。
Usually, when displaying a three-dimensional moving image, the polygon once displayed is enlarged, reduced, rotated, etc.
It often stays on the screen for a while. At that time, if the texture mapping device of the present invention is used, the external CPU needs to store only the texture coordinates corresponding to each polygon. Therefore, even if the fill coordinates change due to the change of the moving image. By using the texture coordinates stored as it is, the texture mapping process can be performed according to the change of the moving image. Therefore, natural texture mapping can be performed, and the load on the external CPU can be reduced.

【0008】[0008]

【実施例】以下、図面を参照して、この発明の実施例を
説明する。図1は、この発明の実施例に係るテクスチャ
マッピング装置の構成を示すブロック図である。このテ
クスチャマッピング装置は、テクスチャマッピング部1
と、画像メモリ2とにより構成される。テクスチャマッ
ピング部1は、例えば1チップで構成され、外部のCP
U3に接続されている。画像メモリ2は、フレームメモ
リ4とテクスチャメモリ5とから構成され、フレームメ
モリ4には、テクスチャマッピングの対象となる3次元
画像データが表示平面に対応したフィル座標系で格納さ
れ、テクスチャメモリ5には、マッピングすべきテクス
チャデータがテクスチャ座標系で格納されている。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the structure of a texture mapping device according to an embodiment of the present invention. This texture mapping device includes a texture mapping unit 1
And the image memory 2. The texture mapping unit 1 is composed of, for example, one chip, and has an external CP.
It is connected to U3. The image memory 2 is composed of a frame memory 4 and a texture memory 5, and the frame memory 4 stores three-dimensional image data to be texture-mapped in a fill coordinate system corresponding to a display plane. Stores the texture data to be mapped in the texture coordinate system.

【0009】CPU3からは、フィル座標系におけるマ
ッピングすべき三角形の3つの頂点座標(フィル座標)
と、各々の頂点に対応するテクスチャ座標系における貼
り付ける三角形の3つの頂点座標(テクスチャ座標)と
が与えられる。これらの座標はユーザの意向に沿ってC
PU3によって設定される。なお、初期座標のみをユー
ザが指定し、以降はユーザが回転、移動、拡大、縮小等
の制御データを与えるだけでCPU3がフィル座標を計
算するように構成しても良い。ここで重要なのは、フィ
ル座標、テクスチャ座標それぞれの初期座標をCPU3
がテクスチャマッピング部1に与えた後は、その物体の
回転、移動、拡大、縮小に伴い、フィル座標は更新され
るがテクスチャ座標については記憶した初期座標値をそ
のまま使えるということである。それにより、ユーザ又
はCPU3の負担が著しく低減される。
From the CPU 3, the three vertex coordinates (fill coordinates) of the triangle to be mapped in the fill coordinate system.
And the three vertex coordinates (texture coordinates) of the triangle to be pasted in the texture coordinate system corresponding to each vertex. These coordinates are C according to the user's intention.
It is set by PU3. Note that the user may specify only the initial coordinates, and thereafter, the CPU 3 may calculate the fill coordinates only by giving control data such as rotation, movement, enlargement, and reduction. What is important here is that the initial coordinates of the fill coordinates and the texture coordinates are set to the CPU3
After being given to the texture mapping unit 1, the fill coordinates are updated with the rotation, movement, enlargement, and reduction of the object, but the stored initial coordinate values can be used for the texture coordinates as they are. This significantly reduces the burden on the user or the CPU 3.

【0010】これらの座標データは、CPUインタフェ
ース11を介してフィルアドレス生成部12及びテクス
チャアドレス生成部13に供給される。ここで使用され
る「アドレス」という用語は、必ずしもメモリアドレス
を示すものではなく、x,y座標値と同意である。一般
的なメモリでは2次元的に配置されたメモリアドレスセ
ルをロウ/カラムのアドレスで指定するように構成され
ているため、メモリアドレスとx,y座標は1対1に対
応する。よって、「メモリアドレス」というのも「x,
y座標値」というのも大差はない。フィルアドレス生成
部12は、与えられたフィル座標から、それによって規
定される三角形内の全画素についてのフレームメモリ4
上のフィルアドレスを水平走査方向に沿って順次生成す
る。テクスチャアドレス生成部13は、フィルアドレス
生成部12で生成されたフィルアドレスに対応するテク
スチャメモリ5上のテクスチャアドレスを生成する。テ
クスチャアドレス生成部13で生成されたテクスチャア
ドレスは、ゲート回路14に供給される。ゲート回路1
4は、与えられたテクスチャアドレスをテクスチャメモ
リ5の所定記憶領域内のアドレスに制限して指定された
パターンのテクスチャアドレスに変換する。ゲート回路
14の出力は、セレクタ15の一方の入力端に供給され
ている。セレクタ15の他方の入力端には、フィルアド
レス生成部12からのフィルアドレスが供給されてい
る。セレクタ15は、制御部16の制御のもとで両アド
レスを切換えて画像メモリ2に読出アドレス又は書込ア
ドレスとして供給する。データ処理部17は、画像メモ
リ2から読み出されたデータに対して必要に応じて所定
の処理を施す。これら各部の制御は、制御部16によっ
て実行される。
These coordinate data are supplied to the fill address generator 12 and the texture address generator 13 via the CPU interface 11. As used herein, the term "address" does not necessarily indicate a memory address, but is synonymous with x, y coordinate values. In a general memory, memory address cells arranged two-dimensionally are designated by row / column addresses, so that the memory address and the x, y coordinates correspond one to one. Therefore, "memory address" is also "x,
There is no big difference in the "y coordinate value". The fill address generation unit 12 determines, from the given fill coordinates, the frame memory 4 for all pixels in the triangle defined by the fill coordinates.
The above fill addresses are sequentially generated along the horizontal scanning direction. The texture address generation unit 13 generates a texture address on the texture memory 5 corresponding to the fill address generated by the fill address generation unit 12. The texture address generated by the texture address generation unit 13 is supplied to the gate circuit 14. Gate circuit 1
Reference numeral 4 limits the given texture address to an address within a predetermined storage area of the texture memory 5 and converts it into a texture address of a designated pattern. The output of the gate circuit 14 is supplied to one input terminal of the selector 15. The fill address from the fill address generation unit 12 is supplied to the other input end of the selector 15. The selector 15 switches between the two addresses under the control of the control unit 16 and supplies it to the image memory 2 as a read address or a write address. The data processing unit 17 performs predetermined processing on the data read from the image memory 2 as needed. The control of each of these units is executed by the control unit 16.

【0011】次に、このように構成されたテクスチャマ
ッピング装置の動作について説明する。図2は、この装
置でテクスチャマッピング処理を実行する際の処理手順
を示すフローチャートである。テクスチャマッピング部
1のフィルアドレス生成部12は、CPU3からフィル
座標A,B,Cとテクスチャ座標TA,TP,TCとが
入力されたら、まず、フィル座標A,B,Cをy座標の
小さい順にソートし、それに対応させてテクスチャ座標
TA,TB,TCも並び替える。そして、y座標の小さ
い順から再度A,B,Cと名前を変更し、これに対応さ
せてTA,TB,TCも名前を変更する(S1)。ソー
ト後の各点の関係は、例えば図3(a),(b)に示す
ような関係になる。これらの各点の座標値は、次の各変
数xa,ya,xb,yb,…に格納される(S2)。
Next, the operation of the texture mapping device configured as described above will be described. FIG. 2 is a flowchart showing a processing procedure when the texture mapping processing is executed by this apparatus. When the fill coordinates A, B, C and the texture coordinates TA, TP, TC are input from the CPU 3, the fill address generation unit 12 of the texture mapping unit 1 first sets the fill coordinates A, B, C in ascending order of y coordinates. After sorting, the texture coordinates TA, TB, and TC are rearranged correspondingly. Then, the names are changed again from A, B, and C in the ascending order of the y-coordinates, and TA, TB, and TC are also changed correspondingly (S1). The relationship between the sorted points is as shown in FIGS. 3 (a) and 3 (b), for example. The coordinate values of these points are stored in the following variables xa, ya, xb, yb, ... (S2).

【0012】[0012]

【数1】 xa=A点のx座標 ya=A点のy座標 xb=B点のx座標 yb=B点のy座標 xc=C点のx座標 yc=C点のy座標 txa=TA点のx座標 tya=TA点のy座標 txb=TB点のx座標 tyb=TB点のy座標 txc=TC点のx座標 tyc=TC点のy座標Xa = x coordinate of A point ya = y coordinate of A point xb = x coordinate of B point yb = y coordinate of B point xc = x coordinate of C point yc = y coordinate of C point txa = TA point X-coordinate of tya = y-coordinate of TA point txb = x-coordinate of TB point tyb = y-coordinate of TB point txc = x-coordinate of TC point tyc = y-coordinate of TC point

【0013】続いて、yの初期値としてyaを格納し
(S3)、下記数2によりD点のx座標xd、E点のx
座標xe、TD点のx,y座標txd,tyd、及びT
E点のx,y座標txe,tyeをそれぞれ求める(S
4)。
Subsequently, ya is stored as the initial value of y (S3), and the x coordinate xd of the point D and the x coordinate of the point E are calculated by the following equation 2.
Coordinate xe, x, y coordinates txd, tyd of TD point, and T
The x and y coordinates txe and tie of point E are obtained (S
4).

【0014】[0014]

【数2】xd=xa+(xb−xa)*(y−ya)/
(yb−ya) xe=xa+(xc−xa)*(y−ya)/(yc−
ya) txd=txa+(txb−txa)*(y−ya)/
(yb−ya) txe=txa+(txc−txa)*(y−ya)/
(yc−ya) tyd=tya+(tyb−tya)*(y−ya)/
(yb−ya) tye=tya+(tyc−tya)*(y−ya)/
(yc−ya)
## EQU00002 ## xd = xa + (xb-xa) * (y-ya) /
(Yb-ya) xe = xa + (xc-xa) * (y-ya) / (yc-
ya) txd = txa + (txb-txa) * (y-ya) /
(Yb-ya) txe = txa + (txc-txa) * (y-ya) /
(Yc-ya) tyd = tya + (tyb-tya) * (y-ya) /
(Yb-ya) type = tya + (tyc-tya) * (y-ya) /
(Yc-ya)

【0015】次に、xの初期値としてxdを格納し(S
5)、テクスチャアドレス生成部13にx,y,xd,
xe,txd,txe,tyd,tyeを転送する。テ
クスチャアドレス生成部13は、下記数3により、TP
点のx,y座標tx,tyを算出する(S6)。
Next, xd is stored as the initial value of x (S
5), x, y, xd,
Transfer xe, txd, txe, tyd, and tie. The texture address generation unit 13 calculates the
The x, y coordinates tx, ty of the point are calculated (S6).

【0016】[0016]

【数3】tx=txd+(txe−txd)*(x−x
d)/(xe−xd) ty=tyd+(tye−tyd)*(x−xd)/
(xe−xd)
## EQU00003 ## tx = txd + (txe-txd) * (xx
d) / (xe-xd) ty = tyd + (tye-tyd) * (x-xd) /
(Xe-xd)

【0017】そして、セレクタ15によってテクスチャ
アドレス生成部13の出力を選択することにより、テク
スチャメモリ5のTP点のアドレス(tx,ty)のテ
クスチャデータを読み出し(S7)、続いてセレクタ1
5によってフィルアドレス生成部13の出力を選択する
ことにより、そのデータをフレームメモリ4のP点のア
ドレス(x,y)に格納する(S8)。このとき、格納
データに対してデータ処理部17でシェーディング処理
等を施したのちにデータを格納するようにしてもよい。
Then, the output of the texture address generator 13 is selected by the selector 15 to read the texture data at the address (tx, ty) of the TP point in the texture memory 5 (S7), and then the selector 1
By selecting the output of the fill address generation unit 13 by 5, the data is stored in the address (x, y) of the point P of the frame memory 4 (S8). At this time, the data processing unit 17 may perform shading processing or the like on the stored data before storing the data.

【0018】以上の処理を、xがxeに達するまでxを
1ずつインクリメントしながら繰り返し実行し(S9,
S10)、xがxeに達したら、yを+1して(S1
2)、次のD点及びE点を求め、同様の操作でP点及び
TP点のx,y座標を算出する。この操作は、yがyc
に達するまで続けられる(S11)。なお、yがybに
達したら、ステップS4のxd,txd,tydの算出
式については数2の代わりに下記数4を使用する。
The above processing is repeatedly executed while incrementing x by 1 until x reaches xe (S9,
(S10), when x reaches xe, y is incremented by 1 (S1
2) The next D point and E point are obtained, and the x and y coordinates of the P point and the TP point are calculated by the same operation. In this operation, y is yc
It continues until it reaches (S11). When y reaches yb, the following formula 4 is used instead of the formula 2 for the calculation formulas of xd, txd, and tyd in step S4.

【0019】[0019]

【数4】xd=xb+(xc−xb)*(y−yb)/
(yc−yb) txd=txb+(txc−txb)*(y−yb)/
(yc−yb) tyd=tyb+(tyc−tyb)*(y−yb)/
(yc−yb)
Xd = xb + (xc-xb) * (y-yb) /
(Yc-yb) txd = txb + (txc-txb) * (y-yb) /
(Yc-yb) tyd = tyb + (tyc-tyb) * (y-yb) /
(Yc-yb)

【0020】この操作によって、テクスチャメモリ5に
格納されたテクスチャデータがフィル座標で指定された
領域にマッピングされることになる。
By this operation, the texture data stored in the texture memory 5 is mapped to the area designated by the fill coordinates.

【0021】いま、図4に示すようなテクスチャデータ
がテクスチャメモリ5に格納されているとし、フィル座
標として図3(a)に示すようなやや扁平気味の三角形
の頂点A,B,Cの座標が指定され、テクスチャ座標と
して図4のTA,TB,TCが指定されたとすると、フ
ィル座標で指定された三角形にマッピングされるテクス
チャは、図5(a)のように、やや扁平気味に変形した
画像となる。同様に、テクスチャ座標として先の例に対
してやや回転した図4のTA′,TB′,TC′が指定
されたとすると、テクスチャは、図5(b)のように、
やや回転した画像となる。また、テクスチャ座標として
先の例よりも小さな図4のTA″,TB″,TC″が指
定されたとすると、テクスチャは図5(c)に示すよう
に、拡大された画像となる。このように、この装置によ
れば、テクスチャ座標をフィル座標に対して任意の値と
することにより、マッピングされるテクスチャを自由に
変形、回転、拡大、縮小することができる。
Now, assuming that the texture data as shown in FIG. 4 is stored in the texture memory 5, the coordinates of the vertices A, B and C of the slightly flattened triangle as shown in FIG. 3A as fill coordinates. When TA, TB, and TC of FIG. 4 are specified as the texture coordinates, the texture mapped to the triangle specified by the fill coordinates is deformed slightly flat as shown in FIG. 5A. It becomes an image. Similarly, if TA ′, TB ′, and TC ′ of FIG. 4 which are slightly rotated with respect to the previous example are designated as the texture coordinates, the texture becomes as shown in FIG. 5B.
The image will be slightly rotated. If TA ", TB", and TC "of Fig. 4 smaller than the previous example are designated as the texture coordinates, the texture becomes an enlarged image as shown in Fig. 5C. According to this apparatus, the texture to be mapped can be freely transformed, rotated, enlarged, or reduced by setting the texture coordinate to an arbitrary value with respect to the fill coordinate.

【0022】また、この装置によれば、例えば、図6
(b)に示すような立方体の各面を構成する6つの正方
形に対し、同図(a)のようなテクスチャデータを対応
させ、図7(a),(b),(c)のように回転させた
場合、立方体の各頂点の座標は各々CPU3で計算され
て入力されるが、テクスチャ座標は、立方体がどのよう
に回転しようと、最初に設定した値を入力すればよい。
このため、CPU3の計算の負荷を軽減することができ
る。
According to this device, for example, FIG.
As shown in FIGS. 7A, 7B and 7C, the texture data shown in FIG. 7A is made to correspond to the six squares forming each surface of the cube as shown in FIG. When rotated, the coordinates of each vertex of the cube are calculated and input by the CPU 3, but the texture coordinate may be the value initially set regardless of how the cube is rotated.
Therefore, the calculation load of the CPU 3 can be reduced.

【0023】ところで、上記の例のようにテクスチャデ
ータが繰り返しのパターンからなる場合、テクスチャメ
モリ5には、フィル座標系全体に対応する分のテクスチ
ャデータを格納するのは、経済的でない。そこで、この
装置では、図8に示すように、テクスチャデータを一部
のみ記憶すると共に、種々のテクスチャデータを記憶す
ることにより、テクスチャメモリ5の有効利用を図るよ
うにしている。図示の例では、各テクスチャアドレス範
囲とテクスチャデータとの関係は、下記表1の通りとな
る。
By the way, when the texture data is composed of repetitive patterns as in the above example, it is not economical to store the texture data corresponding to the entire fill coordinate system in the texture memory 5. Therefore, in this apparatus, as shown in FIG. 8, only a part of the texture data is stored, and various texture data are also stored so that the texture memory 5 can be effectively used. In the illustrated example, the relationship between each texture address range and texture data is as shown in Table 1 below.

【0024】[0024]

【表1】 [Table 1]

【0025】そこで、テクスチャアドレス生成部13で
生成されたテクスチャアドレスtx,tyの各上位4ビ
ットを、ゲート回路14によってテクスチャデータに対
応した固定値に置き換える。例えば“F”の繰り返しパ
ターンであれば、tx,tyの上位4ビットは、それぞ
れ0,0になる。これにより、図8に示すように、テク
スチャアドレスとして、“F”のテクスチャデータの記
憶範囲を超えるアドレスTA(1−−−,0−−−),
TB(0−−−,1−−−),TC(1−−−,1−−
−)が与えられても、各上位4ビットが“0”に置き換
えられるので、各アドレスがTA′(0−−−,0−−
−),TB′(0−−−,0−−−),TC′(0−−
−,0−−−)に置き換えられ、結果として図9(a)
に示すような、“F”の繰り返しパターンを全体的に割
り付けることができる。同様に、アドレスの各上位4ビ
ットをそれぞれ“1,0”に設定すれば、図8に示した
TA,TB,TCによって割り付けられるパターンは、
図9(b)のような、“T”の繰り返しパターンとな
る。
Therefore, the upper 4 bits of each of the texture addresses tx and ty generated by the texture address generation unit 13 are replaced by the gate circuit 14 with a fixed value corresponding to the texture data. For example, in the case of a repeating pattern of "F", the upper 4 bits of tx and ty are 0 and 0, respectively. As a result, as shown in FIG. 8, as the texture address, the address TA (1 −−−, 0 −−−), which exceeds the storage range of the texture data of “F”,
TB (0 ---, 1 ---), TC (1 ---, 1 ---
Even if −) is given, each upper 4 bits are replaced with “0”, so that each address is TA ′ (0 −−−, 0 −−−).
-), TB '(0 ---, 0 ---), TC' (0 ---
-, 0 ---)), resulting in FIG.
It is possible to assign a repeating pattern of "F" as shown in FIG. Similarly, if the upper 4 bits of the address are respectively set to "1, 0", the pattern assigned by TA, TB, TC shown in FIG.
The repetitive pattern of “T” is as shown in FIG.

【0026】このようなゲート回路14は、例えば図1
0のように構成することができる。マスク回路21は、
テクスチャアドレス生成部13からの出力の上位ビット
を“0”に置き換えることによりマスクする。いま、テ
クスチャ座標が11ビットの場合、各x,y座標につい
てテクスチャデータのパターンサイズとマスク回路24
の出力との関係は、下記表2の通りとなる。なお、ここ
で上欄の数字はマスク回路21の出力ビット番号で、
“0”の部分がマスクされるビット、bxがアドレスのx
ビット目をそのまま通過させることを意味している。マ
スク回路21の出力のビット“0”の部分をORゲート
22によってテクスチャパターン番号に置き換えれば、
サイズ8×8のテクスチャデータを28 =256通り選
択することが可能になる。
Such a gate circuit 14 is shown in FIG.
It can be configured as 0. The mask circuit 21 is
Masking is performed by replacing the upper bits of the output from the texture address generation unit 13 with "0". If the texture coordinates are 11 bits, the pattern size of the texture data and the mask circuit 24 for each x and y coordinate.
The relationship with the output of is as shown in Table 2 below. Here, the numbers in the upper column are output bit numbers of the mask circuit 21,
"0" part is the masked bit, bx is the address x
This means passing the bit as it is. If the bit “0” portion of the output of the mask circuit 21 is replaced with the texture pattern number by the OR gate 22,
It is possible to select 2 8 = 256 types of texture data of size 8 × 8.

【0027】[0027]

【表2】 [Table 2]

【0028】また、例えば図10のORゲート22の代
わりに、図11のように、加算器23を使用することに
より、指定の値だけテクスチャアドレスをオフセットさ
せることができるので、複数あるテクスチャデータの領
域の大きさが異なっても所望のテクスチャマッピングが
可能である。
Further, for example, instead of the OR gate 22 of FIG. 10, by using the adder 23 as shown in FIG. 11, it is possible to offset the texture address by a designated value. Desired texture mapping is possible even if the sizes of the regions are different.

【0029】このように、繰り返し図形をテクスチャデ
ータとする場合において、極端な場合繰り返しの最小単
位のみをテクスチャデータとして記憶しておけば、任意
の座標でテクスチャ座標を指定してテクスチャマッピン
グを行うことができ、メモリの容量を節約することがで
きると共に、テクスチャ座標の指定が簡単になる。
As described above, in the case of using a repeating figure as texture data, in extreme cases, if only the minimum repeating unit is stored as texture data, texture coordinates can be specified at arbitrary coordinates for texture mapping. The memory capacity can be saved and the texture coordinates can be easily specified.

【0030】なお、以上の実施例では、マッピングする
範囲を三角形として説明したが、四角形等、他の多角形
に対してマッピングを施しても良いことはいうまでもな
い。
In the above embodiments, the range of mapping is described as a triangle, but it goes without saying that other polygons such as a quadrangle may be mapped.

【0031】[0031]

【発明の効果】以上述べたように、この発明によれば、
フィル座標に対するテクスチャ座標の与え方によって、
テクスチャデータを任意に拡大、縮小、回転及び変形さ
せて割り付けることができるので、多様な態様のマッピ
ングを行うことができると共に、テクスチャ記憶手段に
は、標準的なパターンのみを記憶しておけばよいので、
メモリ容量も削減することができる。
As described above, according to the present invention,
Depending on how to give texture coordinates to fill coordinates,
Since the texture data can be arbitrarily enlarged, reduced, rotated, and deformed and allocated, various modes of mapping can be performed, and only the standard pattern need be stored in the texture storage means. So
The memory capacity can also be reduced.

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

【図1】 この発明の実施例に係るテクスチャマッピン
グ装置のブロック図ある。
FIG. 1 is a block diagram of a texture mapping device according to an embodiment of the present invention.

【図2】 同装置によるマッピング処理の手順を示すフ
ローチャートである。
FIG. 2 is a flowchart showing a procedure of mapping processing by the apparatus.

【図3】 同装置に与えられるフィル座標とテクスチャ
座標の一例を示す図である。
FIG. 3 is a diagram showing an example of fill coordinates and texture coordinates given to the apparatus.

【図4】 同装置におけるテクスチャメモリとテクスチ
ャ座標との関係を示す図である。
FIG. 4 is a diagram showing a relationship between a texture memory and texture coordinates in the same device.

【図5】 図4の各テクスチャ座標に対応するマッピン
グ結果を示す図ある。
5 is a diagram showing a mapping result corresponding to each texture coordinate in FIG. 4;

【図6】 立方体とこれにマッピングされるテクスチャ
パターンの一例を示す図である。
FIG. 6 is a diagram showing an example of a cube and a texture pattern mapped to the cube.

【図7】 同立方体が回転した場合のパターンの変化を
示す図である。
FIG. 7 is a diagram showing a change in pattern when the cube is rotated.

【図8】 テクスチャメモリの有効利用方法の一例を示
す図である。
FIG. 8 is a diagram showing an example of an effective use method of a texture memory.

【図9】 同メモリを使用したマッピング例を示す図で
ある。
FIG. 9 is a diagram showing an example of mapping using the same memory.

【図10】 ゲート回路の具体例を示す図である。FIG. 10 is a diagram showing a specific example of a gate circuit.

【図11】 ゲート回路の他の例を示す図である。FIG. 11 is a diagram showing another example of the gate circuit.

【図12】 テクスチャマッピングを説明するための図
である。
FIG. 12 is a diagram for explaining texture mapping.

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

1…テクスチャマッピング部、2…画像メモリ、3…C
PU、4…フレームメモリ、5…テクスチャメモリ、1
1…CPUインタフェース、12…フィルアドレス生成
部、13…テクスチャアドレス生成部、14…ゲート回
路、15…セレクタ、16…制御部、17…データ処理
部。
1 ... Texture mapping unit, 2 ... Image memory, 3 ... C
PU, 4 ... Frame memory, 5 ... Texture memory, 1
DESCRIPTION OF SYMBOLS 1 ... CPU interface, 12 ... Fill address generation part, 13 ... Texture address generation part, 14 ... Gate circuit, 15 ... Selector, 16 ... Control part, 17 ... Data processing part.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 3次元対象物の2次元表示データを表示
画面を記憶するフレーム記憶手段と、 前記3次元対象物の表面にマッピングされるテクスチャ
データを記憶するテクスチャ記憶手段と、 テクスチャマッピングすべき範囲を規定したフィル座標
及びテクスチャ座標を入力し、前記フィル座標により規
定される範囲の内部の各画素のフィルアドレスを順次生
成すると共に、生成されたフィルアドレスに対応するテ
クスチャアドレスを生成し、この生成されたテクスチャ
アドレスで指定される前記テクスチャ記憶手段の記憶場
所からテクスチャデータを読み出して、前記フィルアド
レスで指定される前記フレーム記憶手段の記憶場所に格
納するマッピング手段とを有することを特徴とするテク
スチャマッピング装置。
1. A frame storage means for storing a two-dimensional display data of a three-dimensional object on a display screen, a texture storage means for storing texture data to be mapped on the surface of the three-dimensional object, and texture mapping. By inputting fill coordinates and texture coordinates defining a range, a fill address of each pixel inside the range defined by the fill coordinates is sequentially generated, and a texture address corresponding to the generated fill address is generated. Mapping means for reading texture data from the storage location of the texture storage means specified by the generated texture address and storing it in the storage location of the frame storage means specified by the fill address. Texture mapping device.
JP27044794A 1994-10-07 1994-10-07 Texture mapping device Pending JPH08110951A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP27044794A JPH08110951A (en) 1994-10-07 1994-10-07 Texture mapping device
TW084106984A TW278162B (en) 1994-10-07 1995-07-06
US08/541,670 US5764237A (en) 1994-10-07 1995-10-10 Texture mapping apparatus computing texture address by fill address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27044794A JPH08110951A (en) 1994-10-07 1994-10-07 Texture mapping device

Publications (1)

Publication Number Publication Date
JPH08110951A true JPH08110951A (en) 1996-04-30

Family

ID=17486418

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27044794A Pending JPH08110951A (en) 1994-10-07 1994-10-07 Texture mapping device

Country Status (1)

Country Link
JP (1) JPH08110951A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6067089A (en) * 1996-07-11 2000-05-23 Yamaha Corporation Texture mapping device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03138779A (en) * 1989-10-25 1991-06-13 Daikin Ind Ltd Method and device for texture mapping

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03138779A (en) * 1989-10-25 1991-06-13 Daikin Ind Ltd Method and device for texture mapping

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6067089A (en) * 1996-07-11 2000-05-23 Yamaha Corporation Texture mapping device

Similar Documents

Publication Publication Date Title
US5764237A (en) Texture mapping apparatus computing texture address by fill address
EP1847965A1 (en) Plotting device and plotting method
US5745739A (en) Virtual coordinate to linear physical memory address converter for computer graphics system
US8805119B2 (en) Image rendering device, image rendering method, and recording medium
JPH09161100A (en) Method and apparatus for display
JPWO2007043293A1 (en) Image generation device, texture mapping device, image processing device, and texture storage method
JPH09330423A (en) Three-dimensional shape data transforming device
TW389857B (en) Image drawing apparatus
US6476819B1 (en) Apparatus and method for assigning shrinkage factor during texture mapping operations
JPH0660173A (en) Method and apparatus for reducing picture
US5357601A (en) Apparatus for processing superimposed image information by designating sizes of superimposed and superimposing images
JP3756888B2 (en) Graphics processor, graphics card and graphics processing system
JPH01131976A (en) Device and method for texture mapping
JPH08110952A (en) Texture mapping device
JP2003233836A (en) Image processor for conducting rendering shading processing by using distance component in modeling and its method
JPH08110951A (en) Texture mapping device
JP3903557B2 (en) Data conversion apparatus and image generation apparatus
JP2003051029A (en) Device and method for generating animation data, and device and method for generating animation video
JPH0816822A (en) Three-dimensional moving picture generation method
US5936635A (en) System and method of rendering polygons into a pixel grid
JP3468985B2 (en) Graphic drawing apparatus and graphic drawing method
JP7118315B1 (en) drawing device
JP3335824B2 (en) Mapping equipment used in cathode ray tube controllers for special screen effects.
JP3014395B2 (en) 3D image display system
JP2004240910A (en) Image processor and image processing method