JP2005099313A - Image drawing method and image drawing system - Google Patents

Image drawing method and image drawing system Download PDF

Info

Publication number
JP2005099313A
JP2005099313A JP2003331741A JP2003331741A JP2005099313A JP 2005099313 A JP2005099313 A JP 2005099313A JP 2003331741 A JP2003331741 A JP 2003331741A JP 2003331741 A JP2003331741 A JP 2003331741A JP 2005099313 A JP2005099313 A JP 2005099313A
Authority
JP
Japan
Prior art keywords
pixel
rotation
coordinates
rotation angle
rotated
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
JP2003331741A
Other languages
Japanese (ja)
Inventor
Yasuhiro Enomoto
保宏 榎本
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 JP2003331741A priority Critical patent/JP2005099313A/en
Publication of JP2005099313A publication Critical patent/JP2005099313A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an image drawing method and an image drawing system capable of reducing the load on a CPU by extremely reducing trigonometric processing time in the rotation operation processing of a drawing object. <P>SOLUTION: In steps SB1, SB2, SB3 and SB4, the rotation state of the drawing object - whether it is necessary to rotate the object, whether the object is about to rotate, whether the rotation is to be continued - is judged. In steps SB5, SB6 and SB7, a rotation result table that is a trigonometric operation result corresponding to the rotation angle of the drawing object is selected. In the step SB8, the coordinates of the display position of the pixels of the drawing object after rotation is obtained and, in the step SB9, the pixels are drawn in a memory. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明はゲーム機などに用いる画像描画方法および装置に関する。     The present invention relates to an image drawing method and apparatus used for a game machine or the like.

従来の画像描画装置では、描画対象物を回転させる場合にはωを回転の角速度、tをフレームの表示時間間隔として角度をθ=ω×tと表し、回転前のピクセルの座標を(X,Y)、回転後のピクセルを(X',Y')、回転の中心座標を(Rx,Ry)として[数1]の数式を使い、演算を行っていた。ここで、従来技術では[数1]中の三角関数の演算を毎フレーム繰り返していた。   In a conventional image drawing apparatus, when rotating a drawing object, ω is an angular velocity of rotation, t is a display time interval of a frame, an angle is represented as θ = ω × t, and coordinates of pixels before the rotation are represented by (X, Y), the rotated pixel is (X ′, Y ′), the center coordinates of the rotation is (Rx, Ry), and the calculation is performed using the formula [Equation 1]. Here, in the prior art, the calculation of the trigonometric function in [Expression 1] is repeated every frame.

Figure 2005099313
Figure 2005099313

さらに、フレーム内に回転を行う描画対象物が複数あるケースでは三角関数の演算回数はこれらの積に相当するため、CPU(中央処理装置)に負担をかける問題点がある。
なお、従来の図形を回転させる技術として、特許文献1に記載されるものが知られている。
特開平10−149440号公報
Furthermore, in the case where there are a plurality of drawing objects to be rotated in the frame, the number of operations of the trigonometric function corresponds to the product of these, so there is a problem that places a burden on the CPU (central processing unit).
In addition, what is described in patent document 1 is known as a technique which rotates the conventional figure.
JP-A-10-149440

本発明は上記の事情を考慮してなされたもので、その目的は描画対象物の回転演算処理における三角関数の処理時間を極めて小さくすることができ、これにより、CPUの負担を軽減することができる画像描画方法および装置を提供することにある。   The present invention has been made in consideration of the above-described circumstances, and its purpose is to reduce the processing time of the trigonometric function in the rotation calculation processing of the drawing object, thereby reducing the load on the CPU. An object of the present invention is to provide an image drawing method and apparatus.

この発明は前述の課題を解決するためになされたもので、請求項1の発明は、表示対象物を回転させたときの各ピクセルの表示位置の座標を、属性データに基づいて求め、求めた座標にしたがって回転後のピクセルをメモリに描画する画像描画方法において、予め設定した回転角θについてsin nθ(nは正の整数)およびcos nθの値を回転角テーブルとしてメモリに記憶させておき、回転開始時点の回転角を0とし、以後、表示フレーム毎に回転角をθ、2θ、3θ、・・・として前記ピクセルを回転させた場合の回転後のピクセルの座標を、前記属性データに含まれる回転中心座標および前記メモリ内のデータを使用して演算し、該演算結果に基づいてピクセルをメモリに描画することを特徴とする画像描画方法である。   The present invention has been made to solve the above-described problems, and the invention of claim 1 determines and obtains the coordinates of the display position of each pixel when the display object is rotated based on the attribute data. In an image drawing method for drawing a pixel after rotation in memory according to coordinates, values of sin nθ (n is a positive integer) and cos nθ are stored in a memory as a rotation angle table for a preset rotation angle θ. The attribute data includes the coordinates of the pixel after rotation when the rotation angle is set to 0 for each display frame and the pixel is rotated for each display frame. The image drawing method is characterized in that the calculation is performed using the rotation center coordinates and the data in the memory, and the pixel is drawn in the memory based on the calculation result.

請求項2に記載の発明は請求項1に記載の画像描画方法において、予め前記回転角テーブルを複数種類設け、前記属性データにテーブル種類を指示するテーブル種類データを設定し、前記テーブル種類データが指示する回転角テーブルを使用して回転後のピクセルの座標を演算することを特徴とするものである。   According to a second aspect of the present invention, in the image drawing method according to the first aspect, a plurality of types of rotation angle tables are provided in advance, table type data indicating a table type is set in the attribute data, and the table type data is The coordinates of the pixel after rotation are calculated using a rotation angle table to be indicated.

請求項3に記載の発明は請求項1または請求項2に記載の画像描画方法で、前記属性データに切替周期を設定し、前記表示フレームが前記切替周期の数だけ表示される毎に回転後のピクセルの座標を求める演算を実行し、演算結果に基づいて回転後のピクセルをメモリに描画することを特徴とするものである。   According to a third aspect of the present invention, in the image drawing method according to the first or second aspect, a switching period is set in the attribute data, and the display frame is rotated each time the display frame is displayed by the number of the switching periods. The calculation of obtaining the coordinates of the pixel is executed, and the rotated pixel is drawn in a memory based on the calculation result.

請求項4に記載の発明は画像描画装置であって、表示対象物を回転させたときの各ピクセルの表示位置の座標を、属性データに基づいて求め、求めた座標にしたがって回転後のピクセルをメモリに描画する画像描画装置において、予め設定された回転角θについてsin nθ(nは正の整数)およびcos nθの値を記憶する回転角テーブルと、回転開始時点の回転角を0とし、以後、表示フレーム毎に回転角をθ、2θ、3θ、・・・として前記ピクセルを回転させた場合の回転後のピクセルの座標を、前記属性データに含まれる回転中心座標および前記回転角テーブル内のデータを使用して演算する演算手段と、前記演算手段の演算結果に基づいてピクセルをメモリに描画する書込手段と、を具備することを特徴とするものである。   The invention according to claim 4 is an image drawing apparatus, wherein the coordinates of the display position of each pixel when the display object is rotated are obtained based on the attribute data, and the rotated pixel is determined according to the obtained coordinates. In an image drawing apparatus for drawing in a memory, a rotation angle table for storing values of sin nθ (n is a positive integer) and cos nθ for a preset rotation angle θ, and a rotation angle at the time of starting rotation are set to 0. , When the pixel is rotated with the rotation angle being θ, 2θ, 3θ,... For each display frame, the coordinates of the rotated pixel are the rotation center coordinates included in the attribute data and the rotation angle table. An arithmetic means for calculating using data, and a writing means for drawing a pixel in a memory based on an arithmetic result of the arithmetic means are provided.

請求項5に記載の発明は請求項4に記載の画像描画装置において、前記回転角テーブルを複数種類具備し、前記演算手段は、前記属性データに含まれるテーブル種類を示すテーブル種類データが指示する回転角テーブルを使用して回転後のピクセルの座標を演算することを特徴とするものである。   According to a fifth aspect of the present invention, in the image drawing apparatus according to the fourth aspect of the present invention, the rotation angle table includes a plurality of types, and the calculation unit is instructed by table type data indicating a table type included in the attribute data. The coordinates of the pixel after rotation are calculated using a rotation angle table.

請求項6に記載の発明は請求項4または請求項5に記載の画像描画装置において、前記属性データが切替周期を含み、前記演算手段は、前記表示フレームが前記切替周期の数だけ表示される毎に回転後のピクセルの座標を求める演算を実行することを特徴とするものである。   According to a sixth aspect of the present invention, in the image drawing device according to the fourth or fifth aspect, the attribute data includes a switching period, and the calculation means displays the display frame by the number of the switching periods. The calculation for obtaining the coordinates of the pixel after rotation is executed every time.

この発明によれば、三角関数の演算結果をあらかじめ画像描画装置内に用意し、描画データの回転の際にはこれを使うため、ホストCPUの負担を軽減することができる効果がある。   According to the present invention, since the calculation result of the trigonometric function is prepared in the image drawing apparatus in advance and is used when drawing data is rotated, the burden on the host CPU can be reduced.

以下、図面を参照し、この発明の実施の形態について説明する。図1は本実施形態による画像描画装置の構成を示すブロック図である。図1において、符号11はスプライトを構成するキャラクタの圧縮画像データがドットマトリクス形式で格納されているキャラクタROM(Read Only Memory)である。符号12はキャラクタROM11から読み出されたスプライトの圧縮画像データが一時記憶されるFIFO(ファーストイン・ファーストアウト)メモリである。   Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing the configuration of the image drawing apparatus according to the present embodiment. In FIG. 1, reference numeral 11 denotes a character ROM (Read Only Memory) in which compressed image data of characters constituting a sprite is stored in a dot matrix format. Reference numeral 12 denotes a FIFO (First In First Out) memory in which the compressed image data of the sprite read from the character ROM 11 is temporarily stored.

符号13は解凍エンジンであり、キャラクタROM11からFIFOメモリ12を介して与えられる圧縮画像データを解凍して圧縮前の画像データ(カラーコードまたはYUV形式の画素値)に戻す。次いで、画像データがカラーコードである場合には、そのカラーコードをカラーパレット14によってRGB(レッド・グリーン・ブルー)カラーデータに変換し、フリップフロップ15を介して2面あるスプライトバッファAまたはBに書き込む。また、解凍後の画像データがYUV(輝度・色差)形式の画素値の場合は、YUVデコーダ16によってRGBカラーデータに変換し、フリップフロップ15を介してスプライトバッファAまたはBに書き込む。この場合、スプライトバッファA、Bのいずれに書き込むかを指示するコントロールデータが解凍エンジン13から出力される。   Reference numeral 13 denotes a decompression engine, which decompresses the compressed image data given from the character ROM 11 via the FIFO memory 12 and returns the image data to a pre-compression image data (color code or YUV format pixel value). Next, when the image data is a color code, the color code is converted into RGB (red, green, blue) color data by the color palette 14 and is transferred to the sprite buffer A or B on the two sides via the flip-flop 15. Write. When the decompressed image data is a pixel value in YUV (luminance / color difference) format, it is converted into RGB color data by the YUV decoder 16 and written into the sprite buffer A or B via the flip-flop 15. In this case, control data indicating which of the sprite buffers A and B is to be written is output from the decompression engine 13.

18は描画エンジンであり、コントローラ17からの指示に従ってスプライトバッファAまたはBからスプライトのRGBカラーデータを読み出し、読み出したRGBカラーデータにコントローラ17から出力される指示データに基づき、回転結果テーブル20を参照して回転等の変形処理を行い、次いで、コントローラ17から出力される位置データが示すフレームバッファ19のアドレスに、変形処理終了後のRGBカラーデータを書き込む。フレームバッファ19は2個のバンクによって構成され、交互に描画用バッファ、表示用バッファとして使用される。   A drawing engine 18 reads the RGB color data of the sprite from the sprite buffer A or B in accordance with an instruction from the controller 17, and refers to the rotation result table 20 based on the instruction data output from the controller 17 to the read RGB color data. Then, deformation processing such as rotation is performed, and then the RGB color data after the deformation processing is written to the address of the frame buffer 19 indicated by the position data output from the controller 17. The frame buffer 19 is composed of two banks and is alternately used as a drawing buffer and a display buffer.

コントローラ17は、ホストCPU(図示略)から出力され、CPUインターフェイスブロック21を介して供給される各種の指示(スプライト属性データ)をSRAMインターフェイスブロック22を介してスプライト属性テーブル23に書き込むと共に、その書き込まれたスプライト属性データに基づいて解凍エンジン13および描画エンジン18を制御する。また、コントローラ17は、フレームバッファ19からRGBカラーデータを読み出し、ディスプレイインターフェイスブロック24を介してディスプレイ装置(図示略)へ出力する。   The controller 17 writes various instructions (sprite attribute data) output from the host CPU (not shown) and supplied via the CPU interface block 21 to the sprite attribute table 23 via the SRAM interface block 22 and the writing. The decompression engine 13 and the drawing engine 18 are controlled based on the sprite attribute data. Further, the controller 17 reads the RGB color data from the frame buffer 19 and outputs it to the display device (not shown) via the display interface block 24.

次に、上述した実施形態の描画動作を図2に示すフローチャートを参照して説明する。図2のフローチャートでは、N個のスプライトをフレームバッファ19に描画する例を示している。また、フローチャートの処理はフレーム周期で行われる。図1のコントローラ17はステップSA1においてフレームバッファ19の2つのバンクの一方を描画用、他方を表示用に設定する。すなわち、前フレームで描画用になっていたバンクは表示用に設定され、前フレームで表示用になっていたバンクは描画用に設定される。次にコントローラ17はステップSA2〜ステップSA6で図4のスプライト属性テーブル中に示されるすべてのスプライトに対して、先頭から順次処理を行う。   Next, the drawing operation of the above-described embodiment will be described with reference to the flowchart shown in FIG. The flowchart of FIG. 2 shows an example in which N sprites are drawn in the frame buffer 19. Further, the process of the flowchart is performed in a frame cycle. In step SA1, the controller 17 in FIG. 1 sets one of the two banks of the frame buffer 19 for drawing and the other for display. That is, the bank that was used for drawing in the previous frame is set for display, and the bank that was used for display in the previous frame is set for drawing. Next, in step SA2 to step SA6, the controller 17 sequentially processes all the sprites shown in the sprite attribute table of FIG. 4 from the top.

すなわち、コントローラ17は、まず、内部のレジスタSPNO(図示略)にデータ「1」を書き込む(ステップSA2)。次に、スプライト属性テーブル23にアクセスし、レジスタSPNO内のデータ(この場合「1」)に対応する属性データ、すなわち、スプライト1の属性データを取り込む(ステップSA3)。次に、その属性データが示すスプライト1のキャラクタのアドレスに基づいてキャラクタROM11にアクセスし、スプライト1のキャラクタを読み出す(ステップSA4)。読み出されたキャラクタはFIFO12に記憶される。   That is, the controller 17 first writes data “1” in the internal register SPNO (not shown) (step SA2). Next, the sprite attribute table 23 is accessed, and the attribute data corresponding to the data in the register SPNO (in this case “1”), that is, the attribute data of the sprite 1 is fetched (step SA3). Next, the character ROM 11 is accessed based on the address of the character of the sprite 1 indicated by the attribute data, and the character of the sprite 1 is read (step SA4). The read character is stored in the FIFO 12.

次に、コントローラ17は、解凍エンジン13へ解凍指示を出力し、次いで、描画エンジン18へスプライト1の属性データを出力して描画を指示する(ステップSA5)。描画エンジン18は、解凍エンジン13によって解凍され、スプライトバッファA,Bに書き込まれたRGBカラーデータに対し、属性データが指示する拡大、縮小、回転等のレンダリング処理を行った後、属性データに含まれる表示位置データに基づいてフレームバッファ19の描画バンクに書き込む。この書込が終了した時点で、コントローラ17はレジスタSPNO内のデータが「N」であるか否かをチェックし(ステップSA6)、「N」でなかった場合は、レジスタSPNO内のデータに「1」を加算して(ステップSA7)、ステップSA3の処理へ戻る。   Next, the controller 17 outputs a decompression instruction to the decompression engine 13, and then outputs the attribute data of the sprite 1 to the rendering engine 18 to instruct rendering (step SA5). The rendering engine 18 renders the RGB color data decompressed by the decompression engine 13 and written in the sprite buffers A and B, and performs rendering processing such as enlargement, reduction, and rotation indicated by the attribute data, and then is included in the attribute data. Based on the displayed display position data, the data is written into the drawing bank of the frame buffer 19. When the writing is completed, the controller 17 checks whether or not the data in the register SPNO is “N” (step SA6). If not, the data in the register SPNO is “ 1 "is added (step SA7), and the process returns to step SA3.

以後、上記と同様の過程によってスプライト2〜スプライトNの描画処理が行われる。なお、上述した描画処理の概要は従来の描画装置と同様である。
次に、この実施形態独特の処理であって、描画エンジン18において行われるスプライト回転処理について詳述する。
この実施形態においては、スプライトの回転処理において、従来のようにホストCPU側でsin、cosの演算を行わず、予め用意した回転結果テーブル20内のデータを使用して処理する。
Thereafter, the drawing process for sprites 2 to N is performed by the same process as described above. The outline of the drawing process described above is the same as that of a conventional drawing apparatus.
Next, a sprite rotation process performed in the drawing engine 18 that is unique to this embodiment will be described in detail.
In this embodiment, in the sprite rotation process, the host CPU does not calculate sin and cos as in the prior art, but uses the data in the rotation result table 20 prepared in advance.

すなわち、この実施形態においては、図3に示すように、回転の単位を1回転の8分割または4分割の2種類とする。そして、回転結果テーブル20内に、予め、8分割テーブルとして、sin45°、sin90°、・・・sin315°、cos45°、cos90°、・・・cos315°を計算して記憶させておき、また、4分割テーブルとして、sin90°、sin180°、sin270°、cos90°、cos180°、cos270°の値を記憶させておく。
一方、スプライト属性テーブルには、図4に示すように、回転制御データとして、
回転フラグ
テーブル種類(8分割/4分割)
切替周期
回転中心
という4データを記憶させておく。
That is, in this embodiment, as shown in FIG. 3, the unit of rotation is two types of eight divisions or four divisions of one rotation. Then, sin 45 °, sin 90 °,..., Sin 315 °, cos 45 °, cos 90 °,... Cos 315 ° are calculated and stored in advance in the rotation result table 20 as an 8-part table. The values of sin 90 °, sin 180 °, sin 270 °, cos 90 °, cos 180 °, and cos 270 ° are stored as a 4-partition table.
On the other hand, in the sprite attribute table, as shown in FIG.
Rotation flag Table type (8 divisions / 4 divisions)
4 cycles of rotation period are stored.

なお、従来は回転制御データとして、sinθ、cosθ、回転中心がスプライト属性テーブルに記憶され、また、ホストCPUは各スプライト毎にsinθ、cosθを計算して属性テーブルに書き込んでいた。
さて、描画エンジン18は、回転フラグが”1”であるスプライトについて、上記の回転制御データに基づいて以下に説明する処理によってスプライトを回転させ、フレームバッファ19に描画する。図5は表示例を示す図であり、Δtはフレーム間隔を示している。図において(A)は8分割による表示例であり、2フレーム毎に画像を切り換えるようになっている(切替周期=2)。(B)も同様に8分割による表示例であり、1フレーム毎に画像を切り換えるようになっている(切替周期=1)。(C)は4分割による表示例であり、1フレーム毎に画像を切り換えるようになっている(切替周期=1)。このような表示においては、(A)のスプライトが最も遅く回転し、(B)のスプライトが中間の早さで回転し、(C)のスプライトが最も早く回転する。
Conventionally, as the rotation control data, sin θ, cos θ, and the rotation center are stored in the sprite attribute table, and the host CPU calculates sin θ and cos θ for each sprite and writes them in the attribute table.
Now, the drawing engine 18 rotates the sprite for the sprite having the rotation flag “1” by the processing described below based on the rotation control data, and draws the sprite in the frame buffer 19. FIG. 5 is a diagram showing a display example, and Δt indicates a frame interval. In the figure, (A) is a display example by eight divisions, and the image is switched every two frames (switching cycle = 2). Similarly, (B) is a display example by 8 divisions, and an image is switched every frame (switching cycle = 1). (C) is a display example by four divisions, and the image is switched every frame (switching cycle = 1). In such a display, the sprite (A) rotates the slowest, the sprite (B) rotates at an intermediate speed, and the sprite (C) rotates the fastest.

次に、図6に示すフローチャートを参照し、描画エンジン18における上述した回転処理の過程を説明する。
描画エンジン18は、まず、コントローラ17から供給されたスプライト属性テーブルの回転フラグをチェックする。そして、そのスプライトの回転フラグが初めて”1”になった場合は回転スタートと判断し(ステップSB1)、内部のレジスタCNT(図示略)に「0」を書き込む(ステップSB2)。次に、スプライト属性データのテーブル種類をチェックし(ステップSB5)、8分割が指定されていた場合はステップSB6へ、4分割が指定されていた場合はステップSB7へ進む。
ステップSB6では、
INT(CNT/切替周期)
但し、INT( ):かっこ内の演算結果の小数部をカットした値
CNT:レジスタCNTのデータ
切替周期:スプライト属性テーブルに記憶されたデータ
なる演算が行われ、次いで、演算結果に基づいて回転結果テーブル20の8分割テーブルからsinθおよびcosθの値が読み出される。例えば、CNT=3で切替周期=2の場合、INT=1となり、sin45°およびcos45°の値が回転結果テーブル20から読み出される。同様に、INT=2の場合はsin90°およびcos90°の値が回転結果テーブル20から読み出され、INT=7の場合はsin315°およびcos315°の値が回転結果テーブル20から読み出される。
Next, the process of the rotation process described above in the drawing engine 18 will be described with reference to the flowchart shown in FIG.
The drawing engine 18 first checks the rotation flag in the sprite attribute table supplied from the controller 17. When the sprite rotation flag becomes “1” for the first time, it is determined that rotation has started (step SB1), and “0” is written in an internal register CNT (not shown) (step SB2). Next, the table type of the sprite attribute data is checked (step SB5). If 8-division is designated, the process proceeds to step SB6. If 4-division is designated, the process proceeds to step SB7.
In step SB6,
INT (CNT / switching cycle)
INT (): Value obtained by cutting off the decimal part of the calculation result in parentheses
CNT: Data in register CNT
Switching period: The calculation of the data stored in the sprite attribute table is performed, and then the values of sin θ and cos θ are read from the 8-part table of the rotation result table 20 based on the calculation result. For example, when CNT = 3 and the switching cycle = 2, INT = 1, and values of sin 45 ° and cos 45 ° are read from the rotation result table 20. Similarly, when INT = 2, values of sin 90 ° and cos 90 ° are read from the rotation result table 20, and when INT = 7, values of sin 315 ° and cos 315 ° are read from the rotation result table 20.

同様に、ステップSB7においても、上記の演算が行われ、次いで、演算結果に基づいて回転結果テーブル20の4分割テーブルからsinθおよびcosθの値が読み出される。例えば、CNT=3で切替周期=2の場合、sin90°およびcos90°の値が回転結果テーブル20から読み出される。
次に、ステップSB8へ進むと、上述したsinθおよびcosθの値およびスプライト属性テーブルから読み出された回転中心の座標(Rx,Ry)に基づいて、前述した[数1]の演算が行われて回転後のピクセルの座標(X’,Y’)が求められ、次に、ステップSB9において、求められた座標(X’,Y’)に従ってRGBカラーデータがフレームバッファ19の描画用バンクに書き込まれる。
なお、(X,Y)については、スプライト属性データとしてのスプライトの表示座標を示すデータ(左上ピクセルの座標)に基づき、求められる。
上述したステップSB8、SB9の処理はスプライトを構成する全ピクセルについて行われる。
Similarly, in step SB7, the above calculation is performed, and then the values of sin θ and cos θ are read from the four-division table of the rotation result table 20 based on the calculation result. For example, when CNT = 3 and the switching cycle = 2, values of sin 90 ° and cos 90 ° are read from the rotation result table 20.
Next, when proceeding to step SB8, based on the values of sin θ and cos θ described above and the coordinates (Rx, Ry) of the rotation center read from the sprite attribute table, the above-described calculation of [Equation 1] is performed. The coordinates (X ′, Y ′) of the rotated pixel are obtained, and then, in step SB9, the RGB color data is written into the drawing bank of the frame buffer 19 in accordance with the obtained coordinates (X ′, Y ′). .
Note that (X, Y) is obtained based on data indicating the display coordinates of the sprite as the sprite attribute data (the coordinates of the upper left pixel).
The processes in steps SB8 and SB9 described above are performed for all pixels constituting the sprite.

次のフレームの描画処理において、再び、上述したステップSB1へ進み、スプライトが回転スタートでない場合はステップSB3へ進む。ステップSB3では、回転フラグが”1”であるか否かがチェックされ、”0”であった時は回転処理を終了する。一方、”1”であった場合は、レジスタCNT内のデータに「1」を加える(ステップSB4)。そして、上述したステップSB5以降の処理へ進む。   In the drawing process for the next frame, the process proceeds again to step SB1 described above. If the sprite is not started to rotate, the process proceeds to step SB3. In step SB3, it is checked whether or not the rotation flag is “1”. If the rotation flag is “0”, the rotation process is terminated. On the other hand, if “1”, “1” is added to the data in the register CNT (step SB4). And it progresses to the process after step SB5 mentioned above.

以上、図面を参照して本発明の実施形態について詳述してきたが、具体的な構成はこれらの実施の形態に限られるものではなく、この発明の要旨を逸脱しない範囲の設計変更等も含まれる。例えば、本実施の形態では回転結果テーブルは360度を4等分および8等分したものを挙げたが、もっと細かく分割してもよい。   As described above, the embodiments of the present invention have been described in detail with reference to the drawings, but the specific configuration is not limited to these embodiments, and includes design changes and the like within a scope not departing from the gist of the present invention. It is. For example, in the present embodiment, the rotation result table is obtained by dividing 360 degrees into four equal parts and eight equal parts, but it may be divided more finely.

この発明の一実施形態による画像描画装置の構成を示すブロック図であるである。It is a block diagram which shows the structure of the image drawing apparatus by one Embodiment of this invention. 同実施形態の概略動作を示すフローチャートである。It is a flowchart which shows schematic operation | movement of the embodiment. 同実施形態における回転処理を説明するための図である。It is a figure for demonstrating the rotation process in the embodiment. 同実施形態におけるスプライト属性テーブル23の構造図である。It is a structural diagram of the sprite attribute table 23 in the same embodiment. 同実施形態における回転処理の一例を示す図である。It is a figure which shows an example of the rotation process in the embodiment. 同実施形態における回転処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the rotation process in the embodiment.

符号の説明Explanation of symbols

11…キャラクタROM、12…FIFOメモリ、13…解凍エンジン、14…スプライトカラーパレット、15…フリップフロップ、16…スプライトYUVデコーダ、17…コントローラ、18…描画エンジン、19…フレームバッファ、20…回転結果テーブル、21…CPUインタフェースブロック、22…SRAMインタフェースブロック、23…スプライト属性テーブル、24…ディスプレイインタフェースブロック
DESCRIPTION OF SYMBOLS 11 ... Character ROM, 12 ... FIFO memory, 13 ... Decompression engine, 14 ... Sprite color palette, 15 ... Flip flop, 16 ... Sprite YUV decoder, 17 ... Controller, 18 ... Drawing engine, 19 ... Frame buffer, 20 ... Rotation result Table, 21 ... CPU interface block, 22 ... SRAM interface block, 23 ... Sprite attribute table, 24 ... Display interface block

Claims (6)

表示対象物を回転させたときの各ピクセルの表示位置の座標を、属性データに基づいて求め、求めた座標にしたがって回転後のピクセルをメモリに描画する画像描画方法において、
予め設定した回転角θについてsin nθ(nは正の整数)およびcos nθの値を回転角テーブルとしてメモリに記憶させておき、
回転開始時点の回転角を0とし、以後、表示フレーム毎に回転角をθ、2θ、3θ、・・・として前記ピクセルを回転させた場合の回転後のピクセルの座標を、前記属性データに含まれる回転中心座標および前記メモリ内のデータを使用して演算し、
該演算結果に基づいてピクセルをメモリに描画することを特徴とする画像描画方法。
In the image drawing method of obtaining the coordinates of the display position of each pixel when the display object is rotated based on the attribute data, and drawing the rotated pixel in the memory according to the obtained coordinates.
The values of sin nθ (n is a positive integer) and cos nθ are stored in a memory as a rotation angle table for a preset rotation angle θ.
The attribute data includes the coordinates of the pixel after rotation when the rotation angle is set to 0 for each display frame and the pixel is rotated for each display frame. Calculated using the rotation center coordinates and the data in the memory,
An image drawing method, wherein a pixel is drawn in a memory based on the calculation result.
予め前記回転角テーブルを複数種類設け、前記属性データにテーブル種類を指示するテーブル種類データを設定し、前記テーブル種類データが指示する回転角テーブルを使用して回転後のピクセルの座標を演算することを特徴とする請求項1に記載の画像描画方法。   A plurality of types of rotation angle tables are provided in advance, table type data indicating the table type is set in the attribute data, and the coordinates of the rotated pixel are calculated using the rotation angle table specified by the table type data. The image drawing method according to claim 1. 前記属性データに切替周期を設定し、前記表示フレームが前記切替周期の数だけ表示される毎に回転後のピクセルの座標を求める演算を実行し、演算結果に基づいて回転後のピクセルをメモリに描画することを特徴とする請求項1または請求項2に記載の画像描画方法。   A switching period is set in the attribute data, and a calculation for obtaining the coordinates of the rotated pixel is executed every time the display frame is displayed by the number of the switching periods, and the rotated pixel is stored in the memory based on the calculation result. The image drawing method according to claim 1, wherein drawing is performed. 表示対象物を回転させたときの各ピクセルの表示位置の座標を、属性データに基づいて求め、求めた座標にしたがって回転後のピクセルをメモリに描画する画像描画装置において、
予め設定された回転角θについてsin nθ(nは正の整数)およびcos nθの値を記憶する回転角テーブルと、
回転開始時点の回転角を0とし、以後、表示フレーム毎に回転角をθ、2θ、3θ、・・・として前記ピクセルを回転させた場合の回転後のピクセルの座標を、前記属性データに含まれる回転中心座標および前記回転角テーブル内のデータを使用して演算する演算手段と、
前記演算手段の演算結果に基づいてピクセルをメモリに描画する書込手段と、
を具備することを特徴とする画像描画装置。
In the image drawing device for obtaining the coordinates of the display position of each pixel when the display object is rotated based on the attribute data, and drawing the rotated pixel in the memory according to the obtained coordinate.
A rotation angle table for storing values of sin nθ (n is a positive integer) and cos nθ for a preset rotation angle θ;
The attribute data includes the coordinates of the pixel after rotation when the rotation angle is set to 0 for each display frame and the pixel is rotated for each display frame. Calculation means for calculating using the rotation center coordinates and data in the rotation angle table;
Writing means for drawing a pixel in a memory based on a calculation result of the calculation means;
An image drawing apparatus comprising:
前記回転角テーブルを複数種類具備し、前記演算手段は、前記属性データに含まれるテーブル種類を示すテーブル種類データが指示する回転角テーブルを使用して回転後のピクセルの座標を演算することを特徴とする請求項4に記載の画像描画装置。   A plurality of types of rotation angle tables are provided, and the calculation means calculates the coordinates of the rotated pixel using the rotation angle table indicated by the table type data indicating the table type included in the attribute data. The image drawing apparatus according to claim 4. 前記属性データが切替周期を含み、前記演算手段は、前記表示フレームが前記切替周期の数だけ表示される毎に回転後のピクセルの座標を求める演算を実行することを特徴とする請求項4または請求項5に記載の画像描画装置。

5. The attribute data includes a switching cycle, and the calculation means executes a calculation for obtaining coordinates of a pixel after rotation every time the display frame is displayed by the number of the switching cycles. The image drawing apparatus according to claim 5.

JP2003331741A 2003-09-24 2003-09-24 Image drawing method and image drawing system Pending JP2005099313A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003331741A JP2005099313A (en) 2003-09-24 2003-09-24 Image drawing method and image drawing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003331741A JP2005099313A (en) 2003-09-24 2003-09-24 Image drawing method and image drawing system

Publications (1)

Publication Number Publication Date
JP2005099313A true JP2005099313A (en) 2005-04-14

Family

ID=34460315

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003331741A Pending JP2005099313A (en) 2003-09-24 2003-09-24 Image drawing method and image drawing system

Country Status (1)

Country Link
JP (1) JP2005099313A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009129403A (en) * 2007-11-28 2009-06-11 Yamaha Corp Image processor and program
KR20170045201A (en) 2014-08-28 2017-04-26 이데미쓰 고산 가부시키가이샤 Organic electroluminescence element and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009129403A (en) * 2007-11-28 2009-06-11 Yamaha Corp Image processor and program
KR20170045201A (en) 2014-08-28 2017-04-26 이데미쓰 고산 가부시키가이샤 Organic electroluminescence element and electronic device

Similar Documents

Publication Publication Date Title
JP2637920B2 (en) Computer graphic system and method of using frame buffer
JP5091220B2 (en) Method and apparatus for encoding texture information
JP4707782B2 (en) Image processing apparatus and method
JP2005077522A (en) Image processor and image processing method
JP2003091737A (en) Plotting processor, recording medium with plotting processing program recorded thereon, plotting processing program and plotting processing method
JP4505866B2 (en) Image processing apparatus and video signal processing method
JP2005099313A (en) Image drawing method and image drawing system
JP2012032456A (en) Image processing apparatus
JP2002140063A (en) Graphics drawing device
JP2003051023A (en) Device, method and program for plotting and computer readable recording medium with the same program recorded
JPH08146941A (en) Image display device
JP2005346605A (en) Antialias drawing method and drawing apparatus using the same
JP3910259B2 (en) Image processing apparatus and method, and rendering apparatus and method
JP3741053B2 (en) Image processing device
JP2005128689A (en) Image drawing device
JP2002312807A (en) Image display device for game machine
JP4466234B2 (en) Image processing method and apparatus
JP4760390B2 (en) Image processing device
JPH1063254A (en) Three dimensional graphics accelerator card, and computer system using the card
JP3324580B2 (en) Image processing device
EP0838786A1 (en) Method of producing polygon data, image processor to which the method is applied, and expanded function board
JP2015219351A (en) Image processor
JP2000014932A (en) Method for displaying game image and game device using the same
JP2014035453A (en) Image processor
JP2005234767A (en) Image processor