JP3760341B2 - Program, recording medium, image generation apparatus, and image generation method - Google Patents
Program, recording medium, image generation apparatus, and image generation method Download PDFInfo
- Publication number
- JP3760341B2 JP3760341B2 JP2001334010A JP2001334010A JP3760341B2 JP 3760341 B2 JP3760341 B2 JP 3760341B2 JP 2001334010 A JP2001334010 A JP 2001334010A JP 2001334010 A JP2001334010 A JP 2001334010A JP 3760341 B2 JP3760341 B2 JP 3760341B2
- Authority
- JP
- Japan
- Prior art keywords
- character
- dimensional
- drawn
- virtual camera
- data
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims description 58
- 239000013598 vector Substances 0.000 claims description 58
- 238000009877 rendering Methods 0.000 claims description 48
- 230000033001 locomotion Effects 0.000 claims description 43
- 230000008859 change Effects 0.000 claims description 40
- 230000000007 visual effect Effects 0.000 claims description 30
- 230000004044 response Effects 0.000 claims description 7
- 238000012545 processing Methods 0.000 description 82
- 230000008569 process Effects 0.000 description 33
- 238000010586 diagram Methods 0.000 description 7
- 238000012546 transfer Methods 0.000 description 6
- 230000009466 transformation Effects 0.000 description 6
- 238000005070 sampling Methods 0.000 description 5
- 241000283086 Equidae Species 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000015572 biosynthetic process Effects 0.000 description 3
- 239000002131 composite material Substances 0.000 description 3
- 239000000203 mixture Substances 0.000 description 3
- 238000003786 synthesis reaction Methods 0.000 description 3
- 230000002194 synthesizing effect Effects 0.000 description 3
- 206010034719 Personality change Diseases 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000004040 coloring Methods 0.000 description 1
- 230000008602 contraction Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000006837 decompression Effects 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000010008 shearing Methods 0.000 description 1
Images
Landscapes
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Description
【0001】
【発明の属する技術分野】
本発明はプログラム、記録媒体、画像生成装置及び画像生成方法に係り、特に、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成するプログラム、該プログラムを記録した記録媒体、該画像生成装置及び該画像生成方法に関する。
【0002】
【従来の技術】
今日、各社から販売されているビデオゲームは、ゲーム装置本体(コンピュータ)の高速化等と相俟って、一般に表示装置のディスプレイ上にリアルな3次元(以下、3Dと略称する。)キャラクタを表示するものが多い。3Dポリゴンデータでキャラクタ(以下、3Dキャラクタという。)を表示するには、立体的な単一の3Dモデルをオブジェクト空間内に配置し、3D座標変換を行って仮想カメラ(視点)から見える画像を自動生成することにより行われる(3D画像処理)。3Dポリゴンデータは、頂点座標、頂点テクスチャ座標、法線ベクトル等のデータで構成されている。一度、1つの3Dモデルを用意してしまえば、仮想カメラで様々の方向からこの3Dモデルを見た場合にも矛盾のない画像を生成することができる。このような3D画像処理に関する技術は、例えば、昭和61年5月20日に株式会社昭晃堂から発行された、中前栄八郎、西田友是著「3次元コンピュータグラフィックス」(ISBN4−7856−3064−7)や平成4年7月15日に株式会社昭晃堂から発行された、安居院猛、中嶋正之著「コンピュータグラフィクス」(ISBN4−7856−2075−7)等に詳しい。
【0003】
一方、ビデオゲームに登場する全てのキャラクタを3Dで描画しようとすると、3Dキャラクタ描画のための演算量が膨大となりゲーム展開に必要な演算量が圧迫される。この問題を解決するために、例えば、特開平11−203504号公報には、ゲーム場面に応じて、ディスプレイ上に表示されるキャラクタをゲーム構成上比較的重要度の高いゲームキャラクタと比較的重要度の低いサポーティングキャラクタとに分け、ゲームキャラクタについては3D画像処理を行い、サポーティングキャラクタについては主として2次元(以下、2Dと略称する。)画像処理を行う技術が開示されている。従って、3D画像処理によるキャラクタと2D画像処理によるキャラクタ(以下、2Dキャラクタという。)とを3D仮想空間上に混在・表示させる技術は既に存在している。
【0004】
なお、本発明に関連する技術として、特開2001−084402号公報には、1のキャラクタを表示するためにそのキャラクタに対応した画像データを複数持ち、その複数の画像データの中間画像を補完処理により求めて表示する技術が開示されている。また、特開2001−70634号公報には、3D仮想空間上に配した各3Dキャラクタに対して、輪郭線又は稜線を付加する強調処理と色づけ処理を施したデータを2D画像としてディスプレイに動画表示する技術が開示されている。更に、特開2001−056870号公報には多数キャラクタについて集団で移動させる技術が、特開2001−149655号公報には多数のキャラクタについて索敵、戦闘等を行わせる技術がそれぞれ開示されている。
【0005】
【発明が解決しようとする課題】
しかしながら、上述した特開平11−203504号公報では、キャラクタの一部を2D画像処理を行うことで3D画像処理の演算量を大幅に軽減することができるものの、3Dキャラクタと2Dキャラクタとの混在による違和感を惹起する、という問題がある。この傾向はディスプレイ上に表示されるキャラクタ数、換言すれば、ゲームに登場するキャラクタ数が多くなるにつれて著しく強調される。すなわち、ゲームに登場する多数(例えば、100以上)のキャラクタの動的変化に対応するには、3D画像処理の演算量を軽減する必要があるが、3Dキャラクタと2Dキャラクタとが混在する3D仮想空間において両者の整合性を図らなければ強い違和感のある画像となる。
【0006】
この違和感を解消するには、以下の3点を解決する必要がある。(1)ゲーム中に視点となる仮想カメラは近傍から遠方まで自由に移動可能である。従って、2Dキャラクタと3Dキャラクタとが切り替わる境界があり、単純な切り替えではディスプレイ上での両者の表示が不連続性となり強い違和感を招く。なお、仮想カメラはキャラクタを全天周どの位置からも観察できるため、単純な(例えば、単に8方向程度の)2Dスプライトでは視点の変化に対応できない。(2)ゲーム中に3Dキャラクタはキャラクタ自体の向きも動的に変化するので、2Dキャラクタの動きも3Dキャラクタと同様に動的に表現しなければ均衡がとれず、特に両者の切り換え時に極端な違和感を生ずる。更に、(3)3Dキャラクタにはキャラクタ自身の陰影変化が発生するので、2Dキャラクタにも同等の処理を行わないと違和感を生ずる。
【0007】
本発明は上記事案に鑑み、多数の3Dキャラクタ、2Dキャラクタが違和感なく混在可能なプログラム、該プログラムを記録した記録媒体、画像生成装置及び画像生成方法を提供することを課題とする。
【0010】
【課題を解決するための手段】
上記課題を解決するために、本発明の第1の態様は、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成するプログラムであって、コンピュータを、仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段、前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段、として機能させ、前記全天周多数方向は、前記幅の変化量の大きい方向間が前記幅の変化量の小さい方向間に比べて細かく区分されていることを特徴とする。
【0011】
本態様では、決定手段が、仮想カメラの位置及び方向情報とオブジェクトキャラクタの位置情報とに基づいて、仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを3次元ポリゴンデータで描画される3次元キャラクタで、仮想カメラの視界内かつ所定距離の外に位置するか又は所定数を越えるオブジェクトキャラクタを2次元スプライトデータで描画される2次元キャラクタと決定する。そして、描画手段が、3次元仮想空間上のオブジェクトキャラクタの位置に、オブジェクトキャラクタの位置と仮想カメラの位置とを結ぶ方向と、オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、3次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元キャラクタを描画し、2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して仮想カメラから相対角度でオブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを相対角度の垂直成分方向がなす角度に応じてせん断変形して2次元キャラクタを描画し、3次元キャラクタと2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成するが、全天周多数方向は、幅の変化量の大きい方向間が幅の変化量の小さい方向間に比べて細かく区分されている。
【0012】
第1の態様によれば、仮想カメラから所定距離内に位置するオブジェクトキャラクタ、すなわち、仮想カメラに近いオブジェクトキャラクタについて3次元キャラクタで描画し、仮想カメラから所定距離の外に位置するオブジェクトキャラクタ、すなわち、仮想カメラから遠方のオブジェクトキャラクタについて2次元キャラクタで描画するので、3次元キャラクタ及び2次元キャラクタが混在する画像の違和感を緩和することができると共に、所定距離内、所定数内のオブジェクトキャラクタについてのみ3次元キャラクタで描画するので、3次元画像処理の演算量を軽減することができ、また、2次元キャラクタについて、オブジェクトキャラクタの位置と仮想カメラの位置とを結ぶ方向と、オブジェクトキャラクタの正面方向とがなす相対角度の水平方向成分角度から予め用意された全天周多数方向のうち最も近い2つの2次元スプライトデータを選択して該相対角度でオブジェクトキャラクタをみたときの幅となるように合成し、該相対角度の垂直方向成分角度に応じて合成した2次元スプライトデータをせん断変形するようにしたので、仮想カメラから遠方の2次元キャラクタを見たときに水平及び垂直方向に適正な幅、高さが反映され、3次元キャラクタ及び2次元キャラクタが混在する画像の違和感を低減させることができ、更に、全天周多数方向について、幅の変化量の大きい方向間を幅の変化量の小さい方向間に比べて細かく区分したので、細長い(奥行きのある)2Dスプライトを合成しても適正な合成画像を得ることができる。
【0013】
本態様において、描画手段が2つの2次元スプライトデータの一方を半透明にして合成すれば、仮想カメラから遠方の2次元キャラクタを見たときに水平方向に違和感のない適正な幅を反映することができる。また、全天周多数方向の各象限における方向間の角度が異なるようにすれば、細長い(奥行きのある)オブジェクトキャラクタについても適正な2次元キャラクタを描画することができる。描画手段は、オブジェクトキャラクタの正面方向ベクトルを、該オブジェクトキャラクタの位置と仮想カメラの位置とを結ぶベクトルを垂線とする仮想平面に投影したときの方向ベクトルと、仮想平面での水平方向とのなす角度の正接値を求め、該求めた正接値に基づいて合成された2次元スプライトデータを垂直方向にせん断変形して行うようにしてもよい。更に、予め用意された全天周多数方向の2次元スプライトデータを、3次元キャラクタがとり得る複数のモーションに対応するように複数のアニメーションデータとして準備してもよく、この場合に、準備されるべきアニメーションデータのうち動的変化の少ないフレームに対応する2次元スプライトデータを省くことが望ましい。
【0014】
また、本発明の第2の態様は、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成するプログラムであって、コンピュータを、仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段、前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段、として機能させ、前記予め用意された全天周多数方向の2次元スプライトデータは、手足又は足を有する前記3次元キャラクタがとり得る複数のモーションに対応するように複数のアニメーションデータとして準備されており、前記アニメーションデータのうち動的変化の少ないフレームに対応する2次元スプライトデータが省かれたことを特徴とする。第2の態様によれば、仮想カメラから所定距離内に位置するオブジェクトキャラクタについて3次元キャラクタで描画し、仮想カメラから所定距離の外に位置するオブジェクトキャラクタについて2次元キャラクタで描画するので、3次元キャラクタ及び2次元キャラクタが混在する画像の違和感を緩和することができると共に、所定距離内、所定数内のオブジェクトキャラクタについてのみ3次元キャラクタで描画するので、3次元画像処理の演算量を軽減することができ、また、予め用意された全天周多数方向の2次元スプライトデータを、手足又は足を有する3次元キャラクタがとり得る複数のモーションに対応するように複数のアニメーションデータとして準備されているため、オブジェクトキャラクタの描画が3次元キャラクタから2次元キャラクタに又はその逆に切り換えられても、切り換えの瞬間における両者間の姿勢、方向等の不一致・不連続性を解消することができ、3次元キャラクタ及び2次元キャラクタが混在する動的画像の違和感をなくすことができ、更に、準備されるべきアニメーションデータのうち動的変化の少ないフレームに対応する2次元スプライトデータを省くため、2次元スプライトデータのための記憶容量を軽減することができる。
更に、本発明の第3の態様は、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成するプログラムであって、コンピュータを、仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段、前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータ を選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段、として機能させ、前記2次元スプライトデータは、前記3次元ポリゴンデータに対応するように頂点座標及びシェーディング用の疑似法線ベクトルを予め含むことを特徴とする。第3の態様によれば、仮想カメラから所定距離内に位置するオブジェクトキャラクタについて3次元キャラクタで描画し、仮想カメラから所定距離の外に位置するオブジェクトキャラクタについて2次元キャラクタで描画するので、3次元キャラクタ及び2次元キャラクタが混在する画像の違和感を緩和することができると共に、所定距離内、所定数内のオブジェクトキャラクタについてのみ3次元キャラクタで描画するので、3次元画像処理の演算量を軽減することができ、また、2次元スプライトデータに、3次元ポリゴンデータに対応するように頂点座標及びシェーディング用の疑似法線ベクトルを予め含むようにしたので、2次元スプライトの頂点の疑似法線ベクトルによりシェーディング(陰影処理)を行うことが可能となり、2次元キャラクタを3次元キャラクタらしく見せることができる。このとき、疑似法線ベクトルの方向について、対応する3次元ポリゴンデータを構成する頂点の法線ベクトルの方向を維持するようにすれば、2次元キャラクタの頂点のシェーディングが3次元キャラクタと同様に処理され、2次元キャラクタに応じて法線ベクトルの方向を修正することで2次元キャラクタをより3次元キャラクタらしく見せることが可能となる。
本発明の第4の態様は、上述した第1〜第3の態様のプログラムを記録したコンピュータ読取可能な記録媒体である。また、本発明の第5の態様は、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成する画像生成装置であり、仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段と、前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段と、を備え、前記全天周多数方向は、前記幅の変化量の大きい方向間が前記幅の変化量の小さい方向間に比べて細かく区分されていることを特徴とし、本発明の第6の態様は、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成する画像生成装置において、仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段と、前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェク トキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段と、を備え、前記予め用意された全天周多数方向の2次元スプライトデータは、手足又は足を有する前記3次元キャラクタがとり得る複数のモーションに対応するように複数のアニメーションデータとして準備されており、前記アニメーションデータのうち動的変化の少ないフレームに対応する2次元スプライトデータが省かれたことを特徴とし、本発明の第7の態様は、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成する画像生成装置において、仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段と、前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段と、を備え、前記2次元スプライトデータは、前記3次元ポリゴンデータに対応するように頂点座標及びシェーディング用の疑似法線ベクトルを予め含むことを特徴とする。そして、本発明の第8の態様は、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成する画像生成方法であって、仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定し、前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する、ステップを含み、前記全天周多数方向は、前記幅の変化量の大きい方向間が前記幅の変化量の小さい方向間に比べて細かく区分されていることを特徴とし、本発明の第9の態様は、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成する画像生成方法であって、仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて 、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定し、前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する、ステップを含み、前記予め用意された全天周多数方向の2次元スプライトデータは、手足又は足を有する前記3次元キャラクタがとり得る複数のモーションに対応するように複数のアニメーションデータとして準備されており、前記アニメーションデータのうち動的変化の少ないフレームに対応する2次元スプライトデータが省かれたことを特徴とし、本発明の第10の態様は、3次元仮想空間上に3次元ポリゴンデータで描画される3次元キャラクタと2次元スプライトデータで描画される2次元キャラクタとの多数のオブジェクトキャラクタを混在させた画像を生成する画像生成方法であって、仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定し、前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する、ステップを含み、前記2次元スプライトデータは、前記3次元ポリゴンデータに対応するように頂点座標及びシェーディング用の疑似法線ベクトルを予め含むことを特徴とする。
【0015】
【発明の実施の形態】
以下、図面を参照して本発明を家庭用ビデオゲーム装置に適用した実施の形態について説明する。
【0016】
(構成)
図1に示すように、本実施形態の家庭用ビデオゲーム装置10は、ゲーム装置本体2に、スピーカ5を内蔵したテレビモニタ4及びコントローラパッド等の入力装置3が接続されている。ゲーム装置本体2は、CD−ROM等の記録媒体1を装着可能な媒体読取部(図3参照)を有している。この媒体読取部に記録媒体を装着することにより記録媒体1に記録されたゲームプログラムやゲームデータが自動的にゲーム装置本体2内の記憶メモリにロードされる。
【0017】
図2(A)(B)に示すように、入力装置3には、集団戦闘ゲーム等のビデオゲームを開始するためのスタートボタン30やゲームキャラクタを操作したり、ゲーム装置本体2からの選択問い合わせに応答するための□ボタン31、△ボタン32、○ボタン33、×ボタン34で構成されるボタンセット、及び、↑ボタン35、→ボタン36、←ボタン37、↓ボタン38で構成される十字方向ボタン等の種々のボタンが配置されている。また、ボタンセット及び十字方向ボタンの斜め下側(プレイヤの手前側)には、左アナログスティック39、右アナログスティック40が配置されている。
【0018】
図3に示すように、ゲーム装置本体2は装置全体の制御を行う、決定手段及び描画手段の一部としてのCPUブロック20を備えている。CPUブロック20は、ゲーム装置本体2内の各部とのデータ転送を主に制御するSCU(System Control Unit)、中央演算処理装置として高速クロックで作動するCPU、ゲーム装置本体2の基本制御動作が記憶されたROM、CPUのワークエリアとして働くと共に記録媒体1に記録されたゲームプログラム及び種々のデータを一時的に記憶するRAM及びこれらを接続する内部バスで構成されている。
【0019】
SCUには外部バス25が接続されている。外部バス25は、入力装置3からの入力を受信してCPUブロック20へ入力情報を転送する入力受信部21、図示しないサブCPUを備え記録媒体1に記録されたゲームプログラムを読み取りCPUブロック20へ転送するCD−ROMドライブ等の媒体読取部22、図示しないサブCPU及びVRAMを備えCPUブロック20から転送された情報に従って画像を描画する描画手段の一部としての画像処理部23、及び、図示しないサブCPUを備え、例えば、バックミュージックやキャラクタの戦闘音等の音響を処理する音響処理部24、に接続されている。また、入力受信部21は入力装置3に、画像処理部23はテレビモニタ4に、音響処理部24はテレビモニタ4に内蔵されたスピーカ5にそれぞれ接続されている。なお、画像処理部23は、座標変換、透視変換、光源演算、曲面生成等のジオメトリ処理を行うジオメトリ処理部、座標変換等のマトリクス演算を高速並行処理する演算部、圧縮された画像データを伸張する伸張部、1フレーム分の画像表示のためのフレームバッファへのレンダリング(描画)処理を高速に実行するレンダリング部等を含んで構成されている。
【0020】
(動作)
次に、フローチャートを参照して、本実施形態の家庭用ビデオゲーム装置10の動作について、プレイヤ側に属する250体のキャラクタとコンピュータ(CPUブロック20)側に属する250体のキャラクタとがそれぞれ敵味方に分かれて戦闘する戦闘ゲームを想定して説明する。なお、ゲーム装置本体2には既に電源が投入されており、記録媒体1が装着されると、記録媒体1からゲームプログラム、ゲームデータを読み取って、図4に示す戦闘処理ルーチンが実行される。
【0021】
戦闘処理ルーチンでは、まず、ステップ102において、プレイヤにテレビモニタ4に表示された複数の武将のアイコンのいずれかにカーソル合わさせクリックさせることで、プレイヤが好みの武将を部隊長として選択し(コンピュータ側もランダムに部隊長を選択し)、他の敵味方のキャラクタ(騎馬兵士、兵士)をゲーム開始前の整列位置に配置してテレビモニタ4に表示する等の初期設定処理を行い、プレイヤからスタートボタン30が押下されるまで待機する(図4では図示省略)。
【0022】
スタートボタン30が押下されると、次のステップ104において、テレビモニタ4の垂直帰線周期と一致した、1/60秒(16.6ミリ秒)に一度の周期で実行される垂直帰線割込(Vsync)がなされたか否かを判断する。否定判断のときは、次のステップ106において、入力受信部21から転送された入力情報に対する処理やゲーム効果音を音響処理部24に合成させるための音響処理等のメイン処理を実行して、ステップ110へ進む。
【0023】
ここで、右アナログスティック40の操作と仮想カメラ(視点)の位置との関係について説明する。プレイヤが右アナログスティック40を傾けることにより、入力受信部21からCPUブロック20に転送される右アナログスティック40の入力情報(x,y)は0≦x≦255、0≦y≦255の値をとる。図7(A)に示すように、CPUはステップ106でのメイン処理において、仮想カメラの位置を中心O(0,0)に変換するために(x,y)から共に127を引いて(x’,y’)=(x−127,y−127)=(a,b)として、r=(a2+b2)1/2を演算し、r<48か否かの判断を行う。肯定判断のときは右アナログスティック40から入力がなかったものとして扱い(仮想カメラの位置を移動させず)、否定判断のときは、a、b共に1.5倍してRAMに格納する。
【0024】
仮想カメラの位置は、実際にはワールド座標系の座標値で演算されるが、仮にスクリーン座標系で考えた場合には、図7(B)に示すように、1Vsync毎にx方向に1.5a、y方向に1.5bだけ現在の仮想カメラの位置(中心O(0,0))からO’に移動し(k=1.5)、仮想カメラの向きもa、bで定まる方向に傾けられることとなる(スクリーン座標系もその角度で傾く。)。従って、右アナログスティック40の傾きの程度によりa、bの大きさが変化し、移動速度及び仮想カメラの傾きが変化する。具体的には、右アナログスティック40を上方向に倒すと仮想カメラ(視点)は前方に移動し、下方向に倒すと後方に、右方向に倒すと右回りに、左方向に倒すと左回りに移動し、更に、右上方向、右下方向、左上方向、左下方向に倒し続けると、右に大回り、右に小回り、左に大回り、左に小回りでそれぞれ仮想カメラ(視点)が移動する。なお、本実施形態では、a、bの単位はそれぞれ3D仮想空間上で1cmに対応しており、仮想カメラの高さ方向(z方向)の成分は一定(例えば、3D仮想空間上で3m)とされている。
【0025】
一方、ステップ104で肯定判断がなされると、ステップ108において、仮想カメラの視界内のキャラクタについて3Dキャラクタ、2Dキャラクタを混在させた画像を生成するための3D2D処理サブルーチンが実行される。
【0026】
図5に示すように、この3D2D処理サブルーチンでは、まず、ステップ122において、ステップ106でRAMに格納した(ka,kb)を読み出して、ワールド座標系で仮想カメラ(視点)の位置、方向を算出し、仮想カメラのスクリーン座標系を算出する。次のステップ124では、3D処理対象のキャラクタ数を所定数内(後述するように、50体内)とするために、カウンタCnを0とする。
【0027】
次にステップ126において、全キャラクタが処理済みか否かを判断し、否定判断のときは、ステップ128で1Vsync前にRAMに格納した対象キャラクタのワールド座標系での位置、方向を読み出して、次のステップ130において対象キャラクタの現在のワールド座標系での位置、方向を演算してRAMに格納する。このような対象キャラクタの位置、方向の演算については公知の技術を用いることができるが、本例のように100体以上の多数キャラクタを処理する場合には、例えば、上述した特開2001−056870号公報や特開2001−149655号公報の技術を用いることができる。次のステップ132では、スクリーン座標系で仮想カメラの方向と対象キャラクタの位置とから対象キャラクタが仮想カメラの視界内(例えば、3D仮想空間上で200m×200m内)に存在するか否かを判断し、否定判断のときはステップ134で対象キャラクタが仮想カメラの視界内に位置するか否かを表す視界フラグsfを0とし、肯定判断のときはステップ136で視界フラグsfを1としてステップ126へ戻る。従って、例えば、図8に示すように、複数のキャラクタで構成される部隊Fと部隊Eとが対峙し500体のキャラクタを処理する場合に、視界フラグsfが1に設定されるのは、視界S内に位置するキャラクタのみとなる。
【0028】
一方、ステップ126で肯定判断されたときは、ステップ138において、視界フラグsfが1のキャラクタについてのみ、仮想カメラの位置から各キャラクタまでの距離を演算し、仮想カメラから近い順に処理の順番を決定する。次にステップ140では、仮想カメラの視界内の(視界フラグsf=1の)全キャラクタについて処理が終了したか否かを判断し、否定判断のときは、次のステップ142において、対象キャラクタが仮想カメラの位置から50m以内に位置するか否かを判断し、肯定判断のときは次のステップ144でカウンタCnが50以下か否かを判断する。ステップ144での判断が肯定のときには、続くステップ146においてカウンタCnを1インクリメントして、次のステップ148において当該対象キャラクタを3Dキャラクタとして表示するための3D処理を行ってステップ140へ戻る。
【0029】
この3D処理では、キャラクタの位置と仮想カメラの位置とを結ぶ方向と、キャラクタの正面方向とがなす相対角度を演算して、モーションキャプチャー等を利用して得られたアニメーションのためのモーションデータを複数組予め用意しておき、キャラクタの状態(例えば、移動、戦闘等の状態)に応じてそれらのモーションデータの中から1組のモーションデータの中の何れか1つのフレームを選択する。すなわち、キャラクタは移動、戦闘等の種々の状態を採るので、CPUはキャラクタの現在の状態を表す状態フラグの値をRAMから読み出し、そのフラグ値で特定される1組のモーションデータを選択する。1組のモーションデータは、時系列的には、図10(A)に示すように、複数のフレームで構成さるため、CPUは対象キャラクタが複数のフレームのうち1Vsync前にどのフレームまで描画されているかを把握しており、現時点で描画すべきフレームを特定することができる。このようなフレームの特定については、例えば、上述した特開2001−149655の技術のようにカウンタを用いるようにしてもよい。
【0030】
ここで、キャラクタのモーションとは、画素の変位をリアルタイムに直接演算して行うのではなく、キャラクタのリアルな動きを表現するために、予め騎馬兵士、兵士、騎馬等の動きをサンプリングしたデータ数列を使用する。一般的な3Dモーションデータのデータ構造は、キャラクタの各関節について、大きさを表すスケール値、xyzの各軸に対する回転角、原点からの移動距離を示すxyz毎の座標値を持ち、これらを1組の関節データとして、1又は複数の関節データにより構成されるキャラクタ全体の関節データ群を各モーション毎にそのモーションのフレームの数だけ持つことで、モーションデータが構成される(図10(A)も参照)。ここでいうフレームとは画像処理の時間的単位で、いわゆる「コマ」のことである。なお、3Dキャラクタを表示する場合に、CPUはSCUを介してワールド座標系における対象キャラクタの位置、方向、対象キャラクタのモーション等の情報を画像処理部23に転送し、画像処理部23で対象キャラクタを3D表示するためにジオメトリ処理等の種々の処理が行われ仮想カメラから見える3Dキャラクタが生成される。
【0031】
一方、ステップ142又はステップ144で否定判断されたときは、ステップ150において、後述するように、当該対象キャラクタを2Dキャラクタとして表示するための2D処理サブルーチンを実行する。従って、ステップ122〜150では、仮想カメラの視界内のキャラクタのうち、仮想カメラから50m以内でかつ仮想カメラから近い順に50体のキャラクタについて3D処理を行い、それ以外は2D処理を行って、仮想カメラの視界外のキャラクタはこれらの処理を行わない。
【0032】
2D処理サブルーチンについて説明する前に、予め準備された(CPUブロック20を介して画像処理部23のVRAMに格納された)2Dキャラクタの画像データ(以下、2Dスプライトという。)について詳述する。本実施形態では、戦闘ゲームに登場するキャラクタについて、上述したキャラクタの状態の数に対応して複数組、当該キャラクタの3Dモデルを多数方向から見たときの2Dスプライトが準備されている。図9(A)に示すように、例えば、1組の2Dスプライトは、3Dモデルを全天周16方向(0)〜(15)(以下、これらの方向をレンダリング方向という。)から見たときの16の画像データ(例えば、ビットマップ)で構成されている。従って、画像処理部23のVRAMには、1キャラクタにつき(16×当該キャラクタがとる状態の数)の画像データが格納されることとなるが、武将を除く兵士や騎馬については共通の2Dスプライトを使用することで、VRAMに格納すべき画像データ数を少なくすることができる。
【0033】
図9(B)に示すように、キャラクタをレンダリング方向(0)(正面から見たときの方向)の幅をW1、キャラクタをレンダリング方向(4)(真横から見たときの方向)の幅をW2とし、幅W1及び幅W2のうち大きい方をWmax、小さい方をWminとすると、キャラクタの横幅増加率Exは下式(1)で求めることができ、図9(A)の第4象限(0〜90度)におけるレンダリング角度Rk(図9(A)に示したレンダリング方向(k)とレンダリング方向(0)とのなす角度)は下式(2)で求めることができる。なお、R0は0である。
【0034】
【数1】
【0035】
【数2】
【0036】
また、式(2)で得られたレンダリング角度から、他の象限(90〜360°)におけるレンダリング角度R5〜R15は下式(3)で求めることができる。
【0037】
【数3】
【0038】
図9(A)(B)に示すように、各象限におけるレンダリング角度間は一定角度ではなく異なっており、例えば、レンダリング方向(0)(1)間、(1)(2)間のキャラクタの幅は異なっている。騎馬のように細長い(奥行きのある)キャラクタの幅は、レンダリング方向(0)(3)の間で3倍以上となり、レンダリング方向(3)(4)の間では2倍に満たないので、後述する2Dスプライトの合成上、画像変化量(幅の変化量)の大きい範囲は細かくレンダリング方向を設定し、画像変化量の小さい範囲は粗くレンダリング方向を設定することが好ましい。
【0039】
また、戦闘ゲーム中に3Dキャラクタ自体の動作や向きが動的に変化するので、2Dキャラクタもこのような動的変化に対応して準備する必要がある。本実施形態では、図10(B)に示すように、図10(A)に示した3Dキャラクタのモーションに対応するように、各モーションデータに基づいて2Dアニメーションデータが準備されている。なお、図10(B)に示した2Dアニメーションデータはキャラクタ(騎馬)が移動状態の場合であり、他の状態についても同様の2Dアニメーションデータが準備されている(例えば、あるキャラクタが4種類の状態をとりうる場合には、3Dキャラクタの4種類のモーションに対応するように全天周16方向の各方向毎に2Dスプライトが準備されている。)。また、3Dキャラクタで表示するとした場合に動的変化が少ない部分については、準備すべき2Dスプライトを省略することができる。例えば、図10(B)に示すような場合には、本来第3Vsync、第4Vsyncのタイミングで表示する第3Vsync、第4Vsyncの2Dスプライトは第2Vsyncの2Dスプライトとの変化が大きくないので、これら第3Vsync、第4Vsyncの2Dスプライトを保持せず、第2Vsyncの2Dスプライトデータを続けて使用するようにしてもよい。
【0040】
図6に示すように、2D処理サブルーチンでは、まず、ステップ162において、ステップ122でRAMに格納した仮想カメラの位置及びステップ130でRAMに格納した対象キャラクタの位置を読み出し、対象キャラクタの位置と仮想カメラの位置とを結ぶベクトルと、対象キャラクタの正面方向とがなす相対角度を演算する。
【0041】
次のステップ164では、2つの2Dスプライトを合成する合成処理を行う。この合成処理では、まず、合成すべき2つの2Dスプライトを特定する。すなわち、3D描画の場合と同様に、キャラクタの状態フラグの値や1Vsync前にどこまでのモーションが描画されているかの情報を参照して、各モーション毎に準備されている全天周16方向の2Dスプライトのうち、上述した相対角度の水平方向成分がなす角度を挟む(水平方向成分がなす角度に最も近い)2つの2Dスプライトを特定する。例えば、図9(A)に示すように、仮想カメラが対象キャラクタを見る方向が矢印A方向であるとすると、合成すべき2つの2Dスプライトとしてレンダリング方向(1)(2)の2Dスプライトが特定される(図9(B)も参照)。時系列的なモーションとの関係について付言すれば、図10(B)に示すように、1Vsync前にどこまでのモーションが描画されているかの情報を参照して、2つの2Dスプライトが特定される。
【0042】
次に、合成すべき2Dスプライトの幅Wsprtを下式(4)により演算する。なお、式(4)において、角度RRは、予め定められたキャラクタ(3Dモデル)の正面方向の方向ベクトルVfrontと、キャラクタの位置から仮想カメラの位置方向への方向ベクトルとがなす角度の水平方向成分(角度)を表している。ここに、方向ベクトルとは、大きさ(長さ)について意味を持たない単位ベクトルで、方向だけが意味を持つベクトルをいう。式(4)は、仮想カメラから楕円状のキャラクタ(3Dモデル)を見たときに、ステップ162で演算した相対角度でみるとどの程度の幅になるかを算出するものである。
【0043】
【数4】
【0044】
次いで2つの2Dスプライトの透明度を演算する。この透明度演算では、合成すべき2つの2Dスプライトのうち、角度RRに近い方の2Dスプライトの透明度Aaを完全に不透明に設定する(Aa=1.0)。このように角度RRに近い方の2Dスプライトを完全に不透明とするのは、合成処理の都合上、半透明の2Dスプライト同士を合成すると、合成画像のぼやけが増大することを防止すると共に、背景が透けて見えてしまう不都合を回避するためである。角度RRに近い方の2Dスプライトのレンダリング角度をRa(図9(A)に示した例に則していえばR1)、他方の(角度RRから遠い方の)2Dスプライトのレンダリング角度をRb(図9(A)に示した例に則していえばR2)とすると、他方の2Dスプライトの透明度Abは下式(5)により得ることができる。式(5)は、2つの2Dスプライトのレンダリング角度の差と、角度RRから片方のレンダリング角度を引いた差分との比を長さに換算して、その比を他方の2Dスプライトの透明度に直接反映させるものであり、2つの2Dスプライトの角度の比から透明度が演算されることとなる。式(5)で演算された透明度Abを他方の2Dスプライトの透明度として設定する。なお、透明度Abは0.0〜0.5の値をとる(透明度は最大値1.0で完全に不透明、最小値0.0で完全に透明)。
【0045】
【数5】
【0046】
そして、透明度が1.0及び透明度Abに設定された2つの2Dスプライトを合成した後(同じ場所に重ね合わせた後)、合成した2Dスプライトの水平方向の幅を上記式(4)で演算した幅Wsprtとなるように左右に(水平方向に)伸縮して合成処理された2Dスプライトを得る。なお、CPUはSCUを介して2つの2Dスプライトの特定、透明度Ab及び幅Wsprtの情報を画像処理部23へ転送し、透明度変換、2Dスプライトの合成及び伸縮等の処理は画像処理部23で行われる。
【0047】
次にステップ166では、キャラクタに回転がかかっているか否かを判断するために角度φが0か否かを判断する。この角度φは、図11(A)(B)に示すように、予め定められた3DモデルMの上方向ベクトルVupを、仮想カメラの視点と3Dモデルとを結んだ方向のベクトルを垂線とする仮想平面Cに投影し、図11(B)に示すように、仮想平面Cに投影後の3DモデルM’の上方向ベクトルCVupと垂直上方向Vrとのなす角度である。
【0048】
肯定判断のときは、次のステップ168において、ステップ164で合成された2Dスプライトを垂直方向にせん断変形するためのせん断変形処理を行う。図12(A)に示すように、このせん断変形処理では、予め定められた3DモデルMの正面方向のベクトルVfrontを、仮想カメラの視点と3Dモデルとを結んだ方向のベクトルを垂線とする仮想平面Cに投影し、図12(B)に示すように、仮想平面Cに投影後の3DモデルM’の正面方向の方向ベクトルCVfrontと水平方向Hrとのなす角度θの正接をせん断変形係数Shとして演算する(せん断変形係数Sh=tanθ)。なお、せん断変形係数Shが大きすぎるとき(キャラクタによって異なり、例えば、騎馬の場合にはShが0.4を超えるとき)は予め定められた最大値(例えば、騎馬の場合にはSh=0.4)に、せん断変形係数Shが不定値をとるとき(θ=90°)には、せん断変形係数Sh=0とすることで、異常値の処理を行うことができる。また、キャラクタが騎馬に比べて奥行きのない(細長くない)兵士のときやキャラクタを正面から見たときは、2Dキャラクタは仮想カメラから遠方にあるので違和感が生じず、必ずしも本ステップでのせん断変形を行わなくてもよい。図13(A)(B)にせん断変形処理前後の騎馬の2Dスプライトを示す。
【0049】
2Dスプライトには後述するように10個の頂点V1〜V10(図14(B)参照)が定められている。2Dスプライトの各頂点を透視変換して得られるスクリーン座標値は、3Dモデルの(中心)位置を透視変換して得られたスクリーン座標値を(Xx,Yx)とすると、それぞれ、(Xx+X1,Yx+Y1)、(Xx+X2,Yx+Y2)、・・・(Xx+X10,Yx+Y10)と表すことができ、Y1〜Y10に対して下式(6)の演算を行って2Dスプライトの各頂点の最終的なスクリーン座標値(Xx+X1,Yx+Y1x)、(Xx+X2,Yx+Y2x)、・・・(Xx+X10,Yx+Y10x)を得ている。なお、CPUはSCUを介してせん断変形係数の情報を画像処理部23へ転送し、合成された2Dスプライトのせん断変形や透視変換は画像処理部23で行われる。
【0050】
【数6】
【0051】
一方、ステップ166で否定判断のときは、ステップ170において、ステップ164で合成処理された2Dスプライトを角度φだけ垂直方向Vrから回転させるための回転処理が行われる。図13(C)(D)に回転処理前後の兵士の2Dスプライトを示す。本戦闘ゲームでこのような回転処理が行われるのは、例えば、竜巻が発生しキャラクタが自己の脚力で地上に立脚できない宙に浮いた状態等を表現するときである。なお、CPUはSCUを介して角度φの情報を画像処理部23へ転送し、合成された2Dスプライトの回転は画像処理部23でアフィン変換(affine-transformation)により行われる。
【0052】
次にステップ172では、2Dキャラクタに陰影を施すための陰影処理を行う。この陰影処理は、いわゆるシェーディング処理のことで、2Dキャラクタに対して影を付けるものではなく、光源位置や周囲環境条件により定まる明るさを決定する処理である。
【0053】
ここで、ステップ172での陰影処理に関連して、本実施形態の2Dスプライトの疑似法線ベクトルについて説明する。図14(A)に示すように、3Dモデルとして兵士の外形形状に近い円柱について考えると、円柱の輪郭に任意に頂点を定めることができる。例えば、頂点V1では、垂直方向ベクトルと水平方向ベクトルとを合成した法線ベクトルを得ることができる(V2〜V10でも同じ。)。図14(B)に示すように、上述した16方向の2Dスプライトを作成する際に、3Dモデルの頂点に対応した2Dスプライトの頂点(本例では10個)に3Dモデルの頂点に設定された法線ベクトルを疑似法線ベクトルとしてそのまま反映させる。このとき、2Dスプライトのシェーディングに違和感が生じないように若干の修正を加えるようにしてもよい。例えば、キャラクタとして高さ(背)の違う2頭の騎馬を想定する場合に、一方の疑似法線ベクトルを修正することで2頭の騎馬が並んだときに背の高い騎馬と背の低い騎馬とのシェーディングのコントラストを得ることができる。なお、図14(C)は図14(B)を上から見たことを想定した場合の疑似法線ベクトルの方向を示している。例えば、平行光源が上部に存在し、光が上部から下部に向かって一様にふりそそぐ場合、2Dスプライトの疑似法線ベクトルが上向きの場合には、3Dモデルの場合と同様に、シェーディングにおいてその頂点が明るくなり(V1〜V5)、下向きの場合(V6〜V10)には暗くなる。光源の方向と疑似法線ベクトルの相対角度によって明るい部分が変わる。従って、ステップ172での陰影処理では、2Dスプライトの各頂点において、3Dモデルの法線ベクトルに基づいて予め疑似法線ベクトルを決定しておき、3Dモデルに施すシェーディングと同様の処理を行う。
【0054】
図14(B)を参照して、更に詳述すれば、2Dスプライトの頂点V1、V2・・・V10での疑似法線ベクトルの値を下式(7)に示すようにN1、N2・・・N10、2Dスプライトに影響を与える平行光源の方向ベクトルを下式(8)に示すようにCdir、平行光源のカラー(RGB)値を下式(9)に示すようにCcol、アンビエント(環境光)カラー(RGB)値を下式(10)に示すようにCambとし、疑似法線ベクトルNに対して各頂点Vにおけるカラー値の演算を行う。
【0055】
【数7】
【0056】
【数8】
【0057】
まず、疑似法線ベクトルN1に対して下式(11)によりNN1を演算し、下式(12)により頂点V1のカラー(RGB)値Vcol1を得る。
【0058】
【数9】
【0059】
【数10】
【0060】
同様の処理を疑似法線ベクトルN2〜N10に対しても行い、全ての頂点のカラー値を演算する。2Dキャラクタの頂点とそれらの付近のカラー値はリニアに変化するが、このような処理については画像処理部23で行われる。
【0061】
ステップ172で対象キャラクタについての陰影処理、2D処理サブルーチンを終了すると、図5に示すステップ140へ戻る。ステップ140で肯定判断がなされると、すなわち、視界内の全キャラクタの処理が終了すると、次のステップ152において、仮想カメラの視界内の全キャラクタを3D、2Dを混在させて描画させるために、上述した種々の情報を画像処理部23に転送して3D2D処理サブルーチンを終了し図4のステップ110へ進む。画像処理部23は、転送された情報に従って、次の1Vsyncの間に、上述したように3D処理対象のキャラクタについては3Dポリゴンデータにより描画処理を行い、2D処理対象のキャラクタについては2Dスプライトにより描画処理を行って、画像処理部23のフレームバッファに3D2Dキャラクタ混在画像を描画して、描画した画像をテレビモニタ4へ送出する。これにより、テレビモニタ4には1/60秒毎に3D2Dキャラクタが混在した戦闘ゲームの状態が表示される(図15参照)。
【0062】
ステップ110では、戦闘ゲームが終了したか(例えば、部隊E、Fのうち一方の部隊の部隊長が死亡した場合)、又は、プレイヤが入力装置3のゲーム終了用の所定ボタンを押下したかを判断し(このような入力の取り込みはステップ106のメイン処理で行われる。)、否定判断のときはステップ104へ戻り、肯定判断のときは次のステップ112において、例えば、プレイヤの部隊が勝利したときに勝ちどきをあげる等の戦闘ゲームのエンディング処理を行って戦闘処理ルーチンを終了する。
【0063】
(作用等)
以上のように本実施形態では、仮想カメラから3D仮想空間上で50m内に位置するキャラクタについては3Dキャラクタで描画し、仮想カメラから3D仮想空間上で50mより遠い位置のキャラクタについては2Dキャラクタで描画するようにしたので(ステップ142〜ステップ150)、3D、2Dキャラクタが混在する画像の違和感を緩和することができる。また、本実施形態では、2Dキャラクタについて、キャラクタの位置と仮想カメラの位置とを結ぶ方向と、キャラクタの正面方向とがなす相対角度の水平方向成分角度から予め用意された全天周16方向のうち最も近い2つの2Dスプライトを選択して相対角度で当該キャラクタをみたときの幅Wsprtとなるように合成し(ステップ162、164)、相対角度の垂直方向成分角度に応じて合成した2Dスプライトをせん断変形するようにしたので(ステップ168)、仮想カメラから遠方の2Dキャラクタを見たときに水平及び垂直方向に適正な幅、高さが反映され、3Dキャラクタ及び2Dキャラクタが混在する画像の違和感を低減させることができる。すなわち、仮想カメラから遠方の2Dキャラクタを見たときに水平及び垂直方向に適正な幅、高さが反映されるので、仮想カメラで全天周どの方向からキャラクタを観察する場合にも3D、2Dの視点の変化に対応することができると共に、仮想カメラから50mの仮想の境界線を境とする強い違和感を低減させることができる。しかも、本実施形態では、単純な8方向程度ではなく16方向の2Dスプライトを準備し、一方の2Dスプライトを半透明にしたので、キャラクタの幅方向(水平方向)の合成を適正に行うことができると共に、全天周16方向の各象限のレンダリング方向について、幅の変化量の大きい方向間を幅の変化量の小さい方向間に比べて細かく区分したので、細長い(奥行きのある)2Dスプライトを合成しても適正な合成画像を得ることができる。更に、本実施形態では、仮想カメラから近い順に(ステップ138)50体以内のキャラクタのみを3Dキャラクタで描画するので(ステップ124、144、146、148)、3D画像処理の演算量を軽減してゲーム展開に必要な演算量を相対的に増加させることができる。
【0064】
また、本実施形態では、2Dスプライトを3Dポリゴンデータのレンダリング画像に基づいて作成・準備する際に、キャラクタの3D表示時のモーションに対応するように、各モーションデータに基づいて2Dスプライトのアニメーションデータを作成・準備したので(図10参照)、キャラクタの描画が3Dから2Dへ又は2Dから3Dへ逐次切り換えられても、切り換えの瞬間における両者間の姿勢、方向等の不一致・不連続性を解消することができるので、3D、2Dキャラクタが混在する動的画像の違和感をなくすことができ、高い描画品質を確保することができる。この場合に、本実施形態では、準備された2Dスプライトのうち動的変化の少ないフレームに対応する2Dスプライトの準備を省略することも可能なため、画像処理部23のVRAMの使用領域を小さくすることができる。
【0065】
更に、本実施形態では、図10(B)に示したように、2Dスプライトの頂点に3Dポリゴンデータに対応するように疑似法線ベクトルを予め形成しておいて、その陰影処理をリアルタイムに行って描画するようにしたので(ステップ172)、仮想カメラから遠方にあっても本来2D表示としか見えないキャラクタを3D表示らしく見せることができる。従って、本実施形態では、このような陰影処理により、3D、2Dキャラクタの混在画像の違和感を消極的に解消するばかりでなく、2Dキャラクタを積極的に3Dキャラクタに近づける処理がなされている。
【0066】
なお、本実施形態では、相対角度をキャラクタの位置と仮想カメラの位置とを結ぶ方向と、キャラクタの正面方向とがなす角度とした例を示したが、簡易な方法として、仮想カメラの方向とキャラクタの正面方向とがなす角度(スクリーン座標系でのキャラクタの正面方向の角度)を相対角度としてもよい。
【0067】
また、本実施形態では、1Vsync毎に3D、2Dによる画像を切換可能な例を示したが、3Dモデルのモーションのレンダリング画像を作成する際に、2Dスプライトデータとしてサンプリングする時間をそのまま利用するようにしてもよい。この場合に、サンプリングした時間(例えば、1、2、5フレーム)をデータとして控えておき、2Dスプライトの描画の際にそのサンプリング時間が経過した場合に描画を切り換えるようにしてもよい。このような態様では、3D、2Dキャラクタについていずれの描画を行うかの決定は、対象キャラクタの各モーションのサンプリング時間経過毎に行うようにすればよい。また、3Dキャラクタのモーションで動き(姿勢変化)の少ない時間帯は粗くサンプリングし、動きの多い時間帯は細かくサンプリングするようにしてもよい。
【0068】
更に、本実施形態では、右アナログスティック40から入力がある場合に仮想カメラの位置、方向を変更する例を示したが、例えば、3秒間プレイヤからの入力がなければ、仮想カメラの位置、方向を動かすようにしてもよく、特定のイベントが発生する場合に仮想カメラを当該イベントが発生する位置、方向に動かすようにしてもよい。また、仮想カメラを動かす場合にも、位置だけ移動させたり、方向だけ変化させるようにしてもよい。このような場合には、例えば、右アナログスティック40の他に左アナログスティック39も一方の入力を把握するために使用することができる。
【0069】
そして、本実施形態では、図14(A)に示したように、キャラクタとしての兵士の外形形状を円柱に見立てる例を示したが、円柱に見立てる必要がある訳ではなく、キャラクタに近似する形状に見立てることにより、疑似法線ベクトルの方向を容易に設定することが可能となる。
【0070】
【発明の効果】
以上説明したように、本発明の第1、第4、第5及び第8の態様によれば、仮想カメラから所定距離内に位置するオブジェクトキャラクタ、すなわち、仮想カメラに近いオブジェクトキャラクタについて3次元キャラクタで描画し、仮想カメラから所定距離の外に位置するオブジェクトキャラクタ、すなわち、仮想カメラから遠方のオブジェクトキャラクタについて2次元キャラクタで描画するので、3次元キャラクタ及び2次元キャラクタが混在する画像の違和感を緩和することができると共に、所定距離内、所定数内のオブジェクトキャラクタについてのみ3次元キャラクタで描画するので、3次元画像処理の演算量を軽減することができ、また、2次元キャラクタについて、オブジェクトキャラクタの位置と仮想カメラの位置とを結ぶ方向と、オブジェクトキャラクタの正面方向とがなす相対角度の水平方向成分角度から予め用意された全天周多数方向のうち最も近い2つの2次元スプライトデータを選択して該相対角度でオブジェクトキャラクタをみたときの幅となるように合成し、該相対角度の垂直方向成分角度に応じて合成した2次元スプライトデータをせん断変形するようにしたので、仮想カメラから遠方の2次元キャラクタを見たときに水平及び垂直方向に適正な幅、高さが反映され、3次元キャラクタ及び2次元キャラクタが混在する画像の違和感を低減させることができ、更に、全天周多数方向について、幅の変化量の大きい方向間を幅の変化量の小さい方向間に比べて細かく区分したので、細長い2Dスプライトを合成しても適正な合成画像を得ることができる、という効果を得ることができる。
また、本発明の第2、第4、第6及び第9の態様の態様によれば、仮想カメラから所定距離内に位置するオブジェクトキャラクタについて3次元キャラクタで描画し、仮想カメラから所定距離の外に位置するオブジェクトキャラクタについて2次元キャラクタで描画するので、3次元キャラクタ及び2次元キャラクタが混在する画像の違和感を緩和することができると共に、所定距離内、所定数内のオブジェクトキャラクタについてのみ3次元キャラクタで描画するので、3次元画像処理の演算量を軽減することができ、また、予め用意された全天周多数方向の2次元スプライトデータを、手足又は足を有する3次元キャラクタがとり得る複数のモーションに対応するように複数のアニメーションデータとして準備されているため、オブジェクトキャラクタの描画が3次元キャラクタから2次元キャラクタに又はその逆に切り換えられても、切り換えの瞬間における両者間の姿勢、方向等の不一致・不連続性を解消することができ、3次元キャラクタ及び2次元キャラクタが混在する動的画像の違和感をなくすことができ、更に、準備されるべきアニメーションデータのうち動的変化の少ないフレームに対応する2次元スプライトデータを省くため、2次元スプライトデータのための記憶容量を軽減することができる、という効果を得ることができる。
そして、本発明の第3、第4、第7及び第10の態様によれば、仮想カメラから所定距離内に位置するオブジェクトキャラクタについて3次元キャラクタで描画し、仮想カメラから所定距離の外に位置するオブジェクトキャラクタについて2次元キャラクタで描画するので、3次元キャラクタ及び2次元キャラクタが混在する画像の違和感を緩和することができると共に、所定距離内、所定数内のオブジェクトキャラクタについてのみ3次元キャラクタで描画するので、3次元画像処理の演算量を軽減することができ、また、2次元スプライトデータに、3次元ポリゴンデータに対応するように頂点座標及びシェーディング用の疑似法線ベクトルを予め含むようにしたので、2次元スプライトの頂点の疑似法線ベクトルによりシェーディング(陰影処理)を行うことが可能となり、2次元キャラクタを3次元キャラクタらしく見せることができる、という効果を得ることができる。
【図面の簡単な説明】
【図1】家庭用ゲーム装置の接続態様を示す概略斜視図である。
【図2】家庭用ゲーム装置に使用される入力装置を示し、(A)は平面図であり、(B)は(A)の矢印B方向からみたときの正面図である。
【図3】実施形態のゲーム装置本体の概略構成を示すブロック図である。
【図4】ゲーム装置本体のCPUにより実行される戦闘処理ルーチンの概略フローチャートである。
【図5】戦闘処理ルーチンのステップ108の詳細を示す3D2D処理サブルーチンのフローチャートである。
【図6】3D2D処理サブルーチンのステップ150の詳細を示す2D処理サブルーチンのフローチャートである。
【図7】右アナログスティックの傾斜位置と視点との関係を示す説明図であり、(A)は右アナログスティックを傾斜させたときの入力可能範囲を示す平面図、(B)は視点の移動方向及び向きを説明する平面図である。
【図8】仮想カメラの視界を示す説明図である。
【図9】3Dモデルを2Dスプライトにレンダリングするときの説明図であり、(A)は全天周に対するレンダリング角度を示し、(B)は(A)のレンダリング方向(0)〜(4)において3Dモデルの馬をレンダリングしたときの2Dスプライトである。
【図10】3D、2Dの画像データを示す説明図であり、(A)は3Dモーションデータを示し、(B)は2Dアニメーションデータを示す。
【図11】角度φを模式的に示す説明図であり、(A)は仮想カメラから3Dモデルを見たときを示し、(B)は仮想カメラから平面Cに投影された3Dモデルを見たときを示す。
【図12】角度θを模式的に示す説明図であり、(A)は仮想カメラから3Dモデルを見たときを示し、(B)は仮想カメラから平面Cに投影された3Dモデルを見たときを示す。
【図13】2Dスプライトのせん断変形及び回転変形を模式的に示す説明図であり、(A)はせん断変形前の2Dスプライトを示し、(B)はせん断変形後の2Dスプライトを示し、(C)は回転変形前の2Dスプライトを示し、(D)は回転変形後の2Dスプライトを示す。
【図14】2Dスプライトの頂点の疑似法線ベクトルを模式的に示す説明図であり、(A)は円柱で法線ベクトルを想定したときの法線ベクトルを示し、(B)は2Dスプライトの頂点における疑似法線ベクトルを示し、(C)は2Dスプライトの頂点における疑似法線ベクトルを上側から見たと仮定したときの方向を示す。
【図15】戦闘処理ルーチンの実行時にテレビモニタに表示される中間調画像の一例である。
【符号の説明】
1 記録媒体
2 ゲーム装置本体(画像生成装置)
20 CPUブロック(決定手段、描画手段の一部)
23 画像処理部(描画手段の一部)[0001]
BACKGROUND OF THE INVENTION
The present inventionprogram, Recording medium, image generating apparatus, andImage generation methodIn particular, an image in which a large number of object characters including a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space is generated.programTheprogram, Recording image recording apparatus, image generating apparatus, andImage generation methodAbout.
[0002]
[Prior art]
Today, video games sold by various companies, in combination with the speeding up of the game apparatus body (computer), generally provide a realistic three-dimensional (hereinafter abbreviated as 3D) character on the display of the display device. There are many things to display. In order to display a character (hereinafter referred to as a 3D character) with 3D polygon data, a three-dimensional single 3D model is placed in the object space, and an image that can be viewed from a virtual camera (viewpoint) by performing 3D coordinate transformation is displayed. This is performed by automatic generation (3D image processing). The 3D polygon data includes data such as vertex coordinates, vertex texture coordinates, normal vectors, and the like. Once one 3D model is prepared, images that are consistent even when the 3D model is viewed from various directions with a virtual camera can be generated. Such 3D image processing technology is, for example, “3D Computer Graphics” (ISBN 4-7856-), published by Shosendo Co., Ltd. on May 20, 1986, by Eihachiro Nakamae and Tomoaki Nishida. 3064-7), and “Computer Graphics” (ISBN 4-7856-2075-7) written by Takeshi Yasui and Masayuki Nakajima, issued by Shogodo Co., Ltd. on July 15, 1992, and the like.
[0003]
On the other hand, if all characters appearing in the video game are to be drawn in 3D, the amount of calculation for drawing the 3D character becomes enormous, and the amount of calculation necessary for game development is compressed. In order to solve this problem, for example, Japanese Patent Application Laid-Open No. 11-203504 discloses that a character displayed on a display is a game character having a relatively high degree of importance and a relatively important degree in accordance with a game scene. In other words, a technique for performing 3D image processing for game characters and mainly performing two-dimensional (hereinafter abbreviated as 2D) image processing for supporting characters is disclosed. Therefore, there is already a technique for mixing and displaying a character by 3D image processing and a character by 2D image processing (hereinafter referred to as 2D character) in a 3D virtual space.
[0004]
As a technique related to the present invention, Japanese Patent Laid-Open No. 2001-084402 has a plurality of image data corresponding to a character to display one character, and an intermediate image of the plurality of image data is complemented. A technique for obtaining and displaying the above is disclosed. Japanese Patent Laid-Open No. 2001-70634 discloses a 3D character arranged in a 3D virtual space as a 2D image with animated data displayed on a display as a 2D image with data that has undergone emphasis processing and coloring processing for adding contour lines or ridge lines. Techniques to do this are disclosed. Furthermore, Japanese Patent Laid-Open No. 2001-056870 discloses a technique for moving a large number of characters in a collective manner, and Japanese Patent Laid-Open No. 2001-149655 discloses a technique for performing search, battle, etc. for a large number of characters.
[0005]
[Problems to be solved by the invention]
However, in the above-mentioned Japanese Patent Application Laid-Open No. 11-203504, although the amount of computation of 3D image processing can be greatly reduced by performing 2D image processing on a part of the character, the 3D character and 2D character are mixed. There is a problem of causing a sense of incongruity. This tendency is remarkably emphasized as the number of characters displayed on the display, in other words, the number of characters appearing in the game increases. That is, in order to cope with dynamic changes of a large number of characters (for example, 100 or more) appearing in the game, it is necessary to reduce the calculation amount of 3D image processing, but a 3D virtual in which 3D characters and 2D characters coexist. An image with a strong sense of incongruity can be obtained if the consistency between the two is not achieved in space.
[0006]
In order to eliminate this uncomfortable feeling, it is necessary to solve the following three points. (1) The virtual camera that becomes the viewpoint during the game can freely move from near to far. Therefore, there is a boundary where the 2D character and the 3D character are switched, and simple display causes discontinuity of the display on the display and causes a strong sense of incongruity. Since the virtual camera can observe the character from any position all around the sky, simple 2D sprites (for example, simply in about 8 directions) cannot cope with changes in the viewpoint. (2) Since the orientation of the 3D character changes dynamically during the game, the movement of the 2D character cannot be balanced unless it is dynamically expressed in the same manner as the 3D character, and is particularly extreme when switching between the two. Creates a sense of incongruity Further, (3) the 3D character changes its own shadow, so that the 2D character will feel uncomfortable if the same processing is not performed.
[0007]
In view of the above case, the present invention can mix a large number of 3D characters and 2D characters without a sense of incongruity.programTheprogramRecording medium, image generating apparatus, andImage generation methodIt is an issue to provide.
[0010]
[Means for solving the problem]
To solve the above problem,First of the present invention1The method of generating an image in which a large number of object characters including a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space.programBecauseComputerBased on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera Decided to draw an object character that is located inside and outside the predetermined distance or exceeds the predetermined number with the two-dimensional characterDecision means toBased on a relative angle formed by a direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn with the character, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. Two dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected from the dimensional sprite data and synthesized so as to have a width when the object character is viewed at the relative angle from the virtual camera. And the synthesized two-dimensional And shear deformation to render the two-dimensional character in accordance with flop write data to the angle formed by the vertical component direction of the relative angleThe omnidirectional multi-direction is functioned as a drawing means, and the direction in which the amount of change in the width is large is divided more finely than the direction in which the amount of change in the width is small..
[0011]
In this aspect,The decision meansBased on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are three-dimensional characters drawn with three-dimensional polygon data. An object character positioned within the field of view of the virtual camera and outside a predetermined distance or exceeding a predetermined number is determined as a two-dimensional character drawn by two-dimensional sprite data.And the drawing meansAn object determined to be drawn with a three-dimensional character based on a relative angle formed by a direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character Relative angle is selected from two-dimensional sprite data of all-round multi-directional prepared in advance based on the rendering image of the three-dimensional polygon data for the object character determined to be drawn with the two-dimensional character. Two two-dimensional sprite data closest to the angle formed by the horizontal component are selected and combined so as to have a width when the object character is viewed at a relative angle from the virtual camera, and the combined two-dimensional sprite data is relative angle. The angle formed by the vertical component direction In response to shear deformation to draw a two-dimensional character, generates an image in which a mix of multiple object characters and three-dimensional character and the two-dimensional characterHowever, in the all-sky majority direction, the direction in which the width change amount is large is divided more finely than the direction in which the width change amount is small..
[0012]
First1According to the aspect ofAn object character located within a predetermined distance from the virtual camera, that is, an object character close to the virtual camera is rendered as a three-dimensional character, and an object character located outside the predetermined distance from the virtual camera, ie, an object character far from the virtual camera. Since drawing with a two-dimensional character can alleviate the uncomfortable feeling of an image in which a three-dimensional character and a two-dimensional character are mixed, and only a predetermined number of object characters within a predetermined distance are drawn with a three-dimensional character. The amount of computation of 3D image processing can be reduced,For the two-dimensional character, the closest two of the multiple directions of the entire sky prepared in advance from the horizontal component angle of the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera and the front direction of the object character. Two two-dimensional sprite data are selected and combined so that the width of the object character is viewed at the relative angle, and the combined two-dimensional sprite data is shear-deformed according to the vertical component angle of the relative angle. As a result, when viewing a two-dimensional character far away from the virtual camera, the appropriate width and height are reflected in the horizontal and vertical directions, and it is possible to reduce the uncomfortable feeling of the mixed image of the three-dimensional character and the two-dimensional character.Furthermore, since the direction of large width variation is divided more finely than the direction of small width variation in all directions of the entire sky, it is appropriate to synthesize a long (deep) 2D sprite. You can get composite imageThe
[0013]
In this aspect,The drawing meansIf one of the two two-dimensional sprite data is made semi-transparent and synthesized, an appropriate width without a sense of incongruity can be reflected in the horizontal direction when a two-dimensional character far from the virtual camera is viewed. In addition, if the angles between directions in the quadrants in all directions are different, an appropriate two-dimensional character can be drawn even for an elongated (depth) object character.. Drawing meansIs the angle between the direction vector when the front direction vector of the object character is projected onto a virtual plane with a vector connecting the position of the object character and the position of the virtual camera as a perpendicular and the horizontal direction on the virtual plane. A tangent value may be obtained, and the two-dimensional sprite data synthesized based on the obtained tangent value may be subjected to shear deformation in the vertical direction. In addition, two-dimensional sprite data for all directions in multiple directions prepared in advance is prepared as a plurality of animation data so as to correspond to a plurality of motions that a three-dimensional character can take.You may,In this case, the two-dimensional sprite data corresponding to the frame with little dynamic change is omitted from the animation data to be prepared.It is desirable.
[0014]
In the second aspect of the present invention, a large number of object characters including a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space. A program for generating an image, the computer comprising: a predetermined number of object characters located within a visual field and a predetermined distance of the virtual camera based on position and direction information of the virtual camera and position information of the object character Determining means for determining that the three-dimensional character is to be drawn by the two-dimensional character within the field of view of the virtual camera and outside the predetermined distance or exceeding the predetermined number, on the three-dimensional virtual space The position of the object character and the position of the object character Based on the relative angle formed between the direction connecting the position of the virtual camera and the front direction of the object character, the three-dimensional character is drawn with respect to the object character determined to be drawn with the three-dimensional character, and the two-dimensional character For the object character determined to be drawn in
Furthermore, in the third aspect of the present invention, a large number of object characters including a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space. A program for generating an image, the computer comprising: a predetermined number of object characters located within a visual field and a predetermined distance of the virtual camera based on position and direction information of the virtual camera and position information of the object character Determining means for determining that the three-dimensional character is to be drawn by the two-dimensional character within the field of view of the virtual camera and outside the predetermined distance or exceeding the predetermined number, on the three-dimensional virtual space The position of the object character and the position of the object character Based on the relative angle formed between the direction connecting the position of the virtual camera and the front direction of the object character, the three-dimensional character is drawn with respect to the object character determined to be drawn with the three-dimensional character, and the two-dimensional character For the object character determined to be drawn in
First of the present invention4The first aspect is the above-described first.-3rdOf aspectsprogramIs a computer-readable recording medium on which is recorded. In addition, the first of the present invention5An image generating apparatus that generates an image in which a large number of object characters, that is, a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data, are mixed in a 3D virtual space Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional character and the virtual character A determination means for determining that an object character positioned within the field of view of the camera and outside the predetermined distance or exceeding the predetermined number is drawn with the two-dimensional character, and the position of the object character in the three-dimensional virtual space, A direction connecting the position of the object character and the position of the virtual camera Based on the relative angle formed by the front direction of the object character, the three-dimensional character is drawn for the object character decided to be drawn by the three-dimensional character, and the object character decided to be drawn by the two-dimensional character is three-dimensional Two virtual two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected from the two-dimensional sprite data in all directions in multiple directions prepared based on the rendering image of the polygon data, and the virtual The two-dimensional sprite data is synthesized according to the angle formed by the vertical component direction of the relative angle by combining the two-dimensional sprite data so as to have a width when the object character is viewed from the camera at the relative angle. Drawing means for drawing a character,In the all-sky multi-direction, the direction in which the amount of change in the width is large is divided more finely than the direction in which the amount of change in the width is small, and the sixth aspect of the present invention is In an image generation apparatus for generating an image in which a large number of object characters of a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space, a virtual camera Based on the position and direction information of the object and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional character, the visual field of the virtual camera, and It is determined that an object character that is located outside the predetermined distance or exceeds the predetermined number is drawn with the two-dimensional character. Based on a relative angle formed by a direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character. The object that is determined to be drawn with the two-dimensional character is drawn for the object character that is determined to be drawn with the three-dimensional character. The two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle from the two-dimensional sprite data in all directions of the entire sky prepared based on the rendering image of the three-dimensional polygon data for the character. Select and synthesize the object character so as to have a width when the object character is viewed from the virtual camera at the relative angle, and shear deform the synthesized two-dimensional sprite data according to the angle formed by the vertical component direction of the relative angle. And the drawing means for drawing the two-dimensional character, and the two-dimensional sprite data prepared in advance in all directions in multiple directions corresponds to a plurality of motions that the three-dimensional character having limbs or feet can take. Are prepared as a plurality of animation data, and out of the animation data The second aspect of the present invention is characterized in that a three-dimensional character and a two-dimensional object drawn with three-dimensional polygon data in a three-dimensional virtual space are characterized in that the two-dimensional sprite data corresponding to a frame with little change in the area is omitted. In an image generation apparatus for generating an image in which a large number of object characters are mixed with a two-dimensional character drawn with sprite data, the virtual camera is based on the position and direction information of the virtual camera and the position information of the object character. A predetermined number of object characters located within the predetermined field of view and within a predetermined distance are the three-dimensional characters, and object characters positioned within the predetermined field of view of the virtual camera and outside the predetermined distance or exceeding the predetermined number Determining means for determining to draw with a three-dimensional character; About an object character determined to be drawn by the three-dimensional character based on a relative angle formed by a direction connecting the position of the object character and the position of the virtual camera to the position of the object character and the front direction of the object character The relative angle is selected from two-dimensional sprite data in all directions in multiple directions prepared in advance based on the rendering image of the three-dimensional polygon data for the object character that is to be drawn with the two-dimensional character. The two two-dimensional sprite data closest to the angle formed by the horizontal direction component are selected and synthesized so as to have a width when the object character is viewed at the relative angle from the virtual camera, and the synthesized two-dimensional sprite is synthesized. Data for the relative angle Drawing means for drawing the two-dimensional character by shear deformation in accordance with an angle formed by a vertical component direction, and the two-dimensional sprite data is for vertex coordinates and shading so as to correspond to the three-dimensional polygon data. A pseudo-normal vector is included in advance.And the first of the present invention8The method of generating an image in which a large number of object characters including a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space.Image generation methodBecause, ProvisionalBased on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera Decided to draw an object character that is located inside and outside the predetermined distance or exceeds the predetermined number with the two-dimensional characterShiBased on a relative angle formed by a direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn with the character, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. Two dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected from the dimensional sprite data and synthesized so as to have a width when the object character is viewed at the relative angle from the virtual camera. And the synthesized two-dimensional And shear deformation to render the two-dimensional character in accordance with flop write data to the angle formed by the vertical component direction of the relative angleIn the ninth aspect of the present invention, in the all-sky multi-direction, the direction in which the width change amount is large is divided more finely than the direction in which the width change amount is small. An image generation method for generating an image in which a large number of object characters of a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space And based on the position and direction information of the virtual camera and the position information of the object character A predetermined number of object characters located within a predetermined distance within the field of view of the virtual camera are objects that are located within the visual field of the virtual camera and outside the predetermined distance, or exceed the predetermined number. Determining that the character is to be drawn with the two-dimensional character, and connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space; Based on the relative angle formed by the three-dimensional character, the three-dimensional character is drawn for the object character decided to be drawn and the two-dimensional character is decided to be drawn based on the rendering image of the three-dimensional polygon data. Prepared in advance The two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected from the two-dimensional sprite data in all directions and the object character is viewed from the virtual camera at the relative angle. Combining the two-dimensional sprite data so as to be the width of time, and drawing the two-dimensional character by shearing the synthesized two-dimensional sprite data in accordance with the angle formed by the vertical component direction of the relative angle, The prepared two-dimensional sprite data for all directions in multiple directions is prepared as a plurality of animation data so as to correspond to a plurality of motions that can be taken by the three-dimensional character having limbs or feet. 2D sprite data corresponding to frames with little dynamic change is omitted. According to a tenth aspect of the present invention, an image in which a large number of object characters, that is, a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data, is mixed in a 3D virtual space. A method for generating an image, comprising: generating a plurality of object characters within a predetermined number of positions within a field of view and a predetermined distance of the virtual camera based on position and direction information of a virtual camera and position information of the object character; It is determined that an object character that is positioned within the field of view of the virtual camera and outside the predetermined distance or exceeds the predetermined number is drawn with the two-dimensional character, and the object character on the three-dimensional virtual space Connect the position of the object character and the position of the virtual camera to the position About the object character determined to draw the three-dimensional character for the object character determined to be drawn with the three-dimensional character and to be drawn with the two-dimensional character based on the relative angle formed by the direction and the front direction of the object character Select two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle from two-dimensional sprite data in all directions in multiple directions prepared based on a rendering image of three-dimensional polygon data. The two-dimensional sprite data is synthesized so as to have a width when the object character is viewed at the relative angle from the virtual camera, and the synthesized two-dimensional sprite data is subjected to shear deformation in accordance with an angle formed by a vertical component direction of the relative angle. Drawing a 2D character, including steps Said two-dimensional sprite data, characterized in that it comprises pre-pseudo-normal vector for vertex coordinates and shading to correspond to the three-dimensional polygon data.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments in which the present invention is applied to a home video game apparatus will be described below with reference to the drawings.
[0016]
(Constitution)
As shown in FIG. 1, in a home
[0017]
As shown in FIGS. 2A and 2B, the
[0018]
As shown in FIG. 3, the
[0019]
An
[0020]
(Operation)
Next, with reference to the flowchart, regarding the operation of the home
[0021]
In the battle processing routine, first, at
[0022]
When the
[0023]
Here, the relationship between the operation of the
[0024]
The position of the virtual camera is actually calculated by the coordinate value of the world coordinate system. However, if considered in the screen coordinate system, as shown in FIG. 5a, move from the current virtual camera position (center O (0,0)) to O ′ by 1.5b in the y direction (k = 1.5), and the orientation of the virtual camera is also determined by a and b. It will be tilted (the screen coordinate system will also tilt at that angle). Therefore, the magnitudes of a and b change depending on the degree of inclination of the
[0025]
On the other hand, if an affirmative determination is made in
[0026]
As shown in FIG. 5, in this 3D2D processing subroutine, first, in
[0027]
Next, in
[0028]
On the other hand, when an affirmative determination is made in
[0029]
In this 3D processing, the relative angle formed by the direction connecting the character position and the virtual camera position and the front direction of the character is calculated, and motion data for animation obtained using motion capture or the like is obtained. A plurality of sets are prepared in advance, and any one frame in one set of motion data is selected from the motion data according to the state of the character (for example, the state of movement, battle, etc.). That is, since the character takes various states such as movement and battle, the CPU reads the value of the state flag indicating the current state of the character from the RAM and selects a set of motion data specified by the flag value. Since one set of motion data is composed of a plurality of frames in a time series as shown in FIG. 10A, the CPU draws up to which frame the target character is drawn before 1 Vsync among the plurality of frames. It is possible to identify the frame to be drawn at the present time. For the specification of such a frame, for example, a counter may be used as in the technique of Japanese Patent Application Laid-Open No. 2001-149655 described above.
[0030]
Here, the character motion is not a direct calculation of pixel displacement in real time, but a sequence of data obtained by sampling the movements of horse soldiers, soldiers, horses, etc. in advance in order to express the realistic movement of the character. Is used. The data structure of general 3D motion data has a scale value indicating the size, a rotation angle with respect to each axis of xyz, and a coordinate value for each xyz indicating a moving distance from the origin for each joint of the character. As a set of joint data, motion data is configured by having as many joint data groups of the entire character composed of one or a plurality of joint data as the number of frames of the motion for each motion (FIG. 10A). See also). A frame here is a time unit of image processing and is a so-called “frame”. When displaying a 3D character, the CPU transfers information such as the position and direction of the target character in the world coordinate system, and the motion of the target character to the
[0031]
On the other hand, if a negative determination is made in
[0032]
Before describing the 2D processing subroutine, the 2D character image data (hereinafter referred to as 2D sprite) prepared in advance (stored in the VRAM of the
[0033]
As shown in FIG. 9B, the width of the character in the rendering direction (0) (the direction when viewed from the front) is W.1, The width of the character in the rendering direction (4) (the direction when seen from the side) is W2And width W1And width W2If the larger one is Wmax and the smaller one is Wmin, the character width increase rate Ex can be obtained by the following equation (1), and the rendering angle in the fourth quadrant (0 to 90 degrees) in FIG. Rk(An angle formed by the rendering direction (k) and the rendering direction (0) shown in FIG. 9A) can be obtained by the following equation (2). R0Is 0.
[0034]
[Expression 1]
[0035]
[Expression 2]
[0036]
Further, the rendering angle R in the other quadrant (90 to 360 °) is calculated from the rendering angle obtained by Expression (2).5~ R15Can be obtained by the following equation (3).
[0037]
[Equation 3]
[0038]
As shown in FIGS. 9A and 9B, the rendering angle in each quadrant is not a fixed angle, but is different, for example, between the rendering directions (0) (1) and (1) (2). The width is different. The width of an elongate (depth) character like a horse is more than three times between rendering directions (0) and (3) and less than twice between rendering directions (3) and (4). In the synthesis of 2D sprites, it is preferable to set the rendering direction finely for a range where the image change amount (width change amount) is large, and to set the rendering direction coarsely for a range where the image change amount is small.
[0039]
In addition, since the motion and orientation of the 3D character itself dynamically change during the battle game, the 2D character needs to be prepared in response to such a dynamic change. In the present embodiment, as shown in FIG. 10B, 2D animation data is prepared based on each motion data so as to correspond to the motion of the 3D character shown in FIG. Note that the 2D animation data shown in FIG. 10B is a case where the character (equestrian) is in a moving state, and similar 2D animation data is prepared for other states (for example, a certain character has four types of data). When the state can be taken, 2D sprites are prepared for each of the 16 directions of the entire sky so as to correspond to the four types of motion of the 3D character. In addition, 2D sprites to be prepared can be omitted for portions with little dynamic change when displayed as 3D characters. For example, in the case shown in FIG. 10B, the 3D Vsync 2D sprite that is originally displayed at the timing of the 3rd Vsync and 4th Vsync does not greatly change from the 2D sprite of the 2nd Vsync. The 2D sprite data of the second Vsync may be continuously used without holding the 3D sync and the 4th Vsync 2D sprite.
[0040]
As shown in FIG. 6, in the 2D processing subroutine, first, in
[0041]
In the
[0042]
Next, the width Wsprt of the 2D sprite to be synthesized is calculated by the following equation (4). In Expression (4), the angle RR is a horizontal direction of an angle formed by a predetermined direction vector Vfront of the character (3D model) in the front direction and a direction vector from the character position to the virtual camera position direction. It represents the component (angle). Here, the direction vector is a unit vector having no meaning with respect to the size (length), and means a vector in which only the direction has meaning. Equation (4) is used to calculate the width when the elliptical character (3D model) is viewed from the virtual camera when viewed from the relative angle calculated in
[0043]
[Expression 4]
[0044]
Next, the transparency of the two 2D sprites is calculated. In this transparency calculation, the transparency Aa of the 2D sprite closer to the angle RR out of the two 2D sprites to be synthesized is set to be completely opaque (Aa = 1.0). The reason why the 2D sprite closer to the angle RR is made completely opaque is that, for the sake of the compositing process, when the translucent 2D sprites are combined, the blur of the composite image is prevented from increasing, and the background This is for avoiding the inconvenience of being seen through. If the rendering angle of the 2D sprite closer to the angle RR is set to Ra (in accordance with the example shown in FIG. 9A), R1) On the other hand, the rendering angle of the other 2D sprite (distant from the angle RR) is Rb (in accordance with the example shown in FIG. 9A).2), The transparency Ab of the other 2D sprite can be obtained by the following equation (5). Equation (5) converts the ratio of the difference between the rendering angle of two 2D sprites and the difference obtained by subtracting one of the rendering angles from the angle RR into a length, and directly converts the ratio to the transparency of the other 2D sprite. It is reflected, and the transparency is calculated from the ratio of the angles of the two 2D sprites. The transparency Ab calculated by Expression (5) is set as the transparency of the other 2D sprite. The transparency Ab takes a value of 0.0 to 0.5 (the transparency is completely opaque at a maximum value of 1.0 and completely transparent at a minimum value of 0.0).
[0045]
[Equation 5]
[0046]
Then, after synthesizing two 2D sprites with transparency of 1.0 and transparency Ab (overlapping in the same place), the horizontal width of the synthesized 2D sprite was calculated by the above equation (4). A combined 2D sprite is obtained by expanding and contracting left and right (horizontal direction) so as to have a width Wsprt. The CPU transfers two 2D sprite identification, transparency Ab and width Wsprt information to the
[0047]
Next, in
[0048]
If the determination is affirmative, in the
[0049]
As will be described later, ten vertices V1 to V10 (see FIG. 14B) are defined in the 2D sprite. The screen coordinate values obtained by perspective-transforming each vertex of the 2D sprite are (Xx + X1, Yx + Y1), where (Xx, Yx) is the screen coordinate value obtained by perspective-transforming the (center) position of the 3D model. ), (Xx + X2, Yx + Y2),... (Xx + X10, Yx + Y10), and the final screen coordinate values of the vertices of the 2D sprite are calculated by performing the following expression (6) on Y1 to Y10. (Xx + X1, Yx + Y1x), (Xx + X2, Yx + Y2x),... (Xx + X10, Yx + Y10x) are obtained. The CPU transfers the information on the shear deformation coefficient to the
[0050]
[Formula 6]
[0051]
On the other hand, when a negative determination is made in
[0052]
Next, in
[0053]
Here, the pseudo-normal vector of the 2D sprite of this embodiment will be described in relation to the shading process in
[0054]
More specifically with reference to FIG. 14B, the values of the pseudo normal vectors at the vertices V1, V2,... V10 of the 2D sprite are represented by N1, N2,. The direction vector of the parallel light source that affects the N10, 2D sprite is Cdir as shown in the following equation (8), and the color (RGB) value of the parallel light source is shown as Ccol, ambient (environment light) as shown in the following equation (9). ) The color (RGB) value is Camb as shown in the following expression (10), and the color value at each vertex V is calculated for the pseudo-normal vector N.
[0055]
[Expression 7]
[0056]
[Equation 8]
[0057]
First, NN1 is calculated from the pseudo-normal vector N1 by the following equation (11), and the color (RGB) value Vcol1 of the vertex V1 is obtained by the following equation (12).
[0058]
[Equation 9]
[0059]
[Expression 10]
[0060]
Similar processing is performed on the pseudo-normal vectors N2 to N10, and the color values of all the vertices are calculated. The vertices of the 2D character and the color values near them change linearly, but such processing is performed by the
[0061]
When the shadow processing and 2D processing subroutine for the target character is completed in
[0062]
In
[0063]
(Action etc.)
As described above, in the present embodiment, a character positioned within 50 m on the 3D virtual space from the virtual camera is drawn with a 3D character, and a character farther than 50 m on the 3D virtual space from the virtual camera is displayed with a 2D character. Since the drawing is performed (
[0064]
In this embodiment, when creating and preparing a 2D sprite based on a rendering image of 3D polygon data, animation data of the 2D sprite is generated based on each motion data so as to correspond to the motion of the character during 3D display. Is created and prepared (see Fig. 10), so even if the character drawing is switched from 3D to 2D or from 2D to 3D sequentially, the disagreement and discontinuity of the posture, direction, etc. between the two at the moment of switching are eliminated. Therefore, the uncomfortable feeling of the dynamic image in which 3D and 2D characters are mixed can be eliminated, and high drawing quality can be ensured. In this case, in the present embodiment, since it is possible to omit the preparation of 2D sprites corresponding to frames with little dynamic change among the prepared 2D sprites, the VRAM usage area of the
[0065]
Furthermore, in this embodiment, as shown in FIG. 10B, pseudo normal vectors are formed in advance at the vertices of the 2D sprite so as to correspond to the 3D polygon data, and the shading process is performed in real time. (Step 172), it is possible to make a character that can only be seen as a 2D display even if it is far from the virtual camera look like a 3D display. Accordingly, in the present embodiment, such shading processing not only passively eliminates the sense of incongruity of the mixed image of 3D and 2D characters, but also performs processing to make the 2D character closer to the 3D character.
[0066]
In this embodiment, an example in which the relative angle is an angle formed by the direction connecting the character position and the virtual camera position and the front direction of the character is shown, but as a simple method, the direction of the virtual camera and An angle formed by the front direction of the character (an angle in the front direction of the character in the screen coordinate system) may be used as a relative angle.
[0067]
Further, in the present embodiment, an example in which 3D and 2D images can be switched for each 1 Vsync has been shown. However, when creating a 3D model motion rendering image, the sampling time as 2D sprite data is used as it is. It may be. In this case, the sampling time (for example, 1, 2, 5 frames) may be recorded as data, and the drawing may be switched when the sampling time elapses when the 2D sprite is drawn. In such an aspect, the determination as to which of the 3D and 2D characters should be drawn may be made every time the sampling time of each motion of the target character elapses. In addition, the time zone in which the motion (posture change) is small in the motion of the 3D character may be sampled roughly, and the time zone in which the motion is large may be sampled finely.
[0068]
Furthermore, in this embodiment, the example in which the position and direction of the virtual camera are changed when there is an input from the
[0069]
And in this embodiment, as shown to FIG. 14 (A), although the example which assumed the external shape of the soldier as a character as a cylinder was shown, it does not necessarily need to be considered as a cylinder, The shape approximated to a character This makes it possible to easily set the direction of the pseudo normal vector.
[0070]
【The invention's effect】
As explained above, the present inventionFirst, fourth, fifth and eighth aspectsAccording to the above, an object character located within a predetermined distance from the virtual camera, that is, an object character close to the virtual camera is drawn with a three-dimensional character, and an object character located outside the predetermined distance from the virtual camera, ie, from the virtual camera. Since a distant object character is drawn with a two-dimensional character, the sense of discomfort of an image in which the three-dimensional character and the two-dimensional character are mixed can be alleviated, and only a predetermined number of object characters within a predetermined distance can be reduced with a three-dimensional character. Since it is drawn, the amount of computation of 3D image processing can be reduced.In addition, for a two-dimensional character, a total number of omnidirectional directions prepared in advance from a horizontal component angle of a relative angle formed by the direction connecting the position of the object character and the position of the virtual camera and the front direction of the object character. The two closest 2D sprite data are selected and combined so that the width of the object character is viewed at the relative angle, and the combined 2D sprite data is sheared and deformed according to the vertical component angle of the relative angle. As a result, when a two-dimensional character far away from the virtual camera is viewed, the appropriate width and height are reflected in the horizontal and vertical directions, reducing the sense of incongruity of the image in which the three-dimensional character and the two-dimensional character are mixed. In addition, for all directions in the whole sky, between directions with a large amount of change in width, between directions with a small amount of change in width Having classified finer than can be synthesized elongate 2D sprite obtain a proper composite imageThe effect that can be obtained.
Further, according to the aspects of the second, fourth, sixth and ninth aspects of the present invention, an object character positioned within a predetermined distance from the virtual camera is drawn with a three-dimensional character, and the object character outside the predetermined distance from the virtual camera is drawn. Since the object character positioned at 2 is drawn with a two-dimensional character, the sense of discomfort of the image in which the three-dimensional character and the two-dimensional character are mixed can be alleviated, and only the object character within a predetermined distance and within a predetermined number can be reduced. In this case, the calculation amount of the three-dimensional image processing can be reduced, and a plurality of two-dimensional sprite data prepared in advance in all directions can be taken by a three-dimensional character having limbs or legs. Since it is prepared as multiple animation data corresponding to the motion, Even if the drawing of the character is switched from the 3D character to the 2D character or vice versa, the disagreement / discontinuity of the posture, direction, etc. between the two at the moment of switching can be eliminated. It is possible to eliminate a sense of incongruity in a dynamic image in which two-dimensional characters are mixed, and to eliminate two-dimensional sprite data corresponding to a frame with little dynamic change from animation data to be prepared. The storage capacity can be reduced.
According to the third, fourth, seventh and tenth aspects of the present invention, an object character positioned within a predetermined distance from the virtual camera is rendered as a three-dimensional character, and is positioned outside the predetermined distance from the virtual camera. Since the object character to be drawn is drawn with a two-dimensional character, the sense of discomfort of the image in which the three-dimensional character and the two-dimensional character are mixed can be alleviated, and the object character within a predetermined distance and within a predetermined number is drawn with the three-dimensional character. Therefore, the calculation amount of 3D image processing can be reduced, and the vertex coordinates and the shading pseudo-normal vector are included in advance in the 2D sprite data so as to correspond to the 3D polygon data. So, shading by the quasi-normal vector of the vertex of 2D sprite It is possible to perform shading), the two-dimensional character can show ish three-dimensional character, it is possible to obtain an effect that.
[Brief description of the drawings]
FIG. 1 is a schematic perspective view showing a connection mode of a consumer game device.
FIGS. 2A and 2B show an input device used in a home game device, in which FIG. 2A is a plan view and FIG. 2B is a front view when viewed from the direction of arrow B in FIG.
FIG. 3 is a block diagram illustrating a schematic configuration of the game apparatus main body according to the embodiment.
FIG. 4 is a schematic flowchart of a battle processing routine executed by the CPU of the game apparatus main body.
FIG. 5 is a flowchart of a 3D2D processing subroutine showing details of
FIG. 6 is a flowchart of a 2D processing subroutine showing details of
FIGS. 7A and 7B are explanatory diagrams showing the relationship between the tilt position of the right analog stick and the viewpoint, in which FIG. 7A is a plan view showing a possible input range when the right analog stick is tilted, and FIG. It is a top view explaining a direction and direction.
FIG. 8 is an explanatory diagram showing a field of view of a virtual camera.
9A and 9B are explanatory diagrams when rendering a 3D model into a 2D sprite, where FIG. 9A shows a rendering angle with respect to the whole sky, and FIG. 9B shows a rendering direction (0) to (4) in FIG. This is a 2D sprite when a 3D model horse is rendered.
10A and 10B are explanatory diagrams showing 3D and 2D image data, in which FIG. 10A shows 3D motion data, and FIG. 10B shows 2D animation data.
11A and 11B are explanatory views schematically showing an angle φ, where FIG. 11A shows a 3D model viewed from a virtual camera, and FIG. 11B shows a 3D model projected onto a plane C from the virtual camera. Show the time.
FIGS. 12A and 12B are explanatory diagrams schematically showing an angle θ, where FIG. 12A shows the 3D model viewed from the virtual camera, and FIG. 12B shows the 3D model projected onto the plane C from the virtual camera; Show the time.
13A and 13B are explanatory views schematically showing shear deformation and rotational deformation of 2D sprites, in which FIG. 13A shows 2D sprites before shear deformation, FIG. 13B shows 2D sprites after shear deformation, and (C ) Shows a 2D sprite before rotational deformation, and (D) shows a 2D sprite after rotational deformation.
14A and 14B are explanatory diagrams schematically showing pseudo-normal vectors at the vertices of a 2D sprite. FIG. 14A shows a normal vector when a normal vector is assumed to be a cylinder, and FIG. 14B shows a 2D sprite. The pseudo normal vector at the vertex is shown, and (C) shows the direction when it is assumed that the pseudo normal vector at the vertex of the 2D sprite is viewed from above.
FIG. 15 is an example of a halftone image displayed on a television monitor when a battle processing routine is executed.
[Explanation of symbols]
1 Recording medium
2 Game console (image generator)
20 CPU block (part of determination means and drawing means)
23 Image processing unit (part of drawing means)
Claims (16)
仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段、
前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段、
として機能させ、前記全天周多数方向は、前記幅の変化量の大きい方向間が前記幅の変化量の小さい方向間に比べて細かく区分されていることを特徴とするプログラム。A program for generating an image in which a large number of object characters of a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space, ,
Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera A determining means for determining that an object character positioned inside and outside the predetermined distance or exceeding the predetermined number is drawn by the two-dimensional character;
Based on the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn in step 2, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. From the sprite data, two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected and synthesized so as to have a width when the object character is viewed from the virtual camera at the relative angle. , The synthesized two-dimensional scan Drawing means for drawing the two-dimensional character and shear deformation in response to write data to the angle formed by the vertical component direction of the relative angle,
In the all-sky multi-direction, the direction in which the amount of change in the width is large is divided more finely than the direction in which the amount of change in the width is small .
仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段、Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera A determining means for determining that an object character positioned inside and outside the predetermined distance or exceeding the predetermined number is drawn by the two-dimensional character;
前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画Based on the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is rendered for the object character determined to be rendered in step S3, and the three-dimensional polygon data rendering image is rendered for the object character determined to be rendered with the two-dimensional character. 像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段、Two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected from the two-dimensional sprite data of all-round multi-directional prepared in advance based on the image, and the relative camera is selected from the virtual camera. The two-dimensional character is drawn by combining the two-dimensional sprite data with an angle formed by the angle of the vertical component direction of the relative angle. Drawing means,
として機能させ、前記予め用意された全天周多数方向の2次元スプライトデータは、手足又は足を有する前記3次元キャラクタがとり得る複数のモーションに対応するように複数のアニメーションデータとして準備されており、前記アニメーションデータのうち動的変化の少ないフレームに対応する2次元スプライトデータが省かれたことを特徴とするプログラム。The two-dimensional sprite data in all directions prepared in advance is prepared as a plurality of animation data so as to correspond to a plurality of motions that can be taken by the three-dimensional character having limbs or feet. A program characterized in that two-dimensional sprite data corresponding to a frame with little dynamic change is omitted from the animation data.
仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段、
前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段、
として機能させ、前記2次元スプライトデータは、前記3次元ポリゴンデータに対応するように頂点座標及びシェーディング用の疑似法線ベクトルを予め含むことを特徴とするプログラム。 A program for generating an image in which a large number of object characters of a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space, ,
Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera A determining means for determining that an object character positioned inside and outside the predetermined distance or exceeding the predetermined number is drawn by the two-dimensional character;
Based on the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn in step 2, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. From the sprite data, two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected and synthesized so as to have a width when the object character is viewed from the virtual camera at the relative angle. , The synthesized two-dimensional scan Drawing means for drawing the two-dimensional character and shear deformation in response to write data to the angle formed by the vertical component direction of the relative angle,
To function as the two-dimensional sprite data, the program characterized by comprising pre pseudo-normal vector for vertex coordinates and shading to correspond to the three-dimensional polygon data.
仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段と、
前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段と、
を備え、前記全天周多数方向は、前記幅の変化量の大きい方向間が前記幅の変化量の小さい方向間に比べて細かく区分されていることを特徴とする画像生成装置。In an image generation apparatus that generates an image in which a large number of object characters, a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data, are mixed in a 3D virtual space,
Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera A determining means for determining that an object character positioned inside and outside the predetermined distance or exceeding the predetermined number is to be drawn by the two-dimensional character;
Based on the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn in step 2, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. From the sprite data, two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected and synthesized so as to have a width when the object character is viewed from the virtual camera at the relative angle. , The synthesized two-dimensional scan And drawing means for drawing the two-dimensional character and shear deformation in response to write data to the angle formed by the vertical component direction of the relative angle,
An image generating apparatus comprising: a plurality of all sky directions, wherein a direction in which the width change amount is large is divided more finely than a direction in which the width change amount is small .
仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段と、 Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera A determining means for determining that an object character positioned inside and outside the predetermined distance or exceeding the predetermined number is to be drawn by the two-dimensional character;
前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段と、Based on the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn in step 2, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. From the sprite data, two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected and synthesized so as to have a width when the object character is viewed from the virtual camera at the relative angle. , The synthesized two-dimensional scan And drawing means for drawing the two-dimensional character and shear deformation in response to write data to the angle formed by the vertical component direction of the relative angle,
を備え、前記予め用意された全天周多数方向の2次元スプライトデータは、手足又は足を有する前記3次元キャラクタがとり得る複数のモーションに対応するように複数のアニメーションデータとして準備されており、前記アニメーションデータのうち動的変化の少ないフレームに対応する2次元スプライトデータが省かれたことを特徴とする画像生成装置。The prepared two-dimensional sprite data for all directions in all directions is prepared as a plurality of animation data so as to correspond to a plurality of motions that can be taken by the three-dimensional character having limbs or feet, An image generating apparatus, wherein two-dimensional sprite data corresponding to a frame with little dynamic change is omitted from the animation data.
仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定する決定手段と、 Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera A determining means for determining that an object character positioned inside and outside the predetermined distance or exceeding the predetermined number is to be drawn by the two-dimensional character;
前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する描画手段と、Based on the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn in step 2, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. From the sprite data, two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected and synthesized so as to have a width when the object character is viewed from the virtual camera at the relative angle. , The synthesized two-dimensional scan And drawing means for drawing the two-dimensional character and shear deformation in response to write data to the angle formed by the vertical component direction of the relative angle,
を備え、前記2次元スプライトデータは、前記3次元ポリゴンデータに対応するように頂点座標及びシェーディング用の疑似法線ベクトルを予め含むことを特徴とする画像生成装置。And the two-dimensional sprite data includes vertex coordinates and a pseudo-normal vector for shading so as to correspond to the three-dimensional polygon data.
仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定し、
前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する、
ステップを含み、前記全天周多数方向は、前記幅の変化量の大きい方向間が前記幅の変化量の小さい方向間に比べて細かく区分されていることを特徴とする画像生成方法。An image generation method for generating an image in which a large number of object characters of a 3D character drawn with 3D polygon data and a 2D character drawn with 2D sprite data are mixed in a 3D virtual space,
Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera Determining that an object character positioned within and outside the predetermined distance or exceeding the predetermined number is to be drawn with the two-dimensional character;
Based on the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn in step 2, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. From the sprite data, two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected and synthesized so as to have a width when the object character is viewed from the virtual camera at the relative angle. , The synthesized two-dimensional scan And shear deformation to render the two-dimensional character in accordance with write data to the angle formed by the vertical component direction of the relative angle,
Step only contains the entire Tenshu many directions, the image generation method characterized by inter direction of larger amount of change in the width is finely divided than between small direction-changing amount of said width.
仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決定し、Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera Determining that an object character positioned within and outside the predetermined distance or exceeding the predetermined number is to be drawn with the two-dimensional character;
前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する、Based on the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn with the two-dimensional character, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. From the sprite data, two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected and combined so as to have a width when the object character is viewed from the virtual camera at the relative angle. , The synthesized two-dimensional scan And shear deformation to render the two-dimensional character in accordance with write data to the angle formed by the vertical component direction of the relative angle,
ステップを含み、前記予め用意された全天周多数方向の2次元スプライトデータは、手足又は足を有する前記3次元キャラクタがとり得る複数のモーションに対応するように複数のアニメーションデータとして準備されており、前記アニメーションデータのうち動的変化の少ないフレームに対応する2次元スプライトデータが省かれたことを特徴とする画像生成方法。The two-dimensional sprite data in all directions including the steps is prepared as a plurality of animation data so as to correspond to a plurality of motions that can be taken by the three-dimensional character having limbs or feet. An image generation method, wherein two-dimensional sprite data corresponding to a frame with little dynamic change is omitted from the animation data.
仮想カメラの位置及び方向情報と前記オブジェクトキャラクタの位置情報とに基づいて、前記仮想カメラの視界内かつ所定距離内に位置する所定数内のオブジェクトキャラクタを前記3次元キャラクタで、前記仮想カメラの視界内かつ前記所定距離の外に位置するか又は前記所定数を越えるオブジェクトキャラクタを前記2次元キャラクタで描画すると決Based on the position and direction information of the virtual camera and the position information of the object character, a predetermined number of object characters located within the visual field of the virtual camera and within a predetermined distance are the three-dimensional characters, and the visual field of the virtual camera It is determined that an object character that is located outside the predetermined distance or exceeds the predetermined number is drawn with the two-dimensional character. 定し、And
前記3次元仮想空間上の前記オブジェクトキャラクタの位置に、前記オブジェクトキャラクタの位置と前記仮想カメラの位置とを結ぶ方向と、前記オブジェクトキャラクタの正面方向とがなす相対角度に基づいて、前記3次元キャラクタで描画すると決定したオブジェクトキャラクタについて前記3次元キャラクタを描画し、前記2次元キャラクタで描画すると決定したオブジェクトキャラクタについて3次元ポリゴンデータのレンダリング画像に基づいて予め用意された全天周多数方向の2次元スプライトデータの中から前記相対角度の水平方向成分がなす角度に最も近い2つの2次元スプライトデータを選択して前記仮想カメラから前記相対角度で前記オブジェクトキャラクタをみたときの幅となるように合成し、該合成された2次元スプライトデータを前記相対角度の垂直成分方向がなす角度に応じてせん断変形して前記2次元キャラクタを描画する、Based on the relative angle formed by the direction connecting the position of the object character and the position of the virtual camera to the position of the object character in the three-dimensional virtual space and the front direction of the object character, The three-dimensional character is drawn with respect to the object character determined to be drawn with the two-dimensional character, and the object character determined to be drawn with the two-dimensional character is preliminarily prepared based on the rendering image of the three-dimensional polygon data. From the sprite data, two two-dimensional sprite data closest to the angle formed by the horizontal component of the relative angle are selected and synthesized so as to have a width when the object character is viewed from the virtual camera at the relative angle. , The synthesized two-dimensional scan And shear deformation to render the two-dimensional character in accordance with write data to the angle formed by the vertical component direction of the relative angle,
ステップを含み、前記2次元スプライトデータは、前記3次元ポリゴンデータに対応するように頂点座標及びシェーディング用の疑似法線ベクトルを予め含むことを特徴とする画像生成方法。An image generating method, wherein the two-dimensional sprite data includes vertex coordinates and a pseudo-normal vector for shading in advance so as to correspond to the three-dimensional polygon data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001334010A JP3760341B2 (en) | 2001-10-31 | 2001-10-31 | Program, recording medium, image generation apparatus, and image generation method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2001334010A JP3760341B2 (en) | 2001-10-31 | 2001-10-31 | Program, recording medium, image generation apparatus, and image generation method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2003141560A JP2003141560A (en) | 2003-05-16 |
| JP3760341B2 true JP3760341B2 (en) | 2006-03-29 |
Family
ID=19149203
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2001334010A Expired - Fee Related JP3760341B2 (en) | 2001-10-31 | 2001-10-31 | Program, recording medium, image generation apparatus, and image generation method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3760341B2 (en) |
Families Citing this family (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4528008B2 (en) * | 2004-03-24 | 2010-08-18 | 株式会社バンダイナムコゲームス | Program, information storage medium, and image generation system |
| JP4180065B2 (en) * | 2005-05-13 | 2008-11-12 | 株式会社スクウェア・エニックス | Image generation method, image generation apparatus, and image generation program |
| JP4177381B2 (en) | 2006-03-01 | 2008-11-05 | 株式会社スクウェア・エニックス | Image generation method, image generation apparatus, and image generation program |
| JP2007312938A (en) * | 2006-05-24 | 2007-12-06 | Aruze Corp | Game machine and simulation program |
| JP5320334B2 (en) * | 2009-09-24 | 2013-10-23 | 株式会社東芝 | Image processing apparatus and program |
| US8411092B2 (en) * | 2010-06-14 | 2013-04-02 | Nintendo Co., Ltd. | 2D imposters for simplifying processing of plural animation objects in computer graphics generation |
| JP6960214B2 (en) * | 2016-01-29 | 2021-11-05 | グリー株式会社 | Programs, game control methods, and information processing equipment |
| JP6208785B2 (en) * | 2016-01-29 | 2017-10-04 | グリー株式会社 | Program, game control method, and information processing apparatus |
| JP6823946B2 (en) * | 2016-06-13 | 2021-02-03 | 三菱プレシジョン株式会社 | How to draw figures, drawing devices and simulators |
| JP7335695B2 (en) * | 2018-12-28 | 2023-08-30 | 株式会社バンダイナムコエンターテインメント | Image generation system and program |
| JP7740241B2 (en) * | 2020-07-01 | 2025-09-17 | ソニーグループ株式会社 | Information processing device, information processing method, and program |
| CN116440495A (en) * | 2022-01-07 | 2023-07-18 | 腾讯科技(深圳)有限公司 | Scene picture display method and device, terminal and storage medium |
| CN117919704A (en) * | 2024-02-19 | 2024-04-26 | 网易(杭州)网络有限公司 | Virtual scene rendering method and device, electronic equipment and storage medium |
-
2001
- 2001-10-31 JP JP2001334010A patent/JP3760341B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2003141560A (en) | 2003-05-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7116329B2 (en) | Image processing method | |
| US5966132A (en) | Three-dimensional image synthesis which represents images differently in multiple three dimensional spaces | |
| US20090244064A1 (en) | Program, information storage medium, and image generation system | |
| JPWO1995035139A1 (en) | Three-dimensional simulator device and image synthesis method | |
| US7277571B2 (en) | Effective image processing, apparatus and method in virtual three-dimensional space | |
| JP3760341B2 (en) | Program, recording medium, image generation apparatus, and image generation method | |
| JP4305903B2 (en) | Image generation system, program, and information storage medium | |
| JP4161613B2 (en) | Image processing method | |
| JP3748451B1 (en) | Program, information storage medium, and image generation system | |
| JP4717622B2 (en) | Program, information recording medium, and image generation system | |
| JP4804122B2 (en) | Program, texture data structure, information storage medium, and image generation system | |
| JPH1074270A (en) | Three-dimensional game device and information storage medium | |
| JP4749198B2 (en) | Program, information storage medium, and image generation system | |
| JP2010033297A (en) | Program, information storage medium, and image generation system | |
| JP4073031B2 (en) | Program, information storage medium, and image generation system | |
| JP4786389B2 (en) | Program, information storage medium, and image generation system | |
| JP2006252426A (en) | Program, information storage medium, and image generation system | |
| JP2011215724A (en) | Program, information storage medium, and image generation system | |
| JP2011095937A (en) | Program, information storage medium and image generation system | |
| JP4806578B2 (en) | Program, information storage medium, and image generation system | |
| JP4913399B2 (en) | Program, information storage medium, and image generation system | |
| JP4662260B2 (en) | Program, information storage medium, and image generation system | |
| JP4624527B2 (en) | GAME SYSTEM AND INFORMATION STORAGE MEDIUM | |
| JP4641831B2 (en) | Program, information storage medium, and image generation system | |
| JP2010033285A (en) | Program, information storage medium, and image generation system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050720 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050802 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050921 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20051213 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20051222 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120120 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150120 Year of fee payment: 9 |
|
| LAPS | Cancellation because of no payment of annual fees |