JP2000030081A - Drawing method of three-dimensional drawing apparatus - Google Patents
Drawing method of three-dimensional drawing apparatusInfo
- Publication number
- JP2000030081A JP2000030081A JP19881498A JP19881498A JP2000030081A JP 2000030081 A JP2000030081 A JP 2000030081A JP 19881498 A JP19881498 A JP 19881498A JP 19881498 A JP19881498 A JP 19881498A JP 2000030081 A JP2000030081 A JP 2000030081A
- Authority
- JP
- Japan
- Prior art keywords
- triangle
- texture
- pixel
- line
- pixels
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 238000006073 displacement reaction Methods 0.000 claims abstract description 32
- 238000013507 mapping Methods 0.000 claims description 7
- 238000009877 rendering Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 10
- 238000006243 chemical reaction Methods 0.000 description 4
- 230000002093 peripheral effect Effects 0.000 description 4
- 230000008030 elimination Effects 0.000 description 2
- 238000003379 elimination reaction Methods 0.000 description 2
- XBDRAUPLGHAFCU-UHFFFAOYSA-N 3-[6-amino-5-(6-ethoxynaphthalen-2-yl)pyridin-3-yl]-n-[2-(dimethylamino)ethyl]benzamide Chemical compound C1=CC2=CC(OCC)=CC=C2C=C1C(C(=NC=1)N)=CC=1C1=CC=CC(C(=O)NCCN(C)C)=C1 XBDRAUPLGHAFCU-UHFFFAOYSA-N 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000011435 rock Substances 0.000 description 1
Landscapes
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Abstract
(57)【要約】
【課題】凹凸ポリゴンを描画する際に、単一ポリゴン
(三角形)をさらに細分することなく高速に描画する。
【解決手段】CPU100で、テクスチャメモリ(T
M)300にテクスチャ画像、テクスチャ高さを設定
し、複数のポリゴンで表された物体を三角形に分割し、
三角形の描画指令を発行する。RP200は、三角形毎
に、その法線方向を投影した線分を基に、三角内の描画
ラインの分割を行ない、描画ライン上の画素を順次、対
応するテクスチャ高さ情報により変位し、変位前の隣接
画素のテクスチャの画像データを変位後の画素位置の間
に補間して描画する。この変位による補間画素群が三角
形の周辺部を含めて凹凸を表す。この描画処理を三角形
の全ライン、さらには物体を構成する全ての三角形につ
いて繰り返す。
(57) [Summary] To draw a concave / convex polygon, a single polygon (triangle) is drawn at high speed without further subdivision. A CPU has a texture memory (T).
M) Set a texture image and a texture height in 300, divide an object represented by a plurality of polygons into triangles,
Issue a triangle drawing command. The RP 200 divides the drawing line in the triangle based on the line segment projected in the normal direction for each triangle, and sequentially displaces the pixels on the drawing line according to the corresponding texture height information. Is drawn by interpolating the image data of the texture of the adjacent pixel between the pixel positions after the displacement. The group of interpolated pixels due to this displacement represents irregularities including the periphery of the triangle. This drawing process is repeated for all the lines of the triangle and for all the triangles constituting the object.
Description
【0001】[0001]
【発明の属する技術分野】本発明はポリゴンモデルによ
る三次元描画装置に関し、特にテクスチャマッピングに
よる凹凸ポリゴンの描画方式に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a three-dimensional drawing apparatus based on a polygon model, and more particularly to a method for drawing irregular polygons using texture mapping.
【0002】[0002]
【従来の技術】三次元グラフィックスで扱われる三次元
物体は、三次元のポリゴン(最小単位が三角形)に分割
された多面体として表現され、二次元(平面)スクリー
ン上に投影して表示される。ポリゴンの描画には、その
輪郭線及び走査線との交点を求め、ラインプロセッサで
交点範囲を塗り潰す演算処理が行なわれる。単一のポリ
ゴン上のドットは同一色の単調な形状となる。このた
め、凹凸などの複雑な表面を持つ物体を表示しようとす
ると、ポリゴンの分割数が大幅に増加して処理に時間が
かるので、大規模な演算処理装置が必要になる。2. Description of the Related Art A three-dimensional object handled by three-dimensional graphics is represented as a polyhedron divided into three-dimensional polygons (the smallest unit is a triangle), and projected and displayed on a two-dimensional (flat) screen. . To draw a polygon, an intersection point between the contour line and the scanning line is obtained, and a line processor performs an arithmetic process for filling the intersection area. Dots on a single polygon have a monotonous shape of the same color. For this reason, when an object having a complicated surface such as unevenness is to be displayed, the number of polygon divisions is greatly increased and the processing takes time, so that a large-scale arithmetic processing device is required.
【0003】一方、コンピュータグラフィックスの分野
ではテクスチャマッピングの手法が知られている。すな
わち、三次元物体の画像情報を、多面体の画像情報とテ
クスチャ情報に分離して用意し、多面体にテクスチャ情
報を貼り付けることによって描画を行なう。On the other hand, a technique of texture mapping is known in the field of computer graphics. That is, image information of a three-dimensional object is separately prepared into image information and texture information of a polyhedron, and drawing is performed by pasting the texture information on the polyhedron.
【0004】従来のテクスチャマッピングは、例えば
「最新三次元コンピュータグラフイックス(A.S.GLASSN
ER著、白田耕作監訳、アスキー出版局,137−147頁)」
に詳しい。ここには、手書きまたはデジタイズした画像
をテクスチャとし、格子状に配置したデータを準備し、
多角形の各頂点とテクスチャの座標との対応付けを行な
い、コンピュータが多角形を描画する各座標の色を決定
するときに、テクスチャを参照して決定する、基本的な
マッピング手法が説明されている。[0004] Conventional texture mapping is described in, for example, "The Latest Three-Dimensional Computer Graphics (ASGLASSN)".
ER, edited by Kosaku Shirada, ASCII Publishing Bureau, pp. 137-147) "
Familiar with. Here, a handwritten or digitized image is used as a texture, and data arranged in a grid is prepared.
A basic mapping method has been described in which each vertex of a polygon is associated with texture coordinates, and when the computer determines the color of each coordinate at which to draw the polygon, the color is determined with reference to the texture. I have.
【0005】また、滑らかな球面のある特定の場所に陰
影をつける場合に、各点において計算した面の法線ベク
トルを特定の方向に少しずらして陰影付けの処理を行な
う、バンプマッピングと呼ばれるテクスチャの説明があ
る。各点における法線ベクトルの調整は、その点におけ
るテクスチャの値で決定する。つまり、面上のある点の
法線ベクトルが光源の方向を向いているほど、その点が
より明るくなるように、より白いピクセルで描画する。In addition, when shading is to be applied to a specific place on a smooth spherical surface, a texture called a bump mapping, which performs shading by slightly shifting the normal vector of the surface calculated at each point in a specific direction. There is an explanation. The adjustment of the normal vector at each point is determined by the value of the texture at that point. In other words, the pixel is drawn with whiter pixels so that the more the normal vector of a point on the surface faces the direction of the light source, the brighter the point becomes.
【0006】[0006]
【発明が解決しようとする課題】上記したテクスチャ手
法による凹凸ポリゴンの描画は、基本的にはマッピング
するテクスチャの高さ情報により、描画する単一のポリ
ンゴンを細かい複数のポリゴンに分割する必要があるの
で、座標変換などの処理数が増大して高速の描画ができ
ない。また、用意されたテクスチャが岩の表面のような
粗い質感、あるいはレンガのような溝をもつ画像などの
場合に、描画後のポリゴンを近くや斜めからみると、滑
らかな表面に絵が描かれているとしか見えず、リアル感
が乏しい。In the drawing of an uneven polygon by the above-described texture method, it is basically necessary to divide a single polygon to be drawn into a plurality of fine polygons based on height information of a texture to be mapped. Therefore, the number of processes such as coordinate conversion increases, and high-speed drawing cannot be performed. Also, if the prepared texture is an image with a rough texture like a rock surface or a brick-like groove, the picture will be drawn on a smooth surface if the polygon after drawing is viewed from near or diagonally. I can only see it and it lacks realism.
【0007】また、上記のバンプマッピングの方式で
は、面の形を変えずに陰影を変化させているだけなので
処理数の上では有利になる。しかし、大きなモデルに適
用すると、テクスチャを貼り付けてもシルエットは変わ
らない。例えば、球面に凹凸のテクスチャを貼り付けて
も、その輪郭は常に円形となり、リアル感に乏しい。Further, in the above-described bump mapping method, since the shadow is merely changed without changing the shape of the surface, it is advantageous in terms of the number of processes. However, when applied to large models, pasting the texture does not change the silhouette. For example, even when a texture having irregularities is pasted on a spherical surface, the contour is always circular, and the real feeling is poor.
【0008】本発明の目的は、上記した従来技術の問題
点を克服し、単一のポリゴンを細かい複数のポリゴンに
分割することなく高速に描画できるテクスチャ方式によ
り、リアル感のある凹凸ポリゴンを描画する方法と装置
を提供することにある。SUMMARY OF THE INVENTION It is an object of the present invention to overcome the above-mentioned problems of the prior art and to render a realistic uneven polygon by a texture method capable of drawing at high speed without dividing a single polygon into a plurality of fine polygons. It is an object of the present invention to provide a method and an apparatus.
【0009】[0009]
【課題を解決するための手段】上記目的を達成する本発
明は、三次元の物体を複数の三角形に分割したポリゴン
モデルを用い、前記三角形を順次、フレームメモリに画
素展開して前記物体の描画を行なうときに、前記三角形
の表面に凹凸を表現するテクスチャをマッピングする凹
凸ポリゴンの描画方法において、前記三角形毎にその法
線ベクトルから二次元の表示座標系への投影ベクトルを
求め、該ベクトルに平行な複数の線分(以下、描画ライ
ン)で前記三角形をライン分割し、前記描画ライン上の
画素の始点から順に対応する前記テクスチャの画像デー
タを取り込み、前記画素に対し前記テクスチャの高さ情
報に応じた変位を求め、同様に求めた隣接画素の変位と
の間を補間した画素をフレームメモリに描画し、これを
三角形内の全描画ライン、さらに前記物体を表す全三角
形について繰り返し、上記の補間画素によって前記凹凸
を表現することを特徴とする。ここで、前記変位した位
置間の画素の補間は、変位前の画素とその隣接画素の各
テクスチャの色データの輝度から補間する。In order to achieve the above object, the present invention uses a polygon model obtained by dividing a three-dimensional object into a plurality of triangles, and renders the triangles in a frame memory in order by drawing pixels in a frame memory. When performing a method of drawing a textured polygon that maps a texture expressing irregularities on the surface of the triangle, a projection vector to a two-dimensional display coordinate system is obtained from a normal vector for each triangle, and the vector The triangle is divided into a plurality of lines by a plurality of parallel line segments (hereinafter referred to as drawing lines), and image data of the texture corresponding to the starting points of the pixels on the drawing line are taken in order. Is calculated in accordance with the above, and the pixel obtained by interpolating the displacement between the similarly obtained adjacent pixel is drawn in the frame memory, and this is drawn all over the triangle. In repeated for all the triangles showing still the object, characterized by representing said irregularities by the interpolation pixel. Here, the interpolation of the pixels between the displaced positions is performed based on the luminance of the color data of each texture of the pixel before the displacement and the adjacent pixel.
【0010】本発明によれば、従来のように三角形を細
分することなくその表面に凹凸をマッピングできるので
処理を高速化できる。かつ、凹凸を表現する補間画素は
高さ情報に応じて変位し、例えば三角形の周辺を出入り
する変位の位置に描画されるので、リアル感のある凹凸
を与えることができる。According to the present invention, unevenness can be mapped on the surface of a triangle without subdividing it as in the prior art, so that the processing can be speeded up. In addition, the interpolated pixels representing the irregularities are displaced according to the height information, and are drawn, for example, at the positions of the displacements entering and exiting the periphery of the triangle, so that realistic irregularities can be given.
【0011】また、前記描画ライン上の画素位置の始点
は、前記表示座標系の走査ラインが最初に交わる前記三
角形の一辺との交点であり、かつ、前記描画ラインは前
記走査ライン毎に+1ずつインクリメントすることを特
徴とする。これにより、走査ラインに対して傾きを持つ
描画ラインのインクリメントが走査ラインの正数増分に
従うので、実数演算の累積誤差によって描画抜けを生じ
ることがない。The starting point of the pixel position on the drawing line is an intersection with one side of the triangle where the scanning line of the display coordinate system first intersects, and the drawing line is incremented by +1 for each scanning line. It is characterized by incrementing. Thus, the increment of the drawing line having an inclination with respect to the scanning line follows the positive number increment of the scanning line, so that the drawing error does not occur due to the accumulated error of the real number operation.
【0012】さらに、変位前の画素の奥行値とその変位
に対応する前記フレームメモリの画素の奥行値を比較
し、前者が手前となる場合に前記補間画素を前記フレー
ムメモリに描画することを特徴とする。これにより、変
位により既に展開されている画素との間での陰面消去処
理が可能になる。Further, the depth value of the pixel before the displacement is compared with the depth value of the pixel in the frame memory corresponding to the displacement, and when the former is closer, the interpolated pixel is drawn in the frame memory. And As a result, hidden surface elimination processing can be performed between pixels that have already been developed due to displacement.
【0013】さらに、上記した本発明の方法を実現する
三次元描画装置は、前記テクスチャの高さ情報を取り込
んで変位を求めるときに、倍率係数を可変するための設
定手段を具備しているので、表示された凹凸ポリゴンを
観察しながらその高さ情報を変えてリアルな表現を実現
することができる。Further, the three-dimensional drawing apparatus for realizing the above-described method of the present invention includes setting means for changing the magnification factor when obtaining the height information of the texture and calculating the displacement. It is possible to realize a realistic expression by changing the height information while observing the displayed uneven polygon.
【0014】[0014]
【発明の実施の形態】以下、本発明の実施形態について
図面を参照しながら詳細に説明する。図1は、本発明を
実現する三次元描画装置の一実施例を示す。描画装置は
座標計算を行い、表示座標系における三角形の頂点情報
や法線情報を算出するCPU100、三角形単位に画素
展開を行う描画プロセッサ(RP)200、テクスチャ
の画像データを格子状の画素毎に記憶するテクスチャメ
モリ(TM)300、テクスチャを貼り付けた(合成し
た)対象物体の描画画素を記憶するフレームメモリ(F
M)400、FM400の描画画素を表示するCRT5
00、図示を省略した入力装置などのハード構成からな
る。Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 shows an embodiment of a three-dimensional drawing apparatus for realizing the present invention. The drawing apparatus calculates coordinates, calculates the vertex information and the normal line information of the triangle in the display coordinate system, the CPU 100 that performs pixel development in units of triangles, and the texture image data for each grid-like pixel. A texture memory (TM) 300 for storing, and a frame memory (F) for storing drawing pixels of a target object on which a texture is pasted (synthesized).
M) 400, CRT5 displaying the drawing pixels of FM400
00, a hardware configuration such as an input device not shown.
【0015】CPU100は、入出力処理を含む描画装
置全体の制御を行なうとともに、物体を表すポリゴン
(多面体)から、その頂点座標を基に単一のポリゴン
(本実施例では三角形)に分割する三角形分割部11
0、三角形単位に描画ライン(以下では、nkライン)
と3頂点座標及び各頂点に対応するテクスチャの座標を
表示座標系に変換して発行する描画指令発行部120、
手書きやデジタイザ等によるテクスチャの各画素の座標
と色情報を取り込み、TM300に格納するテクスチャ
画像設定部130、テクスチャ画像の各画素の高さ情報
を基本設定するテクスチャ高さ情報設定部140及びテ
クスチャ高さ情報の倍率を可変する倍率設定部150を
有している。The CPU 100 controls the entire drawing apparatus, including input / output processing, and divides a polygon (polyhedron) representing an object into a single polygon (triangle in this embodiment) based on the coordinates of its vertices. Division 11
0, drawing line in triangular units (hereafter, nk line)
And a rendering command issuing unit 120 that converts the coordinates of the three vertices and the coordinates of the texture corresponding to each vertex into a display coordinate system and issues them.
The texture image setting unit 130 that captures the coordinates and color information of each pixel of the texture by handwriting or digitizer and stores it in the TM 300, the texture height information setting unit 140 that basically sets the height information of each pixel of the texture image, and the texture height It has a magnification setting unit 150 that varies the magnification of the information.
【0016】RP200は、単一ポリゴンを表す三角形
を、傾きをもつ線分(以下傾きをもった線分をラインと
呼ぶ)に展開するライン分割部210、ラインを画素に
展開する変位量算出部220および補間付ライン描画部
230を有している。The RP 200 is a line dividing unit 210 for developing a triangle representing a single polygon into a line segment having an inclination (hereinafter, a line segment having an inclination is referred to as a line), and a displacement amount calculating unit for expanding a line into pixels. 220 and a line drawing unit 230 with interpolation.
【0017】次に、本実施例による三次元描画装置の動
作を説明する。図2に、描画手順の概略フローを示す。
はじめに、CPU100からTM300へ、テクスチャ
画像と、テクスチャ画像の各画素に対応する高さ情報を
設定する(s101,s102)。高さ情報は、テクス
チャ画像中の黒を基底とし、白くなるほど高い値となる
ように作成される。Next, the operation of the three-dimensional drawing apparatus according to this embodiment will be described. FIG. 2 shows a schematic flow of the drawing procedure.
First, a texture image and height information corresponding to each pixel of the texture image are set from the CPU 100 to the TM 300 (s101, s102). The height information is created such that the higher the whiteness, the higher the value based on black in the texture image.
【0018】次に、物体の形状をその頂点座標を基に複
数の三角形へ分割する(s103)。そして、三角形毎
に3次元の法線Nを求め、頂点座標などとともに表示座
標系の座標値に変換する(s104)。法線Nは1つの
三角形に対して一律である。Next, the shape of the object is divided into a plurality of triangles based on the vertex coordinates (s103). Then, a three-dimensional normal N is obtained for each triangle, and is converted into coordinate values of the display coordinate system together with vertex coordinates (s104). The normal line N is uniform for one triangle.
【0019】変換後の各値は法線Nベクトル(成分:n
x,ny)、3頂点の座標値(x1,y1)、(x2,
y2)、(x3,y3)、3頂点の奥行き値w1,w
2,w3、及び三角形の各頂点に対応したテクスチャの
座標値(u1,v1)、(u2,v2)、(u3,v
3)となる。Each value after conversion is a normal N vector (component: n
x, ny), coordinate values of three vertices (x1, y1), (x2, ny)
y2), (x3, y3), depth values w1, w of three vertices
2, w3, and the coordinate values (u1, v1), (u2, v2), (u3, v) of the texture corresponding to each vertex of the triangle.
3).
【0020】法線Nベクトル(成分:nx,ny)は三
次元物体上の各三角形の法線を投影した表示座標系上の
投影ベクトルである。また、奥行きwは視点から投影面
までの距離を正規化したとき、投影面から頂点までの相
対距離である。CPU100はこれらの情報を算出して
RP200へ渡す。The normal N vector (component: nx, ny) is a projection vector on the display coordinate system that projects the normal of each triangle on the three-dimensional object. The depth w is the relative distance from the projection plane to the vertex when the distance from the viewpoint to the projection plane is normalized. The CPU 100 calculates these pieces of information and passes them to the RP 200.
【0021】図3に、表示座標系における長軸(l)、
短軸(s)と三角形のx値、y値の関係を示す。本実施
例では、後述するnkラインの演算処理を容易にするた
めに、表示座標系の長軸をl,短軸をsとし、法線Nベ
クトルのnxとnyの値の大小比較に応じて、x軸とy
軸の置換を行なっている。なお、3次元から変換された
直後の表示座標系(x,y)の座標値をx値、y値で表
し、置換後の表示座標系(l,s)の座標値をl値、s
値で表すものとする。FIG. 3 shows a major axis (l) in the display coordinate system,
The relationship between the short axis (s) and the x and y values of the triangle is shown. In this embodiment, in order to facilitate the calculation processing of the nk line, which will be described later, the major axis of the display coordinate system is 1 and the minor axis is s, and the nx and ny values of the normal N vector are compared according to the magnitude comparison. , X-axis and y
The axis is being replaced. Note that the coordinate values of the display coordinate system (x, y) immediately after the three-dimensional conversion are represented by x and y values, and the coordinate values of the display coordinate system (l, s) after replacement are represented by l values and s.
It shall be represented by a value.
【0022】(a)のように長軸がx軸(nx≧ny)
の場合は、x軸をl軸、y軸をs軸と定義し、(b)の
ように長軸がy軸(nx<ny)の場合は、y軸をl
軸、x軸をs軸と定義する。従って、法線N(nx,n
y)及び三角形の3頂点の座標値は、表示座標系(l,
s)に対し数1のように置換される。(1)〜(4)は
長軸がx軸の場合、(5)〜(8)は長軸がy軸の場合
を示す。As shown in (a), the major axis is the x-axis (nx ≧ ny)
In the case of, the x-axis is defined as the l-axis and the y-axis is defined as the s-axis. When the major axis is the y-axis (nx <ny) as in (b), the y-axis is defined as l-axis.
The axis and the x axis are defined as the s axis. Therefore, the normal N (nx, n
y) and the coordinate values of the three vertices of the triangle are expressed in the display coordinate system (l,
s) is replaced by Equation 1. (1) to (4) show the case where the major axis is the x-axis, and (5) to (8) show the case where the major axis is the y-axis.
【0023】[0023]
【数1】 (nx,ny)⇒(nl,ns) …(1) (x1,y1)⇒(l1,s1) …(2) (x2,y2)⇒(l2,s2) …(3) (x3,y3)⇒(l3,s3) …(4) (nx,ny)⇒(ns,nl) …(5) (x1,y1)⇒(s1,l1) …(6) (x2,y2)⇒(s2,l2) …(7) (x3,y3)⇒(s3,l3) …(8) l軸の変化量n1に対するs軸の変化量nsの比を傾き
nkとすると、傾きnkは数2から求まる。この傾きn
kのラインをnkラインと呼ぶ。nkラインは、三次元
物体上での三角形の法線Nから表示座標系(l,s)へ
の投影ベクトルと平行な線分となる。nkラインは以下
のように分割され、三角形の描画ラインとなる。(Nx, ny) ⇒ (nl, ns) (1) (x1, y1) ⇒ (11, s1) (2) (x2, y2) ⇒ (12, s2) (3) ( (x3, y3) ⇒ (13, s3) (4) (nx, ny) ⇒ (ns, nl) (5) (x1, y1) ⇒ (s1, l1) (6) (x2, y2) ⇒ (S2, l2) (7) (x3, y3) ⇒ (s3, 13) (8) Assuming that the ratio of the change amount ns of the s-axis to the change amount n1 of the l-axis is the slope nk, the slope nk becomes From. This slope n
The k line is called an nk line. The nk line is a line segment parallel to a projection vector from the normal line N of the triangle on the three-dimensional object to the display coordinate system (l, s). The nk line is divided as follows and becomes a triangular drawing line.
【0024】[0024]
【数2】 nk=ns/nl (0≦nk≦1) …(9) そこで、三角形を傾きnkのラインに分割し(s10
5)、1ラインずつ描画することで三角形の描画を可能
にする。数1の置換により、数2のns/nlの値は常
に1以下となるので、割算処理が容易になる。Nk = ns / nl (0 ≦ nk ≦ 1) (9) Then, the triangle is divided into lines having a slope of nk (s10
5) By drawing one line at a time, a triangle can be drawn. Since the value of ns / nl in Expression 2 is always equal to or less than 1 by the replacement of Expression 1, the division process is facilitated.
【0025】図4、図5に、三角形のライン分割処理の
フローを示す。まず、表示座標系における法線Nのベク
トル成分(nx,ny)の長軸を判定する(s20
1)。判定の結果(s202)、長軸がx軸の場合はx
軸をl軸、y軸をs軸として、法線ベクトル及び三角形
の3頂点の対応設定を、式(1)〜(4)により行なう
(s203)。長軸がy軸の場合は、y軸をl軸、x軸
をs軸として、式(5)〜(8)により対応設定を行な
う(s204)。FIGS. 4 and 5 show the flow of the triangular line division processing. First, the major axis of the vector component (nx, ny) of the normal N in the display coordinate system is determined (s20).
1). As a result of the determination (s202), if the major axis is the x-axis, x
With the axis as the l-axis and the y-axis as the s-axis, the correspondence between the normal vector and the three vertices of the triangle is set by the equations (1) to (4) (s203). When the long axis is the y axis, the y axis is set as the l axis and the x axis is set as the s axis, and the corresponding setting is performed by the equations (5) to (8) (s204).
【0026】次に、ベクトル(nl,ns)の傾きnk
を式(9)より算出する(s205)。また、三角形の
各頂点について、傾きnkの直線式、つまり定数項nc
を、数3により求める(s206)。Next, the gradient nk of the vector (nl, ns)
Is calculated from Expression (9) (s205). Also, for each vertex of the triangle, a straight line equation of the slope nk, that is, a constant term nc
Is obtained by Expression 3 (s206).
【0027】[0027]
【数3】 nc=s−nk・l (s:s1〜s3,l:l1〜l3) …(10) 次に、各頂点の定数項nc(ac,bc,cc)を比較
し、最小となる頂点を頂点A、最大となる頂点を頂点
C、その他を頂点Bとする(s207)。そして、頂点
A,B,C間の各辺を数4により定義する(s20
8)。Nc = s−nk · l (s: s1 to s3, l: 11 to 13) (10) Next, the constant terms nc (ac, bc, cc) of each vertex are compared, and the minimum The vertex A is the vertex A, the maximum vertex is the vertex C, and the others are the vertex B (s207). Then, each side between vertices A, B, and C is defined by Equation 4 (s20
8).
【0028】[0028]
【数4】 頂点AB:s=abk・l+abc …(11) 頂点BC:s=bck・l+bcc …(12) 頂点CA:s=cak・l+cac …(13) 次に、nc=acとして(s209)、nc<ccとな
るまで、ncを+1しながら、以下の処理(s210〜
s215)を繰り返す。まず、l値とs値の描画始点
(sl,ss)を数5により算出する(s210)。Vertex AB: s = abk · l + abc (11) Vertex BC: s = bck · l + bcc (12) Vertex CA: s = cak · l + cac (13) Next, nc = ac and (s209) , Nc <cc, the following processing (s210 to s210)
s215) is repeated. First, the drawing start point (sl, ss) of the l value and the s value is calculated by Expression 5 (s210).
【0029】[0029]
【数5】 sl=(nc−cac)/(cak−nk) …(14) ss=nk・sl+nc …(15) 次に、nc<bcの場合は数6、nc≧bcの場合は数
7により、それぞれ描画終点(el,es)を算出する
(s212,s213)。Sl = (nc−cac) / (cak−nk) (14) ss = nk · sl + nc (15) Next, Equation 6 when nc <bc, and Equation 7 when nc ≧ bc , The drawing end point (el, es) is calculated (s212, s213).
【0030】[0030]
【数6】 el=(nc−abc)/(abk−nk) …(16) es=nk・el+nc …(17)[Mathematical formula-see original document] el = (nc−abc) / (abk−nk) (16) es = nk · el + nc (17)
【0031】[0031]
【数7】 el=(nc−bcc)/(bck−nk) …(18) es=nk・el+nc …(19) 次に、始点、終点を算出したnkライン単位に、ライン
上の画素を順次、テクスチャの高さ情報で変位する変位
量の算出を行ない(s106)、変位前の隣接画素を変
位した画素位置に移しその間を補間してラインの描画を
行なう(s107)。[Mathematical formula-see original document] el = (nc−bcc) / (bck−nk) (18) es = nk · el + nc (19) Next, pixels on the line are sequentially determined in units of nk lines for which the start point and the end point have been calculated. Then, the displacement amount is calculated based on the height information of the texture (s106), and the adjacent pixel before the displacement is moved to the displaced pixel position, and a line is drawn by interpolating between them (s107).
【0032】図6に、分割したnkラインによる三角形
の描画の説明図を示す。(a)は、nkラインの描画
を、三角形のAC辺上を始点として、nkラインをAC
辺上で+1ずつインクリメントしながら描画した例であ
る。nkラインは視点や三角形の向きによってその傾き
が変わり、表示座標系(l,s)、つまりハードの走査
ラインと平行にならない場合がある。このとき、AC辺
に沿った+1の増分は表示座標系のdl,dsで少数値
となり、走査ラインに対応させる実数の加算処理が必要
になる。そのため、実数演算の精度により、インクリメ
ントの度に誤差が累積して、AC辺の終点に辿り着けな
かったり、始点のずれによりnkライン間に描画されな
い隙間を生じたりする。FIG. 6 is an explanatory view of drawing a triangle by the divided nk lines. (A) draws an nk line using the nk line as the starting point on the AC side of the triangle.
This is an example of drawing while incrementing by +1 on the side. The inclination of the nk line changes depending on the viewpoint and the direction of the triangle, and may not be parallel to the display coordinate system (l, s), that is, the hard scanning line. At this time, the increment of +1 along the AC side becomes a decimal value in dl and ds of the display coordinate system, and it is necessary to add a real number corresponding to the scanning line. Therefore, due to the precision of the real number calculation, errors accumulate at every increment, and the end point of the AC side cannot be reached, or a gap that is not drawn between the nk lines due to a shift of the start point occurs.
【0033】(b)は、始点を表示座標系のl値=0と
し、s成分について+1ずつインクリメントしている。
このため、インクリメントが整数演算のみで高速化でき
るのみならず、(a)のような累積誤差による描画漏れ
がない。なお、実際の描画始点と描画終点は三角形枠で
クリッピングを行う。しかし、テクスチャ高さによる画
素変位による三角形枠外の画素を描画可能とするため
に、画素展開は三角形枠外への変位を含んで行なわれ
る。In (b), the starting point is set to l value = 0 in the display coordinate system, and the s component is incremented by +1.
Therefore, the increment can be speeded up only by the integer operation, and there is no omission in drawing due to the accumulated error as shown in FIG. Note that the actual drawing start point and drawing end point are clipped with a triangular frame. However, in order to render a pixel outside the triangular frame due to a pixel displacement due to the texture height, pixel development is performed including displacement outside the triangular frame.
【0034】図7に、三角形枠を含むnkライン群の範
囲の決定方法を説明する。これは、上記したステップs
206〜s208の処理によるものである。表示座標系
(l,s)の三角形の3頂点A,B,Cの座標値(l
1,s1)、(l2,s2)、(l3,s3)を、数3
のl,sに代入して、各頂点を通過するnkラインの直
線の方程式の定数項ncを算出する。この結果、ncが
最小となる頂点Aはnc=ac、nxcが最大となる頂
点Cはnc=cc、他の頂点Bはnc=bcとなり、a
cからccまでがs軸上(l値が0の軸上)における三
角形を含むnkライン群の範囲となる。従って、ac≦
nc<ccの範囲で、ncを+1ずつ加算しながら、n
kライン群の処理が行なわれる。FIG. 7 illustrates a method of determining the range of the nk line group including the triangular frame. This corresponds to the step s described above.
This is due to the processing of steps 206 to s208. The coordinates (l) of the three vertices A, B, and C of the triangle in the display coordinate system (l, s)
(1, s1), (l2, s2), (l3, s3) by
, And the constant term nc of the equation of the straight line of the nk line passing through each vertex is calculated. As a result, the vertex A having the minimum nc has nc = ac, the vertex C having the maximum nxc has nc = cc, the other vertices B have nc = bc, and a
The range from c to cc is the range of the nk line group including the triangle on the s axis (on the axis whose l value is 0). Therefore, ac ≦
In the range of nc <cc, while adding nc by +1, n
Processing of the k-line group is performed.
【0035】数4により、三角形の頂点間の各辺が定義
され、nkラインの描画始点を頂点CA間とし、ac≦
nc<bcの場合は描画終点を頂点AB間、bc≦nc
<ccの場合は描画終点を頂点BC間とする。次に、n
kラインを構成する画素から、三角形枠内に含まれる画
素の始点と終点を、数5〜数7により求める。これによ
り、l軸座標における画素処理範囲はsl≦l<elと
なるので、lを+1ずつ変化させながら、画素単位の処
理を行う。なお、s軸座標の値はl値を、数3へ代入し
て求める。Equation 4 defines each side between the vertices of the triangle, the drawing start point of the nk line is between the vertices CA, and ac ≦
If nc <bc, the drawing end point is between vertices AB, bc ≦ nc
If <cc, the drawing end point is between the vertices BC. Then, n
From the pixels forming the k-line, the starting point and the ending point of the pixels included in the triangular frame are obtained by the following equations (5) to (7). As a result, the pixel processing range at the l-axis coordinate is sl ≦ l <el, so that processing is performed on a pixel-by-pixel basis while changing l by +1. Note that the value of the s-axis coordinate is obtained by substituting the value 1 into Equation 3.
【0036】図8に、テクスチャ高さ情報による変位量
の算出処理と、テクスチャ画素の補間付きラインの描画
処理のフロー、図9にその説明図を示す。なお、三角形
の各頂点のデータと、対応するテクスチャのデータを以
下のように定義する。FIG. 8 shows a flow of a process of calculating a displacement amount based on texture height information and a process of drawing a line with interpolation of texture pixels, and FIG. 9 is an explanatory diagram thereof. The data of each vertex of the triangle and the data of the corresponding texture are defined as follows.
【0037】頂点Aの座標(la,sa)、奥行値w
a、テクスチャの座標(ua,va)、高さha、頂点
Bの座標(lb,sb)、奥行値wb、テクスチャの座
標(ub,vb)、高さhb、頂点Cの座標(lc,s
c)、奥行値きwc、テクスチャの座標(uc,v
c)、高さhcとする。また、部率設定手段150より
設定される高さ倍率係数をdとする。The coordinates (la, sa) of the vertex A and the depth value w
a, coordinates of texture (ua, va), height ha, coordinates of vertex B (lb, sb), depth value wb, coordinates of texture (ub, vb), height hb, coordinates of vertex C (lc, s)
c), depth value wc, texture coordinates (uc, v
c) and height hc. Also, the height magnification coefficient set by the copy ratio setting means 150 is d.
【0038】まず、3頂点の奥行き値wa、wb、wc
より、表示座標系(l,s)に対応する奥行値wを算出
する(s301)。次に、nkラインのl成分のnl
と、高さ倍率係数dと、3頂点に対応しTM300から
読み出したテクスチャ画素の高さhと、算出した奥行値
wにより、座標lにある画素の変位した座標ptのl値
(pl)、s値(ps)を、数8により算出する(s3
02)。First, the depth values wa, wb, wc of the three vertices
Then, the depth value w corresponding to the display coordinate system (l, s) is calculated (s301). Next, nl of the l component of the nk line
From the height magnification coefficient d, the height h of the texture pixel read from the TM 300 corresponding to the three vertices, and the calculated depth value w, the l value (pl) of the displaced coordinate pt of the pixel at the coordinate l, The s value (ps) is calculated by Equation 8 (s3
02).
【0039】[0039]
【数8】pl=nl・d・h/w+l …(20) ps=nk・pl+nc …(21) 図9は、nkライン上で隣接する画素P1、P2の描画
処理を示す説明図である。座標lにある画素P1は変位
量pt1(l値がpl1)のP1’に、座標l+1にあ
る画素P2は変位量Pt2(pl2)のP’に変位さ
れ、p1’〜P2’間は補間画素Cmにより描画されて
いる。## EQU8 ## pl = nl.d.h / w + 1 (20) ps = nk.pl + nc (21) FIG. 9 is an explanatory diagram showing a drawing process of pixels P1 and P2 adjacent on the nk line. The pixel P1 at the coordinate 1 is displaced to P1 'of the displacement amount pt1 (l value is pl1), the pixel P2 at the coordinate l + 1 is displaced to P' of the displacement amount Pt2 (pl2), and the interpolation pixel is between p1 'and P2'. Cm is drawn.
【0040】RP200は処理中のnkライン上で、p
l=pl1、ps=ps1とし(s303)、FM40
0から座標(pl,ps)に格納されている画素データ
の奥行値wfを読み出す(s304)。FM400の座
標(pl,ps)には、本実施例の変位補間により既に
他の画素位置から描画されていることがある。また、背
景画像など合成する他の画像が格納されている場合もあ
る。The RP200 displays p on the nk line being processed.
1 = pl1, ps = ps1 (s303), FM40
From 0, the depth value wf of the pixel data stored at the coordinates (pl, ps) is read (s304). The coordinates (pl, ps) of the FM 400 may have already been drawn from another pixel position by the displacement interpolation of this embodiment. Further, another image to be combined, such as a background image, may be stored.
【0041】このため、陰面消去が必要になる。描画指
令より受け取ったP1のw値とFM400から読み出し
たP1’〜P2’の格納済のwfを比較し、w≦wfの
場合、つまり今回の変位による補間画素が手前の場合
(s305)、FM400の座標(pl,ps)へP
1’〜P2’の補間描画を行なう。ここで、pt1から
pt2までの画素は、画素P1のw値として一律とす
る。一律のw値を使用する方法は処理が簡単であるが、
複数の三角形が隣接して重なるときには、正確な陰面処
理ができない。より正確な陰面処理を行うためには、法
線Nのz成分を考慮したw値の補間演算が必要となる。Therefore, hidden surface elimination is required. The w value of P1 received from the drawing command is compared with the stored wf of P1 ′ to P2 ′ read from the FM 400. If w ≦ wf, that is, if the interpolation pixel due to the current displacement is nearer (s305), the FM 400 To the coordinates (pl, ps) of P
Interpolation drawing of 1 'to P2' is performed. Here, the pixels from pt1 to pt2 are uniform as w values of the pixel P1. The method of using a uniform w value is easy to process,
When a plurality of triangles are adjacent to each other, accurate hidden surface processing cannot be performed. In order to perform more accurate hidden surface processing, it is necessary to perform an interpolation calculation of the w value in consideration of the z component of the normal line N.
【0042】ここで、P1’〜P2’間の補間描画にお
ける各画素の輝度値は、画素P1に対応するテクスチャ
画像の色データの輝度から画素P2の色データの輝度へ
補間演算(内挿)により求める(s306)。Here, the brightness value of each pixel in the interpolation drawing between P1 'and P2' is calculated by interpolation (interpolation) from the brightness of the color data of the texture image corresponding to the pixel P1 to the brightness of the color data of the pixel P2. (S306).
【0043】次に、pl(最初はpl1)を+1し(s
307)、pl≧pl2になるまでステップs304か
らの処理を繰り返す(s308)。これにより、nkラ
インを描画ラインとする補間付きのライン描画が行なわ
れる。Next, pl (initially pl1) is incremented by 1 (s
307), the processing from step s304 is repeated until pl ≧ pl2 (s308). Thus, line drawing with interpolation using the nk line as the drawing line is performed.
【0044】三角形枠内のnkラインを構成する全ての
画素間について以上の処理を行うことで、1本のnkラ
インの処理が完了する。さらに、ac≦nc<ccの範
囲でncを+1ずつ加算して、範囲内の全てのnkライ
ンの描画を行うことで、凹凸のある1つの三角形の描画
が完了する。By performing the above processing for all the pixels constituting the nk line in the triangular frame, the processing of one nk line is completed. Further, nc is incremented by one in the range of ac ≦ nc <cc, and drawing of all nk lines in the range is completed, whereby drawing of one triangle having concavities and convexities is completed.
【0045】図10は、三角形の輪郭付近のnkライン
の描画処理を示す説明図である。nkライン上で、互い
に隣接する変位前の画素P1,P2がPt1,Pt2に
変位し、三角形のBC辺の外に補間描画画素Cmとして
描画されている。本実施例では、描画始点と描画終点の
選択にはクリッピングを用いるが、その後の補間付きラ
イン描画の結果には適用しないので、三角形枠外の描画
が可能になる。FIG. 10 is an explanatory diagram showing a drawing process of nk lines near the outline of a triangle. On the nk line, the adjacent pixels P1 and P2 before the displacement are displaced to Pt1 and Pt2, and are drawn as interpolation drawing pixels Cm outside the BC side of the triangle. In the present embodiment, clipping is used to select a drawing start point and a drawing end point, but is not applied to the result of the subsequent line drawing with interpolation, so that drawing outside the triangular frame is possible.
【0046】図11に、本実施例により描画した三角形
の表示例を示す。各画素の色はnkラインごとに変えて
いる。図示のように、補間描画画素群が本来は面一な三
角形の表面に凹凸感を与えている。とりわけ、各三角形
の周辺部では、テクスチャ高さに基づく変位により、三
角形の理想線に対して出入りのある描画となり、凹凸感
をきわだたせている。なお、凹凸の画質は、CRT50
0に画像表示しながら、倍率設定部150で高さh倍率
係数を変えることで、所望の画質を得ることができる。FIG. 11 shows a display example of a triangle drawn according to the present embodiment. The color of each pixel is changed every nk line. As shown in the drawing, the interpolation drawing pixel group gives a sense of unevenness to the surface of a triangular surface which is originally flush. In particular, in the peripheral portion of each triangle, the displacement based on the texture height results in drawing with ingress and egress from the ideal line of the triangle, thereby making the sense of irregularities stand out. The image quality of the unevenness is CRT50
The desired image quality can be obtained by changing the height h magnification coefficient by the magnification setting unit 150 while displaying the image at 0.
【0047】以上のように、本実施例は三角形の3次元
の法線ベクトルを投影した表示座標系の投影ベクトルに
平行な複数のnkラインにしたがって、三角形の描画処
理を行なうとき、nkライン上の画素を対応するテクス
チャの高さ情報で順次変位し、変位によって生じた画素
間をテクスチャ輝度で補間描画する。この結果、テクス
チャの高さと輝度が補間画素として反映されるので、本
来は面一な三角形(単一ポリゴン)に、その周辺部を含
めてリアル感のある凹凸を描画することができる。しか
も、ポリゴンの細分割を必要とせず、基本的にはライン
分割と変位量の算出のみで可能になるので、処理が簡単
で汎用(普通の処理能力)の描画装置で実現できる。As described above, according to the present embodiment, when rendering a triangle according to a plurality of nk lines parallel to a projection vector of a display coordinate system on which a three-dimensional normal vector of a triangle is projected, the nk lines are drawn. Are sequentially displaced according to the height information of the corresponding texture, and the pixels generated by the displacement are interpolated and drawn with the texture luminance. As a result, since the height and the luminance of the texture are reflected as the interpolation pixels, it is possible to draw a realistic unevenness including a peripheral portion thereof on a triangular (single polygon) which is originally flush. In addition, since subdivision of polygons is not required and basically only line division and calculation of displacement can be performed, the processing can be realized with a simple and general-purpose (normal processing capability) drawing apparatus.
【0048】[0048]
【発明の効果】本発明によれば、三角形の法線方向を投
影したラインを基に、表示系上の三角系を分割する描画
ラインを定め、描画ライン上の画素を順次、テクスチャ
高さを基に変位し、変位した画素間を補間してライン描
画するので、ポリゴンの細分による座標変換等の処理数
を増やすことなく、周辺部を含めて凹凸のあるポリゴン
を高速に描画でき、また安価な装置で実現できる効果が
ある。According to the present invention, a drawing line for dividing the triangular system on the display system is determined based on the line projected in the normal direction of the triangle, and pixels on the drawing line are sequentially adjusted in texture height. Line drawing is performed by interpolating between displaced pixels based on the original, so polygons with irregularities including peripheral parts can be drawn at high speed without increasing the number of processes such as coordinate conversion by subdividing polygons, and inexpensive There is an effect that can be realized with a simple device.
【図1】本発明の一実施例による三次元描画装置の構成
図。FIG. 1 is a configuration diagram of a three-dimensional drawing apparatus according to an embodiment of the present invention.
【図2】本発明の一実施例による凹凸ポリゴン描画の手
順を示す概略フロー図。FIG. 2 is a schematic flowchart showing a procedure of drawing a concave and convex polygon according to an embodiment of the present invention.
【図3】座標表示系の長短軸(l,s)と三角形の長短
軸(x,y)の置換を示す説明図。FIG. 3 is an explanatory diagram showing replacement of the major and minor axes (l, s) of a coordinate display system and the major and minor axes (x, y) of a triangle;
【図4】三角形のライン分割処理の手順を示すフロー
図。FIG. 4 is a flowchart showing the procedure of triangular line division processing.
【図5】図4の続きを示すフロー図。FIG. 5 is a flowchart showing a continuation of FIG. 4;
【図6】三角形描画時のnkライン分割を示す説明図。FIG. 6 is an explanatory diagram showing nk line division at the time of drawing a triangle.
【図7】三角形枠を含むnkライン群の範囲を示す説明
図。FIG. 7 is an explanatory diagram showing a range of an nk line group including a triangular frame.
【図8】変位量算出と補間を含むライン描画処理のフロ
ー図。FIG. 8 is a flowchart of a line drawing process including displacement amount calculation and interpolation.
【図9】nkライン上で隣接する画素の描画処理を示す
説明図。FIG. 9 is an explanatory diagram showing drawing processing of pixels adjacent on the nk line.
【図10】三角形の周辺部における画素の描画処理を示
す説明図。FIG. 10 is an explanatory diagram showing a drawing process of a pixel in a peripheral portion of a triangle.
【図11】本実施例の描画処理による凹凸三角形の描画
例を示す説明図。FIG. 11 is an explanatory diagram showing an example of drawing a concave and convex triangle by the drawing processing according to the embodiment.
100…CPU、110…三角形分割部、120…描画
指令発行部、130…テクスチャ画像設定部、140…
テクスチャ高さ情報設定部、150…倍率設定部、20
0…RP、210…ライン分割部、220…変位量算出
部、230…補間付ライン描画部、300…TM、40
0…FM、500…CRT。100 CPU, 110 Triangulation unit, 120 Drawing command issuing unit, 130 Texture image setting unit, 140
Texture height information setting section, 150: magnification setting section, 20
0: RP, 210: line dividing unit, 220: displacement amount calculating unit, 230: line drawing unit with interpolation, 300: TM, 40
0 ... FM, 500 ... CRT.
───────────────────────────────────────────────────── フロントページの続き (72)発明者 上野 孝敏 茨城県日立市大みか町五丁目2番1号 日 立プロセスコンピュータエンジニアリング 株式会社内 (72)発明者 赤津 正光 茨城県日立市大みか町五丁目2番1号 日 立プロセスコンピュータエンジニアリング 株式会社内 (72)発明者 鬼木 一徳 茨城県日立市大みか町五丁目2番1号 株 式会社日立製作所大みか工場内 (72)発明者 小沢 幸次 茨城県日立市大みか町五丁目2番1号 株 式会社日立製作所大みか工場内 Fターム(参考) 5B050 BA07 BA18 EA09 EA28 EA30 5B080 AA14 AA19 GA14 GA22 GA23 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Takatoshi Ueno 5-2-1 Omika-cho, Hitachi City, Ibaraki Prefecture Inside Hitachi Process Computer Engineering Co., Ltd. (72) Inventor Masamitsu Akatsu 5-chome, Omika-cho, Hitachi City, Ibaraki Prefecture No. 1 Hitachi Process Computer Engineering Co., Ltd. (72) Inventor Kazunori Oniki 5-2-1 Omikacho, Hitachi City, Ibaraki Prefecture Inside Omika Plant, Hitachi, Ltd. (72) Koji Ozawa Omika, Hitachi City, Ibaraki Prefecture 5-2-1, Machi-cho F-term (reference) at Hitachi, Ltd. Omika Plant 5B050 BA07 BA18 EA09 EA28 EA30 5B080 AA14 AA19 GA14 GA22 GA23
Claims (6)
ポリゴンモデルを用い、前記三角形を順次、フレームメ
モリに画素展開して前記物体の描画を行なうときに、前
記三角形の表面に凹凸を表現するテクスチャをマッピン
グする凹凸ポリゴンの描画方法において、 前記三角形毎にその法線ベクトルから二次元の表示座標
系への投影ベクトルを求め、該ベクトルに平行な複数の
線分(以下、描画ライン)で前記三角形をライン分割
し、 前記描画ライン上の画素の始点から順に対応する前記テ
クスチャの画像データを取り込み、前記画素に対し前記
テクスチャの高さ情報に応じた変位を求め、同様に求め
た同じ描画ライン上の隣接画素の変位との間を補間した
画素をフレームメモリに描画し、これを三角形内の全描
画ライン、さらに前記物体を表す全三角形について繰り
返し、上記の補間画素によって前記凹凸を表現すること
を特徴とする凹凸ポリゴンの描画方法。1. A polygon model in which a three-dimensional object is divided into a plurality of triangles. When the triangles are sequentially developed into pixels in a frame memory and the object is drawn, irregularities are expressed on the surface of the triangles. In the method of drawing an uneven polygon for mapping a texture to be projected, a projection vector to a two-dimensional display coordinate system is obtained from a normal vector for each triangle, and a plurality of line segments (hereinafter, drawing lines) parallel to the vector are obtained. The triangle is divided into lines, the image data of the corresponding texture is sequentially taken from the starting point of the pixel on the drawing line, the displacement corresponding to the height information of the texture is obtained for the pixel, and the same drawing obtained in the same manner is obtained. A pixel interpolated between the displacement of the adjacent pixel on the line is drawn in the frame memory, and this is drawn on all drawing lines in the triangle, and further on the object. Repeated for to all triangles, the method of drawing unevenness polygons, characterized by representing said irregularities by the interpolation pixel.
接画素の各テクスチャの色データの輝度から補間するこ
とを特徴とする凹凸ポリゴンの描画方法。2. The method according to claim 1, wherein the pixel interpolation between the displacements is performed based on the luminance of the color data of each texture of a certain pixel before the displacement and its adjacent pixels.
の走査ラインが最初に交わる前記三角形の一辺との交点
であり、かつ、前記描画ラインは前記走査ライン毎に+
1ずつインクリメントすることを特徴とする凹凸ポリゴ
ンの描画方法。3. The method according to claim 1, wherein a starting point of a pixel position on the drawing line is an intersection with one side of the triangle where a scanning line of the display coordinate system first intersects, and the drawing line is + For each scan line
A method for drawing a concave and convex polygon, which is incremented by one.
ムメモリの画素の奥行値を比較し、前者が手前となる場
合に前記補間画素を前記フレームメモリに描画すること
を特徴とする凹凸ポリゴンの描画方法。4. The method according to claim 1, wherein a depth value of a pixel before the displacement is compared with a depth value of a pixel of the frame memory corresponding to the displacement. A method for drawing a concave and convex polygon, wherein the drawing is performed on the frame memory.
る複数の三角形に分割し、三角形単位に二次元の表示座
標系に変換して描画指令を発行する描画指令演算手段
と、前記描画指令により前記三角形を順次、画素展開す
る描画プロセッサ及びフレームメモリと、フレームメモ
リに展開された画素を表示する表示装置を備える三次元
描画装置において、 前記三角形の表面に凹凸を表現するテクスチャの色デー
タ及び高さ情報を含む画像データを記憶するテクスチャ
メモリを設け、 前記描画指令演算手段は、前記三角形毎の法線ベクトル
から表示座標系への投影ベクトルと、前記三角形の二次
元変換された頂点に対応するテクスチャの座標を求め、 前記描画プロセッサは、前記投影ベクトルに平行な複数
の線分(以下、描画ライン)で前記三角形をライン分割
し、前記描画ライン上の画素の始点から順に対応するテ
クスチャの画像データを取り込み、前記画素について前
記高さ情報に応じた変位を求め、同様に求めた隣接画素
の変位との間を補間した画素を前記フレームメモリに描
画することを特徴とする三次元描画装置。5. A drawing command calculating means for dividing a three-dimensional object into a plurality of triangles which are the minimum units of a polygon, converting the three-dimensional object into a two-dimensional display coordinate system in triangular units, and issuing a drawing command; In the three-dimensional rendering apparatus, comprising: a rendering processor and a frame memory that sequentially expands the triangles into pixels according to pixels; and a display device that displays the pixels developed in the frame memory. A texture memory for storing image data including height information, wherein the drawing command calculating means corresponds to a projection vector from a normal vector for each triangle to a display coordinate system and a two-dimensional transformed vertex of the triangle; The drawing processor obtains the coordinates of the texture to be rendered, and calculates the triangle by using a plurality of line segments (hereinafter, drawing lines) parallel to the projection vector. The shape is divided into lines, the image data of the corresponding texture is taken in order from the starting point of the pixel on the drawing line, and a displacement according to the height information is obtained for the pixel. A three-dimensional rendering apparatus, which renders pixels interpolated in the frame memory.
けたことを特徴とする三次元描画装置。6. The three-dimensional drawing apparatus according to claim 5, further comprising magnification setting means for varying height information of the texture.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP19881498A JP2000030081A (en) | 1998-07-14 | 1998-07-14 | Drawing method of three-dimensional drawing apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP19881498A JP2000030081A (en) | 1998-07-14 | 1998-07-14 | Drawing method of three-dimensional drawing apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2000030081A true JP2000030081A (en) | 2000-01-28 |
Family
ID=16397365
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP19881498A Pending JP2000030081A (en) | 1998-07-14 | 1998-07-14 | Drawing method of three-dimensional drawing apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2000030081A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6437791B1 (en) * | 1999-06-11 | 2002-08-20 | Creative Technology Ltd. | Method and apparatus for supporting texture patterns larger than supported natively by a graphics chip |
EP2551826A2 (en) | 2011-07-29 | 2013-01-30 | Fujitsu Limited | Drawing device |
EP2615578A1 (en) | 2012-01-13 | 2013-07-17 | Fujitsu Limited | Image drawing apparatus with a cache memory |
-
1998
- 1998-07-14 JP JP19881498A patent/JP2000030081A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6437791B1 (en) * | 1999-06-11 | 2002-08-20 | Creative Technology Ltd. | Method and apparatus for supporting texture patterns larger than supported natively by a graphics chip |
EP2551826A2 (en) | 2011-07-29 | 2013-01-30 | Fujitsu Limited | Drawing device |
JP2013030066A (en) * | 2011-07-29 | 2013-02-07 | Fujitsu Ltd | Drawing device |
EP2615578A1 (en) | 2012-01-13 | 2013-07-17 | Fujitsu Limited | Image drawing apparatus with a cache memory |
EP2738736A1 (en) | 2012-01-13 | 2014-06-04 | Fujitsu Limited | Image drawing apparatus with a cache memory |
US9245370B2 (en) | 2012-01-13 | 2016-01-26 | Fujitsu Limited | Image drawing apparatus, computer-readable medium storing program, and method of the same |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3203160B2 (en) | Volume rendering apparatus and method | |
KR100261076B1 (en) | Rendering Method and Apparatus Performing Bump Mapping and Phong Shading Simultaneously | |
US6226005B1 (en) | Method and system for determining and/or using illumination maps in rendering images | |
JP2000227966A (en) | 3d computer graphics processor and processing method | |
JP5299173B2 (en) | Image processing apparatus, image processing method, and program | |
JP3179392B2 (en) | Image processing apparatus and image processing method | |
JP2001052194A (en) | Reconfiguration for curved surface | |
JPH05307610A (en) | Texture mapping method and its device | |
Merlo et al. | 3D model visualization enhancements in real-time game engines | |
JP2003256865A (en) | Method and program for generating 2D image of cartoon expression from 3D object data | |
JP2004005452A (en) | Image processor, image processing method, semiconductor device, computer program and record medium | |
JP2007317204A (en) | Three-dimensional graphic processing method and apparatus for performing perspective correction | |
JP3278501B2 (en) | Image processing apparatus and method | |
JP3035571B2 (en) | Image processing device | |
JP2000030081A (en) | Drawing method of three-dimensional drawing apparatus | |
JPH07282292A (en) | Texture mapping method and image processor | |
JP3979162B2 (en) | Image processing apparatus and method | |
JP4060375B2 (en) | Spotlight characteristic forming method and image processing apparatus using the same | |
KR100848687B1 (en) | 3D graphics processing device and its operation method | |
JP2001283254A (en) | Three-dimensional graphic plotting device and its method | |
JP2655056B2 (en) | Texture data generator | |
CA2261245C (en) | Division circuit and graphic display processing apparatus | |
JP3712015B2 (en) | Image creating apparatus and method | |
KR100313846B1 (en) | Method and Apparatus for Calculating Detail (LOD) in Bilinear Mip Mapping | |
JP2006133940A (en) | Real-time image generation device using level of detail |