JP3586679B2 - 3D game image processing program, 3D game image processing method, and video game apparatus - Google Patents

3D game image processing program, 3D game image processing method, and video game apparatus Download PDF

Info

Publication number
JP3586679B2
JP3586679B2 JP2002137528A JP2002137528A JP3586679B2 JP 3586679 B2 JP3586679 B2 JP 3586679B2 JP 2002137528 A JP2002137528 A JP 2002137528A JP 2002137528 A JP2002137528 A JP 2002137528A JP 3586679 B2 JP3586679 B2 JP 3586679B2
Authority
JP
Japan
Prior art keywords
model
polygon
normal vector
reference model
shading
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 - Lifetime
Application number
JP2002137528A
Other languages
Japanese (ja)
Other versions
JP2003331312A (en
Inventor
清和 高橋
Original Assignee
株式会社コナミコンピュータエンタテインメントスタジオ
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社コナミコンピュータエンタテインメントスタジオ filed Critical 株式会社コナミコンピュータエンタテインメントスタジオ
Priority to JP2002137528A priority Critical patent/JP3586679B2/en
Publication of JP2003331312A publication Critical patent/JP2003331312A/en
Application granted granted Critical
Publication of JP3586679B2 publication Critical patent/JP3586679B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、仮想ゲーム空間内において、複数のポリゴンで構成されるモデルを描画する3次元ゲーム画像処理プログラム、3次元ゲーム画像処理方法及びビデオゲーム装置に関するものである。
【0002】
【従来の技術】
従来、3次元仮想空間内で行われるゲームでは、複数のポリゴンで構成されるポリゴンモデルに対して輪郭線を付すことによってアニメーションのような表現を行う技法が知られており、ポリゴンモデルに輪郭線を付すことによって背景となる画像との差別化(輪郭誇張)を図り、対象となるポリゴンモデルを際立たせて表現することが行われている。
【0003】
例えば特開2000−251094号公報には、ポリゴンモデルである基準モデルに対して輪郭線を付す処理を行う場合、メモリから輪郭線を付す基準モデルのデータを読み出し、当該基準モデルを所定の比率で拡大させた拡大モデルを作成してメモリに一旦保持し、この拡大モデルを基準モデルに重ね合わせるジオメトリ処理を行い、さらに、拡大モデルを構成する各ポリゴンの法線ベクトルを反転させてから、両モデルを背景となる画像に重ねるレンダリング処理を行っているものが記載されている。かかる画像処理を施すことで輪郭線が付されたモデルをモニタ上に表示することができる。
【0004】
【発明が解決しようとする課題】
上記のような画像処理方法でポリゴンモデルに輪郭線を付してシェーディング処理を施す場合、ポリゴンモデルの本体部分と輪郭線部分とで影の濃淡が異なって表示されてしまう。これは、ポリゴンモデルの本体部分である基準モデルを構成する各ポリゴンのシェーディング処理用の法線ベクトルと、ポリゴンモデルの輪郭線部分である拡大モデルを構成する各ポリゴンのシェーディング処理用の法線ベクトルとが互いに反対の方向を向いているため起こるものである。そこで、上記従来の画像処理方法では、基準モデル及び拡大モデルを光源の影響を受けないコンスタント状態にすることによって、輪郭線部分の影の濃淡をなくしてしまっている。
【0005】
しかしながら、ビデオゲームの種類やビデオゲームの進行状況によっては、ポリゴンモデルにシェーディング処理を施したほうがよい場合もあり、従来の画像処理方法では、上記の理由でポリゴンモデルの本体部分及び輪郭線部分に同じ影の濃淡を施すことが困難であった。
【0006】
したがって本発明は、上記の問題を解決するためになされたもので、複数のポリゴンで構成されるモデルに輪郭線を付すことができ、且つ適切なシェーディング処理を行うことができる3次元ゲーム画像処理プログラム、3次元ゲーム画像処理方法及びビデオゲーム装置を提供することである。
【0007】
【課題を解決するための手段】
請求項1に記載の本発明は、仮想ゲーム空間内に複数のポリゴンで構成されるモデルを描画する3次元ゲーム画像処理プログラムであって、
複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを前記基準モデルに重ねて縁付きモデルとし、当該縁付きモデルの各ポリゴンのシェーディング処理用法線ベクトルに基づいてシェーディング処理を行うシェーディング処理手段と、
前記縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画手段としてビデオゲーム装置を機能させることを特徴とする。
【0008】
請求項1に記載の本発明に従えば、仮想ゲーム空間内に複数のポリゴンで構成されるモデルを描画する3次元ゲーム画像処理プログラムは、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとし、縁付きモデルの各ポリゴンのシェーディング処理用法線ベクトルに基づいてシェーディング処理を行うシェーディング処理手段と、縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画手段としてビデオゲーム装置を機能させる。
【0009】
すなわち、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとし、縁付きモデルの各ポリゴンのシェーディング処理用法線ベクトルに基づいてシェーディング処理が行われ、縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみが描画される。
【0010】
したがって、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとすることで、裏モデルを基準モデルの輪郭線として描画することができる。
【0011】
また、輪郭線となる裏モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向と同じ方向に設定することで、基準モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、複数のポリゴンで構成される基準モデルに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0012】
また、本発明は、あらかじめ作成した前記縁付きモデルを記憶する記憶手段として前記ビデオゲーム装置をさらに機能させることも可能である。
【0013】
この構成によれば、ビデオゲーム装置は、あらかじめ作成した縁付きモデルを記憶する記憶手段としてさらに機能する。
【0014】
すなわち、複数のポリゴンで構成される基準モデルを拡大し、拡大された各ポリゴンの表裏を判別するポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定した裏モデルを基準モデルに重ねた縁付きモデルがあらかじめ記憶されているため、基準モデルを拡大した裏モデルと基準モデルとを重ね合わせた後、この裏モデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルの方向を変えるジオメトリ処理を行う必要がなくなり、このジオメトリ処理にかかる時間を短縮することができる。
【0015】
さらに、本発明は、前記ポリゴン表裏判別用法線ベクトルを前記縁付きモデルを構成する各ポリゴンの面法線ベクトルとし、前記シェーディング処理用法線ベクトルを前記縁付きモデルを構成する各ポリゴンの各頂点における法線ベクトルとすることも可能である。
【0016】
この構成によれば、縁付きモデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルは縁付きモデルを構成する各ポリゴンの面法線ベクトルであり、縁付きモデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルは縁付きモデルを構成する各ポリゴンの各頂点における法線ベクトルである。
【0017】
すなわち、縁付きモデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルとして縁付きモデルを構成する各ポリゴンの面法線ベクトルが用いられるため、ポリゴンの表裏判別をポリゴンの面法線ベクトルの向きを求めることによって行うことができる。また、縁付きモデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルとして縁付きモデルを構成する各ポリゴンの各頂点における法線ベクトルが用いられるため、例えば、グーローシェーディング処理等の各ポリゴンの頂点の法線ベクトルを用いてシェーディング処理を行うことができる。
【0018】
さらにまた、本発明は、前記裏モデルは前記基準モデルよりポリゴン数を少なくすることも可能である。
【0019】
この構成によれば、裏モデルを構成するポリゴンは基準モデルを構成するポリゴンよりポリゴン数が少ない。
【0020】
すなわち、例えば、ビデオゲームに登場するキャラクタにリアル感を出す場合、基準モデルは多くの細かいポリゴンで構成する必要がある。しかしながら、例えば、輪郭線を単一色で表現する場合、輪郭線となる裏モデルは多くの細かいポリゴンで構成する必要はない。したがって、裏モデルは輪郭線に影響を与えないポリゴンの数を減らすことによって、基準モデルと裏モデルとを重ね合わせた縁付きモデルが簡略化され、描画処理に要する時間を短縮することができる。さらに、裏モデルを構成するポリゴン数を減らすことによって、裏モデルを構成する各ポリゴンの各頂点に対応付けられるデータを記憶するために使用されるメモリ領域を低減することができる。
【0021】
さらにまた、本発明は、前記裏モデルを構成するポリゴンは、前記基準モデルが段差部を有する場合、当該基準モデルの段差部における最端部上の頂点と、当該頂点に対応する裏モデルの頂点とで構成されるポリゴンを含むことも可能である。
【0022】
この構成によれば、裏モデルを構成するポリゴンは、基準モデルが段差部を有する場合、当該基準モデルの段差部における最端部上の頂点と、当該頂点に対応する裏モデルの頂点とで構成されるポリゴンを含む。
【0023】
すなわち、基準モデルが段差部を有する場合、当該基準モデルの段差部における最端部上の頂点と、当該頂点に対応する裏モデルの段差部における最端部上の頂点とで構成されるポリゴンが輪郭線として描画されるため、縁付きモデルの表示に際して、基準モデルから離れて輪郭線が付いたり、ちらつきが起こるなどの不具合が解消され、きれいな縁付きモデルを表示することができるようになる。また、このような基準モデルが段差部を有する縁付きモデルにシェーディング処理を施した場合にも縁付きモデルの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、段差部を有する基準モデルに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0024】
さらにまた、本発明は、前記基準モデルは平面モデルを含み、
前記記憶手段は、前記平面モデルと、前記平面モデルを拡大すると共に厚みを付与して得られる拡大モデルの厚み方向に沿うポリゴンのポリゴン表裏判別用法線ベクトルの方向を拡大モデルの内側とする裏モデルとを重ね合わせた縁付きモデルを記憶することも可能である。
【0025】
この構成によれば、基準モデルは平面モデルを含み、記憶手段は、平面モデルと、平面モデルを拡大すると共に厚みを付与して得られる拡大モデルの厚み方向に沿うポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を拡大モデルの内側とする裏モデルとを重ね合わせた縁付きモデルを記憶する。
【0026】
すなわち、例えば厚みのない板状の平面モデルを拡大すると共に厚みを付与して得られる拡大モデルの厚み方向に沿うポリゴンのポリゴン表裏判別用法線ベクトルの方向を拡大モデルの内側とする裏モデルとすることによって、視点位置の変化に影響されることなく、平面モデルの縁付きモデルを描画することができる。また、このような平面モデルに輪郭線を付す場合にも平面モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と平面モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、平面モデルに輪郭線を付す場合に、輪郭線部分と平面モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0027】
さらにまた、本発明は、前記描画手段は、前記平面モデルのポリゴン表裏判別用法線ベクトルの方向にかかわらず描画することも可能である。
【0028】
この構成によれば、縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画手段は、平面モデルのポリゴン表裏判別用法線ベクトルの方向にかかわらず描画する。
【0029】
すなわち、描画手段によって、平面モデルが、当該平面モデルを構成するポリゴンのポリゴン表裏判別用法線ベクトルの方向にかかわらず描画されるため、例えば、平面ポリゴンの表面を表示する視点位置が、平面ポリゴンの裏面を表示する視点位置に移動した場合にも、視点位置の変化に影響されることなく、平面モデルの裏表に関係なく描画することができる。また、このように両面が描画可能である平面モデルに輪郭線を付す場合にも平面モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と平面モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、平面モデルに輪郭線を付す場合に、輪郭線部分と平面モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0030】
請求項2に記載の本発明は、仮想ゲーム空間内に複数のポリゴンで構成されるモデルを描画する3次元ゲーム画像処理方法であって、
ビデオゲーム装置が、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを前記基準モデルに重ねて縁付きモデルとし、当該縁付きモデルの各ポリゴンのシェーディング処理用法線ベクトルに基づいてシェーディング処理を行うシェーディング処理ステップと、
ビデオゲーム装置が、前記縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画ステップとを含むことを特徴とする。
【0031】
請求項2に記載の本発明に従えば、仮想ゲーム空間内に複数のポリゴンで構成されるモデルを描画する3次元ゲーム画像処理方法は、ビデオゲーム装置が、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとし、当該縁付きモデルの各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルに基づいてシェーディング処理を行うシェーディング処理ステップと、ビデオゲーム装置が、縁付きモデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画ステップとを含む。
【0032】
すなわち、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとし、縁付きモデルの各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルに基づいてシェーディング処理が行われ、縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみが描画される。
【0033】
したがって、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとすることで、裏モデルを基準モデルの輪郭線として描画することができる。
【0034】
また、輪郭線となる裏モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向と同じ方向に設定することで、基準モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、複数のポリゴンで構成される基準モデルに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0035】
請求項3に記載の本発明は、仮想ゲーム空間内に複数のポリゴンで構成されるモデルを描画するビデオゲーム装置であって、
複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを前記基準モデルに重ねて縁付きモデルとし、当該縁付きモデルの各ポリゴンのシェーディング処理用法線ベクトルに基づいてシェーディング処理を行うシェーディング処理手段と、
前記縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画手段とを備えることを特徴とする。
【0036】
請求項3に記載の本発明に従えば、仮想ゲーム空間内に複数のポリゴンで構成されるモデルを描画するビデオゲーム装置は、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとし、縁付きモデルの各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルに基づいてシェーディング処理を行うシェーディング処理手段と、縁付きモデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画手段とを備える。
【0037】
すなわち、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとし、シェーディング処理手段によって、縁付きモデルの各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルに基づいてシェーディング処理が行われ、描画処理手段によって、縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているか否かの判定が行われ、仮想カメラの視点位置の方向を向いているポリゴン表裏判別用法線ベクトルを有すると判定されたポリゴンにテクスチャマッピングが施され、表示メモリに取り込まれ、この表示メモリの内容が所定周期で読み出されることによって縁付きモデルが描画される。
【0038】
したがって、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとすることで、裏モデルを基準モデルの輪郭線として描画することができる。
【0039】
また、輪郭線となる裏モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向と同じ方向に設定することで、基準モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、複数のポリゴンで構成される基準モデルに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0040】
【発明の実施の形態】
以下、本発明の一実施の形態によるビデオゲーム装置について図面を参照しながら説明する。
【0041】
図1は本発明の一実施の形態のビデオゲーム装置の構成を示すブロック図である。なお、以下の説明では、ビデオゲーム装置の一例として家庭用ビデオゲーム機を家庭用テレビジョンに接続することによって構成される家庭用ビデオゲーム装置について説明するが、本発明はこの例に特に限定されず、モニタが一体に構成された業務用ビデオゲーム装置、ビデオゲームプログラムを実行することによってビデオゲーム装置として機能するパーソナルコンピュータ等にも同様に適用することができる。
【0042】
図1に示すビデオゲーム装置は家庭用ゲーム機100及び家庭用テレビジョン200を備える。家庭用ゲーム機100には、ビデオゲームプログラム及びゲームデータが記録されたコンピュータ読み出し可能な記録媒体300が装填され、ビデオゲームプログラム及びゲームデータが適宜読み出されてゲームが実行される。
【0043】
家庭用ゲーム機100は、CPU(Central Processing Unit)1、バスライン2、グラフィックスデータ生成プロセッサ3、インターフェース回路(I/F)4、メインメモリ5、ROM(Read Only Memory)6、伸張回路7、パラレルポート8、シリアルポート9、描画プロセッサ10、音声プロセッサ11、デコーダ12、インターフェース回路13、バッファ14〜16、記録媒体ドライブ17、メモリ18及びコントローラ19を含む。家庭用テレビジョン200はテレビジョンモニタ21、増幅回路22及びスピーカ23を含む。
【0044】
CPU1はバスライン2およびグラフィックスデータ生成プロセッサ3に接続されている。バスライン2はアドレスバス、データバス及びコントロールバス等を含み、CPU1、インターフェース回路4、メインメモリ5、ROM6、伸張回路7、パラレルポート8、シリアルポート9、描画プロセッサ10、音声プロセッサ11、デコーダ12及びインターフェース回路13を相互に接続している。
【0045】
描画プロセッサ10はバッファ14に接続される。音声プロセッサ11はバッファ15及び増幅回路22に接続される。デコーダ12はバッファ16及び記録媒体ドライブ17に接続される。インターフェース回路13はメモリ18及びコントローラ19に接続される。
【0046】
家庭用テレビジョン200のテレビジョンモニタ21は描画プロセッサ10に接続される。スピーカ23は増幅回路22に接続される。なお、業務用ビデオゲーム装置の場合、テレビジョンモニタ21、増幅回路22及びスピーカ23は、家庭用ゲーム機100を構成する各ブロックとともに1つの筺体に収納される場合がある。
【0047】
また、ビデオゲーム装置がパーソナルコンピュータやワークステーション等を核として構成されている場合、テレビジョンモニタ21等はコンピュータ用のディスプレイに対応する。また、伸張回路7、描画プロセッサ10及び音声プロセッサ11等は、それぞれ記録媒体300に記録されているプログラムデータの一部又はコンピュータの拡張スロットに搭載される拡張ボード上のハードウエアに対応する。また、インターフェース回路4、パラレルポート8、シリアルポート9及びインターフェース回路13は、コンピュータの拡張スロットに搭載される拡張ボード上のハードウエアに対応する。また、バッファ14〜16はそれぞれメインメモリ5又は拡張メモリの各記憶エリアに対応する。
【0048】
次に、図1に示す各構成要素について説明する。グラフィックスデータ生成プロセッサ3はCPU1のいわばコプロセッサとしての役割を果たす。すなわち、グラフィックスデータ生成プロセッサ3は座標変換や光源計算、例えば固定小数点形式の行列やベクトルの演算を並列処理によって行う。
【0049】
グラフィックスデータ生成プロセッサ3が行う主な処理としては、CPU1から供給される画像データの2次元又は3次元空間内における各頂点の座標データ、移動量データ、回転量データ等に基づいて、所定の表示エリア上における処理対象画像のアドレスデータを求めてCPU1に返す処理、仮想的に設定された光源からの距離に応じて画像の輝度を計算する処理等がある。
【0050】
インターフェース回路4は周辺デバイス、例えばマウスやトラックボール等のポインティングデバイス等のインターフェース用に用いられる。メインメモリ5はRAM(Random Access Memory)等で構成される。ROM6にはビデオゲーム装置のオペレーティングシステムとなるプログラムデータが記憶されている。このプログラムはパーソナルコンピュータのBIOS(Basic Input Output System)に相当する。
【0051】
伸張回路7は動画に対するMPEG(Moving Picture Experts Group)規格や静止画に対するJPEG(Joint Photographic Experts Group)規格に準拠したイントラ符号化によって圧縮された圧縮画像に対して伸張処理を施す。伸張処理はデコード処理(VLC:Variable Length Codeによってエンコードされたデータのデコード)、逆量子化処理、IDCT(Inverse Discrete Cosine Transform)処理、イントラ画像の復元処理等を含む。
【0052】
描画プロセッサ10は所定時間T(例えば、1フレームでT=1/60秒)ごとにCPU1が発行する描画命令に基づいてバッファ14に対する描画処理を行う。
【0053】
バッファ14は例えばRAMで構成され、表示エリア(フレームバッファ)と非表示エリアとに分けられる。表示エリアはテレビジョンモニタ21の表示面上に表示するデータの展開エリアで構成される。非表示エリアはスケルトンを定義するデータ、ポリゴンを定義するモデルデータ、モデルに動きを行わせるアニメーションデータ、各アニメーションの内容を示すパターンデータ、テクスチャデータ及びカラーパレットデータ等の記憶エリアで構成される。
【0054】
ここで、テクスチャデータは2次元の画像データである。カラーパレットデータはテクスチャデータ等の色を指定するためのデータである。記録媒体300から一度に又はゲームの進行状況に応じて複数回に分けて、CPU1はこれらのデータを予めバッファ14の非表示エリアに記録する。
【0055】
また、描画命令としては、ポリゴンを用いて立体的な画像を描画するための描画命令、通常の2次元画像を描画するための描画命令がある。ここで、ポリゴンは多角形の2次元仮想図形であり、例えば、三角形や四角形が用いられる。
【0056】
ポリゴンを用いて立体的な画像を描画するための描画命令は、ポリゴン頂点座標データのバッファ14の表示エリア上における記憶位置を示すポリゴン頂点アドレスデータ、ポリゴンに貼り付けるテクスチャのバッファ14上における記憶位置を示すテクスチャアドレスデータ、テクスチャの色を示すカラーパレットデータのバッファ14上における記憶位置を示すカラーパレットアドレスデータ及びテクスチャの輝度を示す輝度データのそれぞれに対して行われるものである。
【0057】
上記のデータのうち表示エリア上のポリゴン頂点アドレスデータは、グラフィックスデータ生成プロセッサ3がCPU1からの3次元空間上におけるポリゴン頂点座標データを移動量データ及び回転量データに基づいて座標変換することによって2次元上でのポリゴン頂点座標データに置換されたものである。輝度データはCPU1からの上記座標変換後のポリゴン頂点座標データによって示される位置から仮想的に配置された光源までの距離に基づいてグラフィックスデータ生成プロセッサ3によって決定される。
【0058】
ポリゴン頂点アドレスデータはバッファ14の表示エリア上のアドレスを示す。描画プロセッサ10は3個のポリゴン頂点アドレスデータで示されるバッファ14の表示エリアの範囲に対応するテクスチャデータを書き込む処理を行う。
【0059】
ゲーム空間内におけるキャラクタ等の物体は、複数のポリゴンで構成される。CPU1は各ポリゴンの3次元空間上の座標データを対応するスケルトンのベクトルデータと関連させてバッファ14に記憶する。そして、後述するコントローラ19の操作によって、テレビジョンモニタ21の表示画面上でキャラクタを移動させる等の場合において、キャラクタの動きを表現したり、キャラクタを見ている視点位置を変えるときに、以下の処理が行われる。
【0060】
すなわち、CPU1はグラフィックスデータ生成プロセッサ3に対してバッファ14の非表示エリア内に保持している各ポリゴンの頂点の3次元座標データと、スケルトンの座標及びその回転量のデータから求められた各ポリゴンの移動量データ及び回転量データとを与える。
【0061】
グラフィックスデータ生成プロセッサ3は各ポリゴンの頂点の3次元座標データと各ポリゴンの移動量データ及び回転量データとに基づいて各ポリゴンの移動後及び回転後の3次元座標データを順次求める。
【0062】
このようにして求められた各ポリゴンの3次元座標データのうち水平及び垂直方向の座標データは、バッファ14の表示エリア上のアドレスデータ、すなわちポリゴン頂点アドレスデータとして描画プロセッサ10に供給される。
【0063】
描画プロセッサ10は3個のポリゴン頂点アドレスデータによって示されるバッファ14の表示エリア上に予め割り当てられているテクスチャアドレスデータによって示されるテクスチャデータを書き込む。これによって、テレビジョンモニタ21の表示画面上には、多数のポリゴンにテクスチャの貼り付けられた物体が表示される。
【0064】
通常の2次元画像を描画するための描画命令は、頂点アドレスデータ、テクスチャアドレスデータ、テクスチャデータの色を示すカラーパレットデータのバッファ14上における記憶位置を示すカラーパレットアドレスデータ及びテクスチャの輝度を示す輝度データに対して行われる。これらのデータのうち頂点アドレスデータは、CPU1からの2次元平面上における頂点座標データをCPU1からの移動量データ及び回転量データに基づいてグラフィックスデータ生成プロセッサ3が座標変換することによって得られる。
【0065】
音声プロセッサ11は記録媒体300から読み出されたADPCM(Adaptive Differential Pulse Code Modulation)データをバッファ15に記憶させ、バッファ15に記憶されたADPCMデータが音源となる。
【0066】
また、音声プロセッサ11は、例えば、周波数44.1kHzのクロック信号に基づき、バッファ15からADPCMデータを読み出す。音声プロセッサ11は、読み出したADPCMデータに対してピッチの変換、ノイズの付加、エンベロープの設定、レベルの設定及びリバーブの付加等の処理を施す。
【0067】
記録媒体300から読み出される音声データがCD−DA(Compact Disk Digital Audio)等のPCM(Pulse Code Modulation)データの場合、音声プロセッサ11はこの音声データをADPCMデータに変換する。また、PCMデータに対するプログラムによる処理は、メインメモリ5上において直接行われる。メインメモリ5上において処理されたPCMデータは、音声プロセッサ11に供給されてADPCMデータに変換される。その後、上述した各種処理が施され、音声がスピーカ23から出力される。
【0068】
記録媒体ドライブ17としては、例えば、DVD−ROMドライブ、CD−ROMドライブ、ハードディスクドライブ、光ディスクドライブ、フレキシブルディスクドライブ、シリコンディスクドライブ、カセット媒体読み取り機等が用いられる。この場合、記録媒体300としては、DVD−ROM、CD−ROM、ハードディスク、光ディスク、フレキシブルディスク、半導体メモリ等が用いられる。
【0069】
記録媒体ドライブ17は記録媒体300から画像データ、音声データ及びプログラムデータを読み出し、読み出したデータをデコーダ12に供給する。デコーダ12は記録媒体ドライブ17からの再生したデータに対してECC(Error Correction Code)によるエラー訂正処理を施し、エラー訂正処理を施したデータをメインメモリ5又は音声プロセッサ11に供給する。
【0070】
メモリ18としては、例えばカード型のメモリが用いられる。カード型のメモリは、例えばゲームを中断した場合において中断時点での状態を保持する等のように、中断時点での各種ゲームパラメータを保持するため等に用いられる。
【0071】
コントローラ19はユーザが種々の操作指令を入力するために使用する操作装置であり、ユーザの操作に応じた操作信号をCPU1に送出する。コントローラ19には、第1ボタン19a、第2ボタン19b、第3ボタン19c、第4ボタン19d、上方向キー19U、下方向キー19D、左方向キー19L、右方向キー19R、L1ボタン19L1、L2ボタン19L2、R1ボタン19R1、R2ボタン19R2、スタートボタン19e、セレクトボタン19f、左スティック19SL及び右スティック19SRが設けられている。
【0072】
上方向キー19U、下方向キー19D、左方向キー19L及び右方向キー19Rは、例えば、キャラクタやカーソルをテレビジョンモニタ21の画面上で上下左右に移動させるコマンドをCPU1に与えるために使用される。
【0073】
スタートボタン19eは記録媒体300からゲームプログラムをロードするようにCPU1に指示するため等に使用される。セレクトボタン19fは記録媒体300からメインメモリ5にロードされるゲームプログラムに関する各種選択をCPU1に指示するため等に使用される。
【0074】
左スティック19SL及び右スティック19SRを除くコントローラ19の各ボタン及び各キーは、外部からの押圧力によって中立位置から押圧されるとオンになり、押圧力が解除されると上記中立位置に復帰してオフになるオンオフスイッチで構成される。
【0075】
左スティック19SL及び右スティック19SRは、いわゆるジョイスティックとほぼ同一構成のスティック型コントローラである。このスティック型コントローラは直立したスティックを有し、このスティックの所定位置を支点として前後左右を含む360°方向に亘って傾倒可能な構成になっている。左スティック19SL及び右スティック19SRは、スティックの傾倒方向及び傾倒角度に応じて、直立位置を原点とする左右方向のx座標及び前後方向のy座標の値を操作信号としてインターフェース回路13を介してCPU1に送出する。
【0076】
なお、第1ボタン19a、第2ボタン19b、第3ボタン19c、第4ボタン19d、L1ボタン19L1、L2ボタン19L2、R1ボタン19R1及びR2ボタン19R2は、記録媒体300からロードされるゲームプログラムに応じて種々の機能に使用される。
【0077】
次に、上記のビデオゲーム装置の概略動作について説明する。記録媒体300が記録媒体ドライブ17に装填されている場合、電源スイッチ(図示省略)がオンされてビデオゲーム装置に電源が投入されると、ROM6に記憶されているオペレーティングシステムに基づいて、記録媒体300からゲームプログラムを読み出すように、CPU1は記録媒体ドライブ17に指示する。これによって、記録媒体ドライブ17は記録媒体300から画像データ、音声データ及びプログラムデータを読み出す。読み出された画像データ、音声データ及びプログラムデータはデコーダ12に供給され、デコーダ12によってエラー訂正処理が各データに施される。
【0078】
デコーダ12によってエラー訂正処理が施された画像データは、バスライン2を介して伸張回路7に供給される。伸張回路7によって上述した伸張処理が行われた画像データは描画プロセッサ10に供給され、描画プロセッサ10によってバッファ14の非表示エリアに書き込まれる。デコーダ12によってエラー訂正処理が施された音声データは、メインメモリ5又は音声プロセッサ11を介してバッファ15に書き込まれる。デコーダ12によってエラー訂正処理が施されたプログラムデータはメインメモリ5に書き込まれる。
【0079】
以降、CPU1は、メインメモリ5に記憶されているゲームプログラム及びユーザがコントローラ19を用いて指示する内容に基づいてビデオゲームを進行させる。すなわち、ユーザがコントローラ19を用いて指示する内容に基づいて、CPU1は画像処理の制御、音声処理の制御及び内部処理の制御等を適宜行う。
【0080】
画像処理の制御として、例えば、キャラクタに指示されるアニメーションに該当するパターンデータから各スケルトンの座標の計算又はポリゴンの頂点座標データの計算、得られた3次元座標データや視点位置データのグラフィックスデータ生成プロセッサ3への供給、グラフィックスデータ生成プロセッサ3が求めたバッファ14の表示エリア上のアドレスデータや輝度データを含む描画命令の発行等が行われる。
【0081】
音声処理の制御として、例えば、音声プロセッサ11に対する音声出力コマンドの発行、レベル、リバーブ等の指定が行われる。内部処理の制御として、例えばコントローラ19の操作に応じた演算等が行われる。
【0082】
本実施形態では、基準モデルと裏モデルとを重ね合わせて一体とした縁付きモデルのデータをモデルデータとして予め記録媒体300に記憶しておき、CPU1の描画命令によって縁付きモデルのデータを所定のバッファ14の非表示エリア上に読み出し、前述の画像処理を行って表示エリアに書き込ませ、この後、表示手段であるテレビジョンモニタ21に繰り返し読み出して描画するようにしている。基準モデルは、輪郭線のない複数のポリゴンで構成されるポリゴンモデルであり、裏モデルは、基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定したポリゴンモデルである。縁付きモデルが描画されると、この裏モデルが基準モデルの輪郭線としてゲーム画面に表示される。
【0083】
図2は、図1に示すビデオゲーム装置の動作を中心とする主要部の機能構成を示すブロック図である。図2に示すように、ビデオゲーム装置は、機能的には、主にCPU1と、グラフィックスデータ生成プロセッサ3と、描画プロセッサ10と、コンピュータ読み取り可能な記録媒体300と、バッファ14と、テレビジョンモニタ21と、コントローラ19とで構成されている。
【0084】
記録媒体300は、3次元ゲーム画像処理プログラムを含むビデオゲームプログラムを記憶するプログラム記憶部34と、仮想カメラの視点位置及び視線の向きを表すベクトルデータを記憶するカメラ視線データ記憶部35と、ポリゴンモデルの情報を記憶するモデルデータ記憶部36として機能する。なお、記録媒体300から3次元ゲーム画像処理プログラムが読み取られ、当該プログラムがメインメモリ5に記録されている場合、メインメモリ5がプログラム記憶部34として機能する。
【0085】
モデルデータ記憶部36は、基準モデルを拡大して得られる各ポリゴンの表裏判別に用いる面法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いる面法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いる頂点法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いる頂点法線ベクトルの方向に対して同じ方向に設定した裏モデルを基準モデルに重ね合わせて縁付きモデルとして記憶する。モデルデータ記憶部36は、縁付きモデルを構成する各ポリゴンのテクスチャデータを格納するテクスチャデータ361と、縁付きモデルを構成する各ポリゴンの各頂点の頂点法線ベクトルを格納する頂点法線ベクトルデータ362と、縁付きモデルを構成する各ポリゴンの各頂点位置の座標を格納する頂点座標データ363と、各ポリゴンが表面のみを描画するポリゴンであるか、両面を描画するポリゴン(平面モデルを構成するポリゴン)であるかを記憶する属性データ364とをそれぞれ各縁付きモデル毎に各ポリゴンに対応するデータとしてテーブル形式で備える。
【0086】
なお、本実施の形態において、ポリゴンモデルを構成する各ポリゴンの面法線ベクトルはポリゴン表裏判別用法線ベクトルであり、ポリゴンモデルを構成する各ポリゴンの各頂点の頂点法線ベクトルはシェーディング処理用法線ベクトルである。ポリゴン表裏判別用法線ベクトルとはポリゴンの表面と裏面とを判別するために用いられる法線ベクトルのことであり、シェーディング処理用法線ベクトルとはシェーディング処理を施すために用いられる法線ベクトルのことである。
【0087】
グラフィックスデータ生成プロセッサ3は、ポリゴン判別部31及びシェーディング処理部32として機能する。
【0088】
ポリゴン判別部31は、縁付きモデルを構成するポリゴンの面法線ベクトルが仮想カメラの視点位置の方向を向いている場合に表面として判別し、縁付きモデルを構成するポリゴンの面法線ベクトルが仮想カメラの視点位置に対して逆方向を向いている場合に裏面として判別する。具体的にポリゴン判別部31は、縁付きモデルを構成する各ポリゴンの面法線ベクトルと、当該面法線ベクトルの始点から仮想カメラ視点の方向を表す視線方向ベクトルとの内積を計算し、縁付きモデルを構成する各ポリゴンについて内積が正である場合に表面として判別し、内積が負である場合に裏面として判別する。
【0089】
シェーディング処理部32は、縁付きモデルを構成する各ポリゴンの頂点法線ベクトルに基づいてシェーディング処理を行う。
【0090】
描画プロセッサ10は、3次元空間内に配置された各モデルに対してテクスチャマッピング及びレンダリング処理等を施し、モデル全体の画像の形成を行うものであり、描画処理部33として機能する。
【0091】
描画処理部33は、縁付きモデルを構成する各ポリゴンの面法線ベクトルが仮想ゲーム空間内における仮想カメラ視点位置の方向を向いているポリゴンのみを描画する。また、描画処理部33は、基準モデルが平面モデルである場合、ポリゴン表裏判別用の面法線ベクトルの方向にかかわらず描画する。
【0092】
なお、本実施の形態では、シェーディング処理部32はシェーディング処理手段に相当し、描画処理部33は描画手段に相当し、モデルデータ記憶部35は記憶手段に相当する。
【0093】
ポリゴンモデルを構成するポリゴンは、三角形、四角形等の多角形の平面からなり、この平面の一方の面が表面となり、他方の面が裏面として設定される。ポリゴンは各頂点座標を順番に結ぶことで形成され、各頂点座標を結ぶ順番がリストされている。この頂点座標を結ぶ順番が画面から見て時計回りの場合、ポリゴンの面法線ベクトルは裏面から表面の方向となり、頂点座標を結ぶ順番が画面から見て反時計回りの場合、ポリゴンの面法線ベクトルは表面から裏面の方向となる。ポリゴンの面法線ベクトルが仮想カメラ視点位置の方向を向いている場合、ポリゴンは表面として判別され、描画される。ポリゴンの面法線ベクトルが仮想カメラ視点位置の方向とは逆の方向を向いている場合、ポリゴンは裏面として判別され、描画されない。そのため、基準モデルに関しては仮想カメラ視点側の外側のポリゴンが表面として描画され、裏モデルに関しては仮想カメラ視点側の内側のポリゴンが表面として描画され、輪郭線を有する縁付きモデルが描画される。
【0094】
なお、本実施の形態において、ポリゴンの面法線ベクトルが仮想カメラ視点位置の方向を向いている場合とは、仮想カメラ視点と面法線ベクトルの始点とを結ぶ線分と、面法線ベクトルとがなす挟角が90°未満である場合である。また、ポリゴンの面法線ベクトルが仮想カメラ視点位置の方向とは逆の方向を向いている場合とは、仮想カメラ視点と面法線ベクトルの始点とを結ぶ線分と、面法線ベクトルとがなす挟角が90°以上である場合である。なお、ポリゴンの面法線ベクトルが仮想カメラ視点位置の方向を向いている場合とは、仮想カメラ視点と面法線ベクトルの始点とを結ぶ線分と、面法線ベクトルとがなす挟角が90°以下である場合であってもよく、このとき、ポリゴンの面法線ベクトルが仮想カメラ視点位置の方向とは逆の方向を向いている場合とは、仮想カメラ視点と面法線ベクトルの始点とを結ぶ線分と、面法線ベクトルとがなす挟角が90°より大きい場合となる。
【0095】
また、本実施の形態において、内側のポリゴンとは、面法線ベクトルが当該ポリゴンで構成されるポリゴンモデル(基準モデル又は裏モデル)の内部の方向を向いているポリゴンであり、外側のポリゴンとは、面法線ベクトルが当該ポリゴンで構成されるポリゴンモデル(基準モデル又は裏モデル)の外部の方向を向いているポリゴンである。
【0096】
図3は、基準モデル及び縁付きモデルがシェーディング処理を施さずに描画された例を示す図である。図3(a)は基準モデルのみがシェーディング処理を施さずに描画された例であり、図3(b)は、図3(a)に示す基準モデルと輪郭線となる裏モデルとを重ね合わせた縁付きモデルがシェーディング処理を施さずに描画された例であり、テレビジョンモニタ21上に実際に表示されるキャラクタの一例である。なお、図3(b)に示す裏モデルBを構成する各ポリゴンの頂点法線ベクトル及び面法線ベクトルは、共に裏モデルBの内側を向いている。
【0097】
図3(a)に示すように、輪郭線を付さずに基準モデルAのみでキャラクタを表した場合、周りの背景との差別化が図れず、アニメーションのような表現にはならない。そこで、基準モデルAを拡大して得られる各ポリゴンの表裏判別に用いる面法線ベクトルの方向を基準モデルAを構成する各ポリゴンの表裏判別に用いる面法線ベクトルの方向に対して反対方向に設定した裏モデルBを基準モデルAに重ねて縁付きモデルMとし、当該縁付きモデルMを描画することによって、図3(b)に示すようにキャラクタに輪郭線が付され、キャラクタがアニメーションのような表現となり、さらに、背景となる画像との差別化が図られ、モデルが際立つこととなる。
【0098】
しかしながら、図3(b)に示す縁付きモデルMにシェーディング処理を施した場合、裏モデルBを構成する各ポリゴンのシェーディング処理に用いる頂点法線ベクトルが、基準モデルAを構成する各ポリゴンのシェーディング処理に用いる頂点法線ベクトルとは反対の方向を向いているため、光源の位置によっては、輪郭線部分の影の濃淡と基準モデルAの影の濃淡とが異なって表示されてしまう。
【0099】
図4は、裏モデルを構成するポリゴンの面法線ベクトル及び頂点法線ベクトルの方向をともに裏モデルの内側とした縁付きモデルにシェーディング処理を施した画像の一例を示す画面図である。図4に示す画面400には、基準モデルA1と、基準モデルA1を拡大した裏モデルB1とを重ね合わせた縁付きモデルM1が表示されている。画面400では、光源が仮想カメラ視点から見て縁付きモデルM1の左方に設けられている。図4に示す基準モデルA1は、光源が縁付きモデルM1の左方にあるため、基準モデルA1の一方の基準モデル部分401が明るくなっており、基準モデルA1の他方の基準モデル部分402にいくにしたがって徐々に暗くなっている。一方、裏モデルB1は光源が縁付きモデルM1の左方にあるにもかかわらず、裏モデルB1の一方の輪郭線部分403が暗くなっており、裏モデルB1の他方の輪郭線部分404にいくにしたがって徐々に明るくなっている。これは、基準モデルA1を構成する各ポリゴンのシェーディング処理用の頂点法線ベクトルが基準モデルA1の外側を向いており、裏モデルB1を構成する各ポリゴンの頂点法線ベクトルが裏モデルB1の内側を向いているために起こるものである。図4に示すように基準モデルA1と裏モデルB1との影のグラデーションが異なると非常に違和感のある表示となってしまう。そこで、裏モデルB1を作成する際に、裏モデルB1を構成する各ポリゴンのポリゴン表裏判別用の面法線ベクトルを裏モデルB1の内側に向け、裏モデルB1を構成する各ポリゴンのシェーディング処理用の頂点法線ベクトルを裏モデルB1の外側に向けるようにする。
【0100】
次に、本実施形態である3次元ゲーム画像処理の前段階として行われる処理を以下に説明する。
【0101】
図5は、基準モデル、裏モデル及び基準モデルと裏モデルとで構成される縁付きモデルについて説明するための模式図である。図5(a)はポリゴンPOで構成される基準モデルAを示す図であり、図5(b)はポリゴンPOで構成される裏モデルBを示す図であり、図5(c)は基準モデルAと裏モデルBとを重ね合わせた縁付きモデルMを示す図である。
【0102】
まず、基準モデルAの拡大が行われる。この際、基準モデルAの中心点となる座標を設定し、その中心点から全方向に所定の比率で拡大させる。この中心点は、ローカル座標系における原点となるので、基準モデルAの各頂点座標に所定の倍率を掛け合わせたものが基準モデルAを拡大して得られる拡大モデルの頂点座標となる。また、基準モデルAを拡大して得られる拡大モデルの各ポリゴンの頂点が、基準モデルAの各頂点の法線ベクトル上に配置するようにする。これによって、基準モデルAから均等に拡大された拡大モデルを作成することができる。さらに、この基準モデルAを拡大して得られる拡大モデルを構成する各ポリゴンの表裏判別に用いる面法線ベクトルの方向を基準モデルAを構成する各ポリゴンの表裏判別に用いる面法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いる頂点法線ベクトルの方向を基準モデルAを構成する各ポリゴンのシェーディング処理に用いる頂点法線ベクトルの方向に対して同じ方向に設定することによって裏モデルBを作成する。
【0103】
続いて、基準モデルAと裏モデルBとを重ね合わせることで一体の縁付きモデルMとし、上記のようにして作成された縁付きモデルMの修正が行われ、当該縁付きモデルMをモデルデータとして記録媒体300などに記憶する。ここでの修正は、基準モデルAを所定の倍率で拡大した際に生じる裏モデルBの不具合を修正するものであり、具体的には中心点を新たに設定し、その中心点から所定の倍率で拡大あるいは縮小することによって行われ、さらに、ポリゴンの頂点座標を新たに設定することによって行われる。
【0104】
また、図5(a)に示すように基準モデルAはリアル感を出すために多数の細かいポリゴンPOで構成されており、そのため基準モデルAを所定の倍率で拡大しただけの裏モデルBでは、描画するポリゴンPOの数が多くなり、描画処理に時間がかかってしまう。裏モデルBは輪郭線となるポリゴンモデルであるため、例えば、輪郭線を黒色等の単色で表す場合、ポリゴンPOの数を少なくしても表示される裏モデルBにはほとんど影響を与えることはない。そこで、図5(b)に示すように裏モデルBは、単に基準モデルAを所定の倍率で拡大したものではなく、裏モデルBのテクスチャ用の頂点や輪郭線に影響を与えないポリゴンPOの頂点等を省略することによってポリゴン数を減らすことが可能で、これにより、描画処理にかかる時間が短縮され、高速化が図られる。また、裏モデルBを構成するポリゴン数を減らすことによって、裏モデルを構成する各ポリゴンの頂点の数も少なくなり、各頂点に対応付けられるデータを記憶するために使用するメモリ領域を低減することができる。
【0105】
次に、裏モデルを構成する各ポリゴンのポリゴン表裏判別用の面法線ベクトルを裏モデルの内側に向け、裏モデルを構成する各ポリゴンの頂点法線ベクトルを裏モデルの外側に向ける裏モデルの作成方法について図6を用いて説明する。
【0106】
図6は、図5(c)に示す縁付きモデルMの右側部分MAを拡大した図であり、縁付きモデルMを仮想カメラ視点Cの視線方向に対して側面から見た模式図である。
【0107】
基準モデルAを構成するポリゴンPOの面法線ベクトルVは、ポリゴンPOに垂直であり、基準モデルAの外側を向いている。この面法線ベクトルVは、ポリゴンPOの各頂点Pにおける頂点法線ベクトルVNAの外積を求めることによって算出することができる。
【0108】
裏モデルBの作成方法は、まず、裏モデルBを構成するポリゴンPOの各頂点Pにおける頂点法線ベクトルVNBを反転させ、頂点法線ベクトル−VNBとする。そして、この頂点法線ベクトル−VNBの外積を求めることによって、裏モデルBを構成するポリゴンPOの面法線ベクトルVを算出する。この面法線ベクトルVは、ポリゴンPOに垂直であり、裏モデルBの内側を向いている。続いて、面法線ベクトルVの方向はそのままで、先程反転させた頂点法線ベクトル−VNBを再び反転させることによって元の頂点法線ベクトルVNBとする。
【0109】
このようにして、複数のポリゴンPOで構成される基準モデルAを輪郭線の幅だけ所定の倍率で拡大して得られる各ポリゴンPOの表裏判別に用いる面法線ベクトルVの方向を基準モデルAを構成する各ポリゴンPOの表裏判別に用いる面法線ベクトルVの方向に対して反対方向として設定するとともに、拡大された各ポリゴンPOのシェーディング処理に用いる頂点法線ベクトルVNBを基準モデルAを構成する各ポリゴンPOのシェーディング処理に用いる頂点法線ベクトルVNAの方向に対して同じ方向として設定した裏モデルBを基準モデルAに重ね合わせて縁付きモデルMとして作成することができる。つまり、基準モデルAの頂点法線ベクトルVNA及び面法線ベクトルVは基準モデルAの外側を向いており、裏モデルBの頂点法線ベクトルVNBは裏モデルBの外側を向いており、裏モデルBの面法線ベクトルVは裏モデルBの内側を向いていることとなる。なお、基準モデルAと裏モデルBとを重ね合わせる場合、基準モデルAの基準点と裏モデルBの基準点とを一致させる。この基準点としては、例えば、基準モデルA及び裏モデルBの重心を用いる。上記のようにして作成された裏モデルBと基準モデルAとを重ね合わせることによって、基準モデルAが裏モデルBに包含される縁付きモデルMが作成され、作成された縁付きモデルMはあらかじめ記録媒体300等に格納される。
【0110】
次に、ポリゴンの表面及び裏面の判別方法について図6を用いて説明する。モデルを構成するポリゴンが表面であるか、裏面であるかの判別は、面法線ベクトルの始点位置における仮想カメラ視点位置の方向へのベクトルを表す視線方向ベクトルと面法線ベクトルとの内積を算出し、算出された内積が正であれば表面として判別し、内積が負であれば裏面として判別することによって行われる。図6に示す基準モデルAでは、面法線ベクトルVの始点位置aにおける仮想カメラ視点位置Cの方向へのベクトルを表す視線方向ベクトルVと面法線ベクトルVとの内積V・Vは下記の(1)式で表される。
・V=|V||V|cosθ・・・・(1)
なお、上記(1)式におけるVはポリゴンPOにおける面法線ベクトルを表し、Vは視線方向ベクトルVを表し、θは面法線ベクトルVと視線方向ベクトルVとがなす挟角を表す。
【0111】
図6に示すようにθはθ<90°(π/2)であるため、上記の(1)式によって視線方向ベクトルVと面法線ベクトルVとの内積V・VはV・V>0となり、基準モデルAを構成するポリゴンPOは表面であると判別される。
【0112】
図6に示す裏モデルBでは、面法線ベクトルVの始点位置bにおける仮想カメラ視点位置Cの方向へのベクトルを表す視線方向ベクトルVと面法線ベクトルVとの内積V・Vは下記の(2)式で表される。
・V=|V||V|cosθ・・・・(2)
なお、上記(1)式におけるVはポリゴンPOにおける面法線ベクトルを表し、Vは視線方向ベクトルVを表し、θは面法線ベクトルVと視線方向ベクトルVとがなす挟角を表す。
【0113】
図6に示すようにθはθ≧90°(π/2)であるため、上記の(2)式によって視線方向ベクトルVと面法線ベクトルVとの内積V・VはV・V<0となり、裏モデルBを構成するポリゴンPOは裏面であると判別される。
【0114】
このように、ポリゴンの面法線ベクトルと視線方向ベクトルとの内積を算出する簡単な演算を行うことによって、当該ポリゴンの表裏を容易に判別することができる。
【0115】
次に、基準モデルAが板状の平面モデルである場合について説明する。図7は、平面モデルA2と裏モデルB2とで構成される縁付きモデルM2を示す図である。板状の平面モデルA2は表裏両方から見える必要があるため、ポリゴンの表裏に関係無く常に両面が描画される。これは、モデル全体が平面の場合だけでなくモデルの一部が平面になっている場合も平面の部分のみは表裏に関係無く常に描画される。そのため、平面モデルA2を輪郭線の大きさだけ拡大すると共に厚みを付与して得られる拡大モデルにおける各ポリゴンの面法線ベクトルの方向を拡大モデルの内側とする裏モデルB2と平面モデルA2とを重ね合わせた縁付きモデルM2をあらかじめ記録媒体300に記憶しておき、どの角度から見ても輪郭線が描画されるようにする。
【0116】
このように、例えば厚みのない板状の平面モデルA2を拡大すると共に厚みを付与して得られる拡大モデルの厚み方向に沿うポリゴンの面法線ベクトルの方向を拡大モデルの内側とし、頂点法線ベクトルの方向を拡大モデルの外側とする裏モデルB2を作成することによって、視点位置の変化に影響されることなく、平面モデルA2の縁付きモデルM2を描画することができる。また、このような平面モデルA2に輪郭線を付す場合にも、平面モデルA2を拡大すると共に厚みを付与して得られる拡大モデルの厚み方向に沿うポリゴンの面法線ベクトルの方向を拡大モデルの内側とすることで、平面モデルA2と裏モデルB2とを重ね合わせた縁付きモデルM2の輪郭線部分と平面モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、平面モデルに輪郭線を付す場合に、輪郭線部分と平面モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0117】
次に、基準モデルAが段差部を有する場合の縁付きモデルMの修正方法ついて説明する。2つ以上の基準モデルAが重なった部分や、小さな段差部のような凸凹が基準モデルAにある場合、基準モデルAの拡大だけでは、ある特定の視点から見た場合に、基準モデルAの端と裏モデルBのポリゴンとの間に隙間ができてしまい、輪郭線が浮いて見えたり、ちらついて見えたりする現象が起こる。そのため、基準モデルAが段差部を有する場合等は裏モデルBのポリゴンを修正する必要がある。
【0118】
図8は、基準モデルAが段差部を有する場合の縁付きモデルMの修正方法ついて説明するための模式図である。図8の(a)、(c)は描画された縁付きモデルMを仮想カメラ視点からの視線に対して側面から見た模式図であり、図8の(b)、(d)は描画された縁付きモデルMを仮想カメラ視点から見た模式図である。図8の(a)、(c)に示すように基準モデルAは段差部Dを有する形状であり、裏モデルBは基準モデルAを所定の倍率で拡大したものであるため段差部Dを有する形状である。図8(a)に示すように、裏モデルBを構成するポリゴンの面法線ベクトルを内側に反転させた場合、段差部Dの最端部上の頂点Pbと頂点Pb’との間を結んで構成されるポリゴンPOが輪郭線として描画される。そして、図8(a)の鎖線で示すような視線で見た縁付きモデルMを描画した場合、図8(b)に示すように輪郭線である裏モデルBと基準モデルAとの間に隙間Sができてしまう。このように、基準モデルAと裏モデルBとの間に隙間Sができると、適切な位置に輪郭線が描画されないため、ユーザには輪郭線が浮いているように見えてしまう。そこで、基準モデルAと裏モデルBとの間に隙間Sができるのを防止するために、様々な視点から見て隙間Sができる部分を閉じるように修正する。つまり、図8(c)に示すように、裏モデルBの頂点Pb’を基準モデルAの段差部Dの最端部上の頂点Paに移動させ、頂点Pbと頂点Paとの間を結んでポリゴンPO’とすることによって、基準モデルAと裏モデルBとの隙間SがポリゴンPO’によって閉じられ、輪郭線が隙間なく描画される。なお、この場合のポリゴンPO’の面法線ベクトルは仮想カメラ視点Cの方向を向いており、頂点法線ベクトルも仮想カメラ視点Cの方向を向いているように設定する。
【0119】
また、単に頂点Pbと頂点Paとの間を結んでポリゴンPO’としただけではポリゴンPO’で表される輪郭線の幅が他の輪郭線の幅より太くなってしまうため、基準モデルAの段差部Dにおける最端部上の頂点Pa及び当該頂点Paに対応する裏モデルBの段差部Dにおける最端部上の頂点Pbの間の幅を他の輪郭線の幅に応じて変更してもよい。
【0120】
このように、基準モデルAが段差部Dを有する場合、当該基準モデルAの段差部Dにおける最端部上の頂点Paと、当該頂点Paに対応する裏モデルBの段差部Dにおける最端部上の頂点Pbとで構成されるポリゴンPO’が輪郭線として描画されるため、縁付きモデルMの表示に際して、基準モデルAから離れて輪郭線が付いたり、ちらつきが起こるなどの不具合が解消され、きれいな縁付きモデルMを表示することができるようになる。また、このような基準モデルAが段差部Dを有する縁付きモデルMにシェーディング処理を施した場合にも縁付きモデルMの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、段差部Dを有する基準モデルAに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0121】
図9は、図1に示すビデオゲーム装置による3次元ゲーム画像処理を説明するためのフローチャートである。なお、ビデオゲーム装置における3次元ゲーム画像処理は、CPU1等が3次元ゲーム画像処理プログラムを実行することによって行われる処理である。
【0122】
まず、ステップS1において、CPU1は、基準モデルAを拡大して得られる各ポリゴンの表裏判別に用いる面法線ベクトルVの方向を基準モデルAを構成する各ポリゴンの表裏判別に用いる面法線ベクトルVの方向に対して反対方向に設定した裏モデルBを基準モデルAに重ね合わせた縁付きモデルMに関するモデルデータを記録媒体300から読み出し、グラフィックスデータ生成プロセッサ3に当該データを送る。
【0123】
続いて、ステップS2において、グラフィックスデータ生成プロセッサ3は、読み出された縁付きモデルMを構成するポリゴンが表裏に関係無く描画されるポリゴンであるか否かを属性データに基づいて判定する。縁付きモデルMを構成する各ポリゴンには、ポリゴンモデルの表面ポリゴンのみを描画するポリゴンであるか、両面が描画されるポリゴンであるかのフラグが属性データとして対応付けられている。例えば、フラグが”1”の場合、ポリゴンは裏面が描画されずに表面のみが描画されるポリゴンであり、フラグが”0”の場合、ポリゴンは表裏に関係なく両面が描画されるポリゴンであると判定される。ここで、縁付きモデルMが表裏に関係無く描画される平面モデルのポリゴンであり、フラグが”0”の場合(ステップS2でYES)、ステップS4に移行し、縁付きモデルMが表裏のあるポリゴンであり、フラグが”1”の場合(ステップS2でNO)、ステップS3に移行することとなる。
【0124】
ステップS3において、グラフィックスデータ生成プロセッサ3は、ポリゴンが仮想カメラ視点から見て表面であるかを判定する。グラフィックスデータ生成プロセッサ3は、表裏のある縁付きモデルMのポリゴンが表面であるか否かを判定する。グラフィックスデータ生成プロセッサ3はポリゴンの視線方向ベクトルと面法線ベクトルとの内積を計算し、内積が正であれば表面として判別し(ステップS3でYES)、当該ポリゴンのバッファ14の表示エリア上における記憶位置を示すポリゴン頂点アドレスデータを描画プロセッサ10に送り、ステップS4に移行する。グラフィックスデータ生成プロセッサ3は、ポリゴンの視線方向ベクトルと面法線ベクトルとの内積が負であれば裏面として判別し(ステップS3でNO)、当該ポリゴンは描画されずに終了となる。
【0125】
ステップS4において、グラフィックスデータ生成プロセッサ3は、ステップS3で表面として判定されたポリゴンに対してシェーディング処理を行う。
【0126】
ここで、シェーディング処理について説明する。シェーディング処理は、モデルに光源からの光が照射されることによってモデル表面に生じる影の濃淡を施す処理である。本実施の形態においてシェーディング処理は、スムーズシェーディング処理の一つであるグーローシェーディング処理を用いる。なお、シェーディング処理に用いられる光源としては無限遠光源、点光源、スポットライト、線光源及び面光源等を用いてもよい。
【0127】
グーローシェーディング処理は、モデルを構成する各ポリゴンの頂点法線ベクトルを用いて行われる処理である。具体的には、ポリゴンを構成する全ての頂点の輝度を計算し、この頂点の輝度に基づいてポリゴンの稜線の輝度及びポリゴン内部の各点の輝度を線形補間して決定する。グラフィックスデータ生成プロセッサ3は、上記のようにして計算したポリゴンの輝度を輝度データとして描画プロセッサ10に送る。このように、グーローシェーディング処理では、各ポリゴンの頂点法線ベクトルによって頂点の輝度を求め、線形補間によって平面にグラデーションを施すことで隣り合うポリゴンのつながりを滑らかに見せるシェーディング処理が行われる。シェーディング処理をグーローシェーディング処理によって行うことで表示される縁付きモデルMを構成するポリゴンの角や稜線が目立たなくなり、明るさが連続的に変化し、影の濃淡を滑らかに表現することができる。
【0128】
ステップS5において、描画プロセッサ10は、ステップS3で表面であるとして判定されたポリゴンを描画する。描画プロセッサ10は、ステップS3で表面であるとして判定されたポリゴンの輝度データ及びポリゴン頂点アドレスデータ等に基づいてバッファ14の表示エリアに描画し、当該ポリゴンがテレビジョンモニタ21の表示面上に表示される。
【0129】
このように、基準モデルAを拡大して得られる各ポリゴンの表裏判別に用いる面法線ベクトルV(ポリゴン表裏判別用法線ベクトル)の方向を基準モデルAを構成する各ポリゴンの表裏判別に用いる面法線ベクトルV(ポリゴン表裏判別用法線ベクトル)の方向に対して反対方向に設定した裏モデルBを基準モデルAに重ねて縁付きモデルMとすることで、裏モデルBが基準モデルAの輪郭線として描画される。
【0130】
また、輪郭線となる裏モデルBを構成する各ポリゴンのシェーディング処理に用いる頂点法線ベクトル(シェーディング処理用法線ベクトル)の方向を基準モデルAを構成する各ポリゴンのシェーディング処理に用いる頂点法線ベクトル(シェーディング処理用法線ベクトル)の方向と同じ方向に設定することで、基準モデルAと裏モデルBとを重ね合わせた縁付きモデルMの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、複数のポリゴンで構成される基準モデルAに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0131】
また、基準モデルAを拡大して得られる各ポリゴンの表裏判別に用いる面法線ベクトル(ポリゴン表裏判別用法線ベクトル)の方向を基準モデルAを構成する各ポリゴンの表裏判別に用いる面法線ベクトル(ポリゴン表裏判別用法線ベクトル)の方向に対して反対方向に設定した裏モデルBを基準モデルAに重ねて縁付きモデルMとしてあらかじめ記録媒体300に記憶されているため、基準モデルAを拡大して重ね合わせて法線ベクトルの方向を変えて縁付きモデルMとするジオメトリ処理を描画の度に行うのに比べて処理にかかる時間を短縮することができる。
【0132】
図10は、シェーディング処理を施した縁付きモデルの一例を示す画面図である。図10に示す画面410には、基準モデルAと、基準モデルAを拡大して得られる裏モデルBとを重ね合わせた縁付きモデルMが表示されている。画面410では、光源が仮想カメラ視点から見て縁付きモデルMの左方に設けられている。図10に示す基準モデルAは、光源が縁付きモデルMの左方にあるため、基準モデルAの一方の基準モデル部分401が明るくなっており、基準モデルAの他方の基準モデル部分402にいくにしたがって徐々に暗くなっている。さらに、裏モデルBに関しても、光源が縁付きモデルMの左方にあるため、裏モデルBの一方の輪郭線部分403から他方の輪郭線部分404にいくにしたがって徐々に暗くなっており、図4に示す裏モデルB1の輪郭線部分403に比べて裏モデルBの輪郭線部分403は明るくなっており、図4に示す裏モデルB1の輪郭線部分404に比べて裏モデルBの輪郭線部分404は暗くなっている。このように、裏モデルBの頂点法線ベクトルを裏モデルBの外側とし、裏モデルBの面法線ベクトルを裏モデルBの内側とすることで、基準モデルAに輪郭線を付すことができるとともに、基準モデルA及び裏モデルBに同じ影の濃淡を施す適切なシェーディング処理を行うことができ、違和感のない輪郭線を実現することができる。
【0133】
なお、上記実施の形態では、基準モデルAと、基準モデルAを拡大して得られる裏モデルBとを重ね合わせた縁付きモデルMを作成し、当該縁付きモデルMに関するデータをあらかじめ記憶しておくとして説明したが、本発明は特にこれに限定されず、基準モデルAに関するデータのみを記憶しておき、描画処理毎に縁付きモデルMを作成してもよい。以下、本発明の他の実施の形態について図11を用いて説明する。
【0134】
図11は、図1に示すビデオゲーム装置による3次元ゲーム画像処理の他の実施の形態を説明するためのフローチャートである。なお、ビデオゲーム装置における3次元ゲーム画像処理は、CPU1等が3次元ゲーム画像処理プログラムを実行することによって行われる処理である。
【0135】
ステップS11において、CPU1は基準モデルAに関するデータを記録媒体300から読み出し、グラフィックスデータ生成プロセッサ3に当該データを送る。
【0136】
ステップS12において、グラフィックスデータ生成プロセッサ3は、基準モデルAを輪郭線の大きさだけ所定の倍率で拡大した拡大モデルを作成する。拡大モデルを構成する各ポリゴンの頂点座標は、基準モデルAを構成する各ポリゴンの頂点座標に所定の倍率を乗算することによって求めることができる。
【0137】
ステップS13において、グラフィックスデータ生成プロセッサ3は、ステップS12で作成された拡大モデルを構成する各ポリゴンのシェーディング処理に用いる頂点法線ベクトルの方向はそのままで、各ポリゴンの表裏を判別するための面法線ベクトルを基準モデルAを構成する各ポリゴンの表裏を判別するための面法線ベクトルの方向に対して反対方向として裏モデルBを作成する。
【0138】
ステップS14において、グラフィックスデータ生成プロセッサ3は、基準モデルAと、ステップS13で作成した裏モデルBとを重ね合わせて縁付きモデルMを作成する。この際、基準モデルAの中心位置(例えば重心)と裏モデルBの中心位置(例えば重心)とを一致させることで縁付きモデルMを作成する。
【0139】
ステップS15からステップS18における処理は、図7のステップS2からステップS5における処理と同じであるので説明を省略する。
【0140】
なお、上記ステップS13の処理とステップS14の処理とは逆でもよく、ステップS13において基準モデルAと拡大モデルとを重ね合わせて、ステップS14において拡大モデルの面法線ベクトルの方向を変えることで縁付きモデルMを作成してもよい。
【0141】
このように、基準モデルAと裏モデルBとを重ね合わせた縁付きモデルMをあらかじめ作成して記録媒体300に記憶せずに、基準モデルAに関するデータのみを記録媒体300に記憶しておき、CPU1の描画指示に応じてビデオゲーム装置のジオメトリ処理によって基準モデルAに基づいて縁付きモデルMを作成してもよい。この場合、縁付きモデルMを作成する処理に多少の時間を要するが、基準モデルAに関するデータのみを記憶しておけばよいのでメモリの記憶容量を削減することができる。
【0142】
なお、本実施の形態では、裏モデルで表される輪郭線の色及び質感を変更することが可能である。つまり、輪郭線となる裏モデルの各ポリゴンのテクスチャデータを様々な色や材質に設定することで、ゲーム状況に応じた種々の表現が可能となる。例えば、ゲームに登場するキャラクタを表す基準モデルを所定の倍率で拡大した裏モデルのポリゴンにグラデーションをつけることによってオーラが出ているような表現となる。
【0143】
また、本実施の形態では、シェーディング処理としてグーローシェーディング処理を用いて行ったが、本発明は特にこれに限定されず、例えば、フラットシェーディング処理又はフォンシェーディング処理等の他のスムーズシェーディング処理を用いてもよい。
【0144】
【発明の効果】
請求項1に記載の本発明によれば、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとすることで、裏モデルを基準モデルの輪郭線として描画することができる。また、輪郭線となる裏モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向と同じ方向に設定することで、基準モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、複数のポリゴンで構成される基準モデルに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0145】
また、本発明によれば、複数のポリゴンで構成される基準モデルを拡大し、拡大された各ポリゴンの表裏を判別するポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定した裏モデルを基準モデルに重ねた縁付きモデルがあらかじめ記憶されているため、基準モデルを拡大した裏モデルと基準モデルとを重ね合わせた後、この裏モデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルの方向を変えるジオメトリ処理を行う必要がなくなり、このジオメトリ処理にかかる時間を短縮することができる。
【0146】
さらに、本発明によれば、縁付きモデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルとして縁付きモデルを構成する各ポリゴンの面法線ベクトルが用いられるため、ポリゴンの表裏判別をポリゴンの面法線ベクトルの向きを求めることによって行うことができる。また、縁付きモデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルとして縁付きモデルを構成する各ポリゴンの各頂点における法線ベクトルが用いられるため、例えば、グーローシェーディング処理等の各ポリゴンの頂点の法線ベクトルを用いてシェーディング処理を行うことができる。
【0147】
さらにまた、本発明によれば、裏モデルは輪郭線に影響を与えないポリゴンの数を減らすことによって、基準モデルと裏モデルとを重ね合わせた縁付きモデルが簡略化され、描画処理に要する時間を短縮することができ、さらに、裏モデルを構成するポリゴン数を減らすことによって、裏モデルを構成する各ポリゴンの各頂点に対応付けられるデータを記憶するために使用されるメモリ領域を低減することができる。
【0148】
さらにまた、本発明によれば、基準モデルが段差部を有する場合、当該基準モデルの段差部における最端部上の頂点と、当該頂点に対応する裏モデルの段差部における最端部上の頂点とで構成されるポリゴンが輪郭線として描画されるため、縁付きモデルの表示に際して、基準モデルから離れて輪郭線が付いたり、ちらつきが起こるなどの不具合が解消され、きれいな縁付きモデルを表示することができるようになり、さらに、このような基準モデルが段差部を有する縁付きモデルにシェーディング処理を施した場合にも縁付きモデルの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、段差部を有する基準モデルに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0149】
さらにまた、本発明によれば、例えば厚みのない板状の平面モデルを拡大すると共に厚みを付与して得られる拡大モデルの厚み方向に沿うポリゴンのポリゴン表裏判別用法線ベクトルの方向を拡大モデルの内側とする裏モデルとすることによって、視点位置の変化に影響されることなく、平面モデルの縁付きモデルを描画することができ、さらに、平面モデルに輪郭線を付す場合にも平面モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と平面モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、平面モデルに輪郭線を付す場合に、輪郭線部分と平面モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0150】
さらにまた、本発明によれば、平面モデルを構成するポリゴンが、両面に対して描画処理が可能な属性情報を有しているため、例えば、平面ポリゴンの表面を表示する視点位置が、平面ポリゴンの裏面を表示する視点位置に移動した場合にも、視点位置の変化に影響されることなく、平面モデルの裏表に関係なく描画することができ、さらに、このように両面が描画可能である平面モデルに輪郭線を付す場合にも平面モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と平面モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、平面モデルに輪郭線を付す場合に、輪郭線部分と平面モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0151】
請求項2に記載の本発明によれば、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとすることで、裏モデルを基準モデルの輪郭線として描画することができる。また、輪郭線となる裏モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向と同じ方向に設定することで、基準モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、複数のポリゴンで構成される基準モデルに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【0152】
請求項3に記載の本発明によれば、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定した裏モデルを基準モデルに重ねて縁付きモデルとすることで、裏モデルを基準モデルの輪郭線として描画することができる。また、輪郭線となる裏モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向と同じ方向に設定することで、基準モデルと裏モデルとを重ね合わせた縁付きモデルの輪郭線部分と基準モデル部分との明るさが連続的に変化し、影の濃淡を均一にすることができ、複数のポリゴンで構成される基準モデルに輪郭線を付す場合に、輪郭線部分と基準モデル部分とに同じ影の濃淡を施す適切なシェーディング処理を行うことができる。
【図面の簡単な説明】
【図1】本発明の一実施の形態のビデオゲーム装置の構成を示すブロック図である。
【図2】図1に示すビデオゲーム装置の動作を中心とする主要部の機能構成を示すブロック図である。
【図3】基準モデル及び縁付きモデルがシェーディング処理を施さずに描画された例を示す図である。
【図4】裏モデルを構成するポリゴンの面法線ベクトル及び頂点法線ベクトルをともに裏モデルの内側とした縁付きモデルにシェーディング処理を施した画像の一例を示す画面図である。
【図5】基準モデル、裏モデル及び基準モデルと裏モデルとで構成される縁付きモデルについて説明するための模式図である。
【図6】図5(c)に示す縁付きモデルMの右側部分MAを拡大した図である。
【図7】平面モデルA2と裏モデルB2で構成される縁付きモデルM2を示す図である。
【図8】基準モデルAが段差部を有する形状である場合の縁付きモデルMの修正方法ついて説明するための模式図である。
【図9】図1に示すビデオゲーム装置による3次元ゲーム画像処理を説明するためのフローチャートである。
【図10】シェーディング処理を施した縁付きモデルの一例を示す画面図である。
【図11】図1に示すビデオゲーム装置による3次元ゲーム画像処理の他の実施の形態を説明するためのフローチャートである。
【符号の説明】
1 CPU
2 バスライン
3 グラフィックスデータ生成プロセッサ
4,13 インターフェース回路
5 メインメモリ
6 ROM
7 伸張回路
8 パラレルポート
9 シリアルポート
10 描画プロセッサ
11 音声プロセッサ
12 デコーダ
14〜16 バッファ
17 記録媒体ドライバ
18 メモリ
19 コントローラ
21 テレビジョンモニタ
31 ポリゴン判別部
32 シェーディング処理部
33 描画処理部
34 プログラム記憶部
35 カメラ視線データ記憶部
36 モデルデータ記憶部
300 記録媒体
361 テクスチャデータ
362 頂点法線ベクトルデータ
363 頂点座標データ
364 属性データ
A,A1,A2 基準モデル
B,B1,B2 裏モデル
M,M1,M2 縁付きモデル
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a three-dimensional game image processing program for drawing a model composed of a plurality of polygons in a virtual game space, a three-dimensional game image processing method, and a video game apparatus.
[0002]
[Prior art]
Conventionally, in a game played in a three-dimensional virtual space, a technique for expressing an animation by attaching a contour line to a polygon model composed of a plurality of polygons is known. In order to differentiate the image from the background (exaggeration of the outline) by attaching the polygon model, the target polygon model is made to stand out.
[0003]
For example, in Japanese Patent Laid-Open No. 2000-251094, when a process for attaching a contour line to a reference model which is a polygon model is performed, data of the reference model to which a contour line is attached is read from a memory and the reference model is read at a predetermined ratio. Create an enlarged model and store it in memory, perform geometry processing to superimpose this enlarged model on the reference model, invert the normal vector of each polygon that makes up the enlarged model, then both models Is described in which rendering processing is performed to overlay the image on the background image. By performing such image processing, a model with an outline can be displayed on the monitor.
[0004]
[Problems to be solved by the invention]
When the polygon model is subjected to the shading process with the contour line by the image processing method as described above, the main body part and the contour part of the polygon model are displayed in different shades of shade. This is the normal vector for shading processing of each polygon that constitutes the reference model, which is the main part of the polygon model, and the normal vector for shading processing of each polygon that constitutes the enlarged model, which is the contour portion of the polygon model. Occurs because they are facing in opposite directions. Therefore, in the conventional image processing method described above, the shade of the contour portion is eliminated by making the reference model and the enlarged model constant without being affected by the light source.
[0005]
However, depending on the type of video game and the progress of the video game, it may be better to apply shading processing to the polygon model. In the conventional image processing method, the polygon model main body part and contour line part are applied for the above reasons. It was difficult to apply the same shade of shade.
[0006]
Accordingly, the present invention has been made to solve the above problem, and can provide a contour line to a model composed of a plurality of polygons, and can perform appropriate shading processing. A program, a three-dimensional game image processing method, and a video game apparatus are provided.
[0007]
[Means for Solving the Problems]
The present invention according to claim 1 is a three-dimensional game image processing program for drawing a model composed of a plurality of polygons in a virtual game space,
The direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal vector used for front / back discrimination of each polygon constituting the reference model. The direction of the normal vector for shading processing used for the shading processing of each of the enlarged polygons is set to the direction of the normal vector for shading processing used for the shading processing of each polygon constituting the reference model. A back model set in the same direction on the reference model as an edged model, and a shading processing means for performing shading processing based on a normal vector for shading processing of each polygon of the edged model;
A video game device is made to function as a drawing means for drawing only a polygon in which a polygon front / back discrimination normal vector of each polygon constituting the bordered model is oriented in the direction of the viewpoint position of the virtual camera in the virtual game space. To do.
[0008]
According to the first aspect of the present invention, a three-dimensional game image processing program for drawing a model composed of a plurality of polygons in a virtual game space is obtained by enlarging a reference model composed of a plurality of polygons. The direction of the normal vector for polygon front / back discrimination used for front / back discrimination of each polygon is set opposite to the direction of the normal vector for polygon front / back discrimination used for front / back discrimination of each polygon constituting the reference model, and has been expanded. Overlay the back model in which the direction of the normal vector for shading processing used for shading processing of each polygon is set in the same direction with respect to the direction of the normal vector for shading processing used for shading processing of each polygon constituting the reference model. Shaded processing of each polygon of the edge model with the edge model Shading processing means that performs shading processing based on normal vectors, and draws only polygons whose polygon front / back discrimination normal vectors of the polygons that make up the edged model are oriented in the direction of the virtual camera viewpoint in the virtual game space The video game device is caused to function as a drawing means.
[0009]
That is, the direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal used for front / back discrimination of each polygon constituting the reference model. The direction of the normal vector for the shading process used for the shading process of each polygon constituting the reference model is set to the direction opposite to the direction of the vector, and the direction of the normal vector for the shading process used for the shading process of each expanded polygon is used. The back model set in the same direction is overlapped with the reference model to form an edge model, and shading processing is performed based on the normal vector for shading processing of each polygon of the edge model, and the polygon front and back of each polygon constituting the edge model Discriminant normal vector Only polygons facing the direction of the viewpoint position of the virtual camera in the virtual game space is drawn.
[0010]
Therefore, the direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal used for front / back discrimination of each polygon constituting the reference model. By overlaying the back model set in the opposite direction to the vector direction on the reference model to form an edged model, the back model can be drawn as an outline of the reference model.
[0011]
In addition, the direction of the normal vector for shading processing used for shading processing of each polygon that constitutes the back model serving as the contour line is set to the same direction as the direction of the normal vector for shading processing used for shading processing of each polygon constituting the reference model. By doing so, the brightness of the outline part of the edged model that overlaps the reference model and the back model and the reference model part change continuously, and the shades of shade can be made uniform. In the case where a contour line is attached to the configured reference model, it is possible to perform an appropriate shading process for applying the same shadow shade to the contour line portion and the reference model portion.
[0012]
In addition, according to the present invention, the video game apparatus can further function as storage means for storing the edge model created in advance.
[0013]
According to this configuration, the video game apparatus further functions as a storage unit that stores a model with an edge created in advance.
[0014]
That is, the direction of the polygon front / back discrimination normal vector for distinguishing the front and back of each enlarged polygon is determined based on the direction of the polygon front / back discrimination normal vector for each polygon constituting the reference model. Since the edge model with the back model set in the opposite direction to the reference model is stored in advance, the back model expanded from the reference model and the reference model are overlaid, and each of the back models It is not necessary to perform geometry processing to change the direction of the normal vector for polygon front / back discrimination, and the time required for this geometry processing can be shortened.
[0015]
Furthermore, the present invention uses the polygon front / back discrimination normal vector as a surface normal vector of each polygon constituting the edge model, and uses the shading processing normal vector as a normal at each vertex of each polygon constituting the edge model. It can also be a vector.
[0016]
According to this configuration, the polygon front / back discrimination normal vector used for front / back discrimination of each polygon constituting the edge model is the surface normal vector of each polygon constituting the edge model, and shading processing of each polygon constituting the edge model The normal vector for shading processing used in is a normal vector at each vertex of each polygon constituting the edged model.
[0017]
That is, since the surface normal vector of each polygon constituting the edge model is used as the polygon front / back surface discrimination normal vector used for front / back determination of each polygon constituting the edge model, the polygon front / back determination is performed using the surface normal vector of the polygon. This can be done by finding the orientation. In addition, since the normal vector at each vertex of each polygon constituting the edge model is used as the shading process normal vector used for the shading process of each polygon constituting the edge model, for example, each polygon of the polygon shading process etc. Shading processing can be performed using the normal vector of the vertex.
[0018]
Furthermore, according to the present invention, the back model can have a smaller number of polygons than the reference model.
[0019]
According to this configuration, the number of polygons constituting the back model is smaller than the number of polygons constituting the reference model.
[0020]
That is, for example, in order to give a real feeling to a character appearing in a video game, the reference model needs to be composed of many fine polygons. However, for example, when the contour line is expressed by a single color, the back model that becomes the contour line does not need to be composed of many fine polygons. Therefore, by reducing the number of polygons that do not affect the contour line in the back model, the edge model in which the reference model and the back model are superimposed is simplified, and the time required for the drawing process can be shortened. Furthermore, by reducing the number of polygons constituting the back model, the memory area used for storing data associated with each vertex of each polygon constituting the back model can be reduced.
[0021]
Furthermore, in the present invention, when the reference model has a stepped portion, the polygon constituting the back model has a vertex on the extreme end of the stepped portion of the reference model and a vertex of the back model corresponding to the vertex. It is also possible to include a polygon composed of
[0022]
According to this configuration, when the reference model has a stepped portion, the polygon constituting the back model is configured with a vertex on the extreme end of the stepped portion of the reference model and a vertex of the back model corresponding to the vertex. Containing polygons.
[0023]
That is, when the reference model has a stepped portion, a polygon composed of a vertex on the endmost portion in the stepped portion of the reference model and a vertex on the endmost portion in the stepped portion of the back model corresponding to the vertex Since it is drawn as a contour line, when displaying an edged model, problems such as a contour line away from the reference model or flickering are eliminated, and a clean edged model can be displayed. In addition, when such a reference model is subjected to shading processing on an edged model with a stepped portion, the brightness of the contoured part of the edged model and the reference model part changes continuously, and the shades of the shadow are made uniform. In addition, when a contour line is attached to a reference model having a stepped portion, it is possible to perform an appropriate shading process in which the same shadow density is applied to the contour line portion and the reference model portion.
[0024]
Furthermore, according to the present invention, the reference model includes a plane model,
The storage means includes the plane model and a back model in which the direction of the normal vector for polygon front / back discrimination of the polygon along the thickness direction of the magnified model obtained by enlarging the plane model and adding thickness is inside the magnified model Can also be stored.
[0025]
According to this configuration, the reference model includes the plane model, and the storage unit is configured to determine the front and back of the polygon along the thickness direction of the plane model and the enlarged model obtained by enlarging the plane model and adding the thickness. An edged model is stored by superimposing a back model with the direction of the discriminant normal vector inside the enlarged model.
[0026]
That is, for example, a back model having the normal direction vector for polygon front / back determination of the polygon along the thickness direction of the enlarged model obtained by enlarging and giving a thickness to a plate-like planar model without thickness is used as the back model. As a result, it is possible to draw an edged model of a planar model without being affected by changes in the viewpoint position. In addition, when attaching a contour line to such a planar model, the brightness of the contoured part and the planar model part of the edged model in which the planar model and the back model are superimposed changes continuously, and the shade of the shadow is reduced. When the contour line is attached to the planar model, an appropriate shading process can be performed in which the contour portion and the planar model portion are shaded with the same shadow.
[0027]
Furthermore, according to the present invention, the drawing means can draw regardless of the direction of the normal vector for polygon front / back discrimination of the planar model.
[0028]
According to this configuration, the drawing means for drawing only the polygons whose normal vectors for front / rear discrimination of the polygons constituting the edged model are oriented in the direction of the viewpoint position of the virtual camera in the virtual game space is the polygon of the planar model. Draw regardless of the direction of the normal vector for front / back discrimination.
[0029]
That is, since the plane model is drawn by the drawing means regardless of the direction of the normal vector for polygon front / back discrimination of the polygon constituting the plane model, the viewpoint position for displaying the surface of the plane polygon is, for example, Even when moving to the viewpoint position for displaying the back surface, it is possible to draw regardless of the front and back of the planar model without being affected by the change in the viewpoint position. In addition, when adding a contour line to a planar model that can be drawn on both sides in this way, the brightness of the contoured line part and the planar model part of the edged model with the planar model and the back model superimposed continuously changes. In addition, the shade density can be made uniform, and when the contour line is attached to the planar model, it is possible to perform an appropriate shading process that applies the same shade density to the contour line portion and the planar model portion.
[0030]
The present invention according to claim 2 is a three-dimensional game image processing method for drawing a model composed of a plurality of polygons in a virtual game space,
Polygons used by the video game device to determine the front and back sides of the polygons constituting the reference model using the directions of the normal vectors for the front and back sides of the polygons used to determine the front and back sides of the polygons obtained by enlarging the reference model composed of a plurality of polygons Shading processing that sets the direction opposite to the direction of the normal vector for front / back discrimination and uses the direction of the normal vector for shading processing used for the shading processing of each enlarged polygon for the shading processing of each polygon constituting the reference model A shading process step of superimposing a back model set in the same direction with respect to the direction of the normal vector on the reference model to form a rim model, and performing a shading process based on a shading process normal vector of each polygon of the rim model,
The video game apparatus includes a drawing step of drawing only a polygon in which a polygon front / back discrimination normal vector of each polygon constituting the bordered model is oriented in the direction of the viewpoint position of the virtual camera in the virtual game space. And
[0031]
According to the second aspect of the present invention, there is provided a three-dimensional game image processing method for drawing a model composed of a plurality of polygons in a virtual game space. The direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the polygon is set to be opposite to the direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon constituting the reference model. In addition, a back model in which the direction of the normal vector for shading processing used for the shading processing of each enlarged polygon is set in the same direction as the direction of the normal vector for shading processing used for the shading processing of each polygon constituting the reference model Overlapping the reference model to make an edge model, and each polygon of the edge model A shading processing step for performing shading processing based on a normal vector for shading processing used for shading processing, and a polygon normal / vertical discrimination normal vector used for front / back discrimination of each polygon constituting a framed model in the virtual game space A drawing step of drawing only a polygon facing the direction of the viewpoint position of the virtual camera.
[0032]
That is, the direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal used for front / back discrimination of each polygon constituting the reference model. The direction of the normal vector for the shading process used for the shading process of each polygon constituting the reference model is set to the direction opposite to the direction of the vector, and the direction of the normal vector for the shading process used for the shading process of each expanded polygon is used. The back model set in the same direction is overlaid on the reference model to form an edged model, and shading processing is performed based on the normal vector for shading processing used for the shading processing of each polygon of the edged model, and each of the elements constituting the edged model Polygon poly Only polygons down sides determine usage normal vector is facing the direction of the viewpoint position of the virtual camera in the virtual game space is drawn.
[0033]
Therefore, the direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal used for front / back discrimination of each polygon constituting the reference model. By overlaying the back model set in the opposite direction to the vector direction on the reference model to form an edged model, the back model can be drawn as an outline of the reference model.
[0034]
In addition, the direction of the normal vector for shading processing used for shading processing of each polygon that constitutes the back model serving as the contour line is set to the same direction as the direction of the normal vector for shading processing used for shading processing of each polygon constituting the reference model. By doing so, the brightness of the outline part of the edged model that overlaps the reference model and the back model and the reference model part change continuously, and the shades of shade can be made uniform. In the case where a contour line is attached to the configured reference model, it is possible to perform an appropriate shading process for applying the same shadow shade to the contour line portion and the reference model portion.
[0035]
The present invention according to claim 3 is a video game apparatus for drawing a model composed of a plurality of polygons in a virtual game space,
The direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal vector used for front / back discrimination of each polygon constituting the reference model. The direction of the normal vector for shading processing used for the shading processing of each of the enlarged polygons is set to the direction of the normal vector for shading processing used for the shading processing of each polygon constituting the reference model. A back model set in the same direction on the reference model as an edged model, and a shading processing means for performing shading processing based on a normal vector for shading processing of each polygon of the edged model;
And a drawing means for drawing only polygons in which the polygon front / back discrimination normal vector of each polygon constituting the edged model is oriented in the direction of the viewpoint position of the virtual camera in the virtual game space.
[0036]
According to the third aspect of the present invention, there is provided a video game apparatus for drawing a model composed of a plurality of polygons in a virtual game space. Each polygon obtained by enlarging a reference model composed of a plurality of polygons The direction of the normal vector for polygon front / back discrimination used for front / back discrimination of the polygon is set to the opposite direction to the direction of the normal vector for front / back discrimination of polygons used for front / back discrimination of the polygons constituting the reference model, and The edge model is created by superimposing the back model, which is set in the same direction as the direction of the normal vector for shading processing used for the shading processing of each polygon constituting the reference model, on the direction of the normal vector for shading processing used for shading processing. , Shading used for shading of each polygon of the edged model The shading processing means for performing shading processing based on the normal vector for ding processing, and the polygon normal / vertical discrimination normal vector used for front / back discrimination of each polygon composing the edged model point in the direction of the viewpoint position of the virtual camera in the virtual game space. And a drawing means for drawing only the polygons.
[0037]
That is, the direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal used for front / back discrimination of each polygon constituting the reference model. The direction of the normal vector for the shading process used for the shading process of each polygon constituting the reference model is set to the direction opposite to the direction of the vector, and the direction of the normal vector for the shading process used for the shading process of each expanded polygon is used. The back model set in the same direction as the reference model is overlaid on the reference model to form a bordered model, and the shading processing means performs shading processing based on the normal vector for shading processing used for shading processing of each polygon of the bordered model, rendering place By the means, it is determined whether or not the polygon front / back discrimination normal vector of each polygon constituting the framed model faces the direction of the viewpoint position of the virtual camera in the virtual game space, and the direction of the viewpoint position of the virtual camera is determined. Texture mapping is performed on the polygon determined to have the normal polygon front / back discrimination normal vector, and the texture mapping is applied to the display memory. The contents of the display memory are read out at a predetermined period, thereby drawing the edge model.
[0038]
Therefore, the direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal used for front / back discrimination of each polygon constituting the reference model. By overlaying the back model set in the opposite direction to the vector direction on the reference model to form an edged model, the back model can be drawn as an outline of the reference model.
[0039]
In addition, the direction of the normal vector for shading processing used for shading processing of each polygon that constitutes the back model serving as the contour line is set to the same direction as the direction of the normal vector for shading processing used for shading processing of each polygon constituting the reference model. By doing so, the brightness of the outline part of the edged model that overlaps the reference model and the back model and the reference model part change continuously, and the shades of shade can be made uniform. In the case where a contour line is attached to the configured reference model, it is possible to perform an appropriate shading process for applying the same shadow shade to the contour line portion and the reference model portion.
[0040]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, a video game apparatus according to an embodiment of the present invention will be described with reference to the drawings.
[0041]
FIG. 1 is a block diagram showing a configuration of a video game apparatus according to an embodiment of the present invention. In the following description, a home video game apparatus configured by connecting a home video game machine to a home television will be described as an example of the video game apparatus, but the present invention is particularly limited to this example. In addition, the present invention can be similarly applied to a professional video game apparatus with an integrated monitor, a personal computer that functions as a video game apparatus by executing a video game program, and the like.
[0042]
The video game apparatus shown in FIG. 1 includes a home game machine 100 and a home television 200. The home-use game machine 100 is loaded with a computer-readable recording medium 300 on which a video game program and game data are recorded, and the video game program and game data are appropriately read to execute the game.
[0043]
A consumer game machine 100 includes a CPU (Central Processing Unit) 1, a bus line 2, a graphics data generation processor 3, an interface circuit (I / F) 4, a main memory 5, a ROM (Read Only Memory) 6, and an expansion circuit 7. , Parallel port 8, serial port 9, drawing processor 10, audio processor 11, decoder 12, interface circuit 13, buffers 14 to 16, recording medium drive 17, memory 18, and controller 19. The home television 200 includes a television monitor 21, an amplifier circuit 22 and a speaker 23.
[0044]
The CPU 1 is connected to the bus line 2 and the graphics data generation processor 3. The bus line 2 includes an address bus, a data bus, a control bus, and the like. The CPU 1, interface circuit 4, main memory 5, ROM 6, decompression circuit 7, parallel port 8, serial port 9, drawing processor 10, audio processor 11, decoder 12 And the interface circuit 13 are connected to each other.
[0045]
The drawing processor 10 is connected to the buffer 14. The audio processor 11 is connected to the buffer 15 and the amplifier circuit 22. The decoder 12 is connected to the buffer 16 and the recording medium drive 17. The interface circuit 13 is connected to the memory 18 and the controller 19.
[0046]
The television monitor 21 of the home television 200 is connected to the drawing processor 10. The speaker 23 is connected to the amplifier circuit 22. In the case of an arcade video game apparatus, the television monitor 21, the amplifier circuit 22, and the speaker 23 may be housed in a single casing together with each block constituting the consumer game machine 100.
[0047]
When the video game apparatus is configured with a personal computer, a workstation, or the like as a core, the television monitor 21 or the like corresponds to a computer display. The decompression circuit 7, the drawing processor 10, the audio processor 11, and the like correspond to a part of program data recorded in the recording medium 300 or hardware on an expansion board installed in an expansion slot of a computer. The interface circuit 4, the parallel port 8, the serial port 9, and the interface circuit 13 correspond to hardware on an expansion board mounted in an expansion slot of a computer. The buffers 14 to 16 correspond to the storage areas of the main memory 5 or the expansion memory, respectively.
[0048]
Next, each component shown in FIG. 1 will be described. The graphics data generation processor 3 serves as a coprocessor for the CPU 1. That is, the graphics data generation processor 3 performs coordinate conversion and light source calculation, for example, calculation of a fixed point format matrix or vector by parallel processing.
[0049]
The main processing performed by the graphics data generation processor 3 is based on the coordinate data, movement amount data, rotation amount data, etc. of each vertex in the two-dimensional or three-dimensional space of the image data supplied from the CPU 1. There are a process for obtaining address data of a processing target image on the display area and returning it to the CPU 1, a process for calculating the luminance of the image according to a distance from a virtually set light source, and the like.
[0050]
The interface circuit 4 is used for an interface of a peripheral device such as a pointing device such as a mouse or a trackball. The main memory 5 is composed of a RAM (Random Access Memory) or the like. The ROM 6 stores program data serving as an operating system for the video game apparatus. This program corresponds to a BIOS (Basic Input Output System) of a personal computer.
[0051]
The decompression circuit 7 performs decompression processing on a compressed image compressed by intra coding conforming to the MPEG (Moving Picture Experts Group) standard for moving images and the JPEG (Joint Photographic Experts Group) standard for still images. The decompression process includes a decoding process (decoding of data encoded by VLC: Variable Length Code), an inverse quantization process, an IDCT (Inverse Discrete Cosine Transform) process, an intra image restoration process, and the like.
[0052]
The drawing processor 10 performs a drawing process on the buffer 14 based on a drawing command issued by the CPU 1 every predetermined time T (for example, T = 1/60 seconds in one frame).
[0053]
The buffer 14 is composed of a RAM, for example, and is divided into a display area (frame buffer) and a non-display area. The display area is composed of a data development area to be displayed on the display surface of the television monitor 21. The non-display area is composed of storage areas such as data for defining a skeleton, model data for defining polygons, animation data for causing the model to move, pattern data indicating the contents of each animation, texture data, and color palette data.
[0054]
Here, the texture data is two-dimensional image data. The color palette data is data for designating a color such as texture data. The CPU 1 records these data in the non-display area of the buffer 14 in advance at a time from the recording medium 300 or a plurality of times according to the progress of the game.
[0055]
The drawing command includes a drawing command for drawing a stereoscopic image using a polygon and a drawing command for drawing a normal two-dimensional image. Here, the polygon is a polygonal two-dimensional virtual figure, and for example, a triangle or a quadrangle is used.
[0056]
A drawing command for drawing a stereoscopic image using polygons includes polygon vertex address data indicating the storage position of polygon vertex coordinate data in the display area of the buffer 14, and the storage position of the texture pasted on the polygon 14 in the buffer 14. Is performed on each of the color address data indicating the storage position on the buffer 14 and the color data indicating the texture brightness.
[0057]
Among the above data, the polygon vertex address data on the display area is converted by the graphics data generation processor 3 by performing coordinate conversion of the polygon vertex coordinate data in the three-dimensional space from the CPU 1 based on the movement amount data and the rotation amount data. It is replaced with polygon vertex coordinate data in two dimensions. The luminance data is determined by the graphics data generation processor 3 based on the distance from the position indicated by the polygon vertex coordinate data after the coordinate conversion from the CPU 1 to the light source virtually arranged.
[0058]
The polygon vertex address data indicates an address on the display area of the buffer 14. The drawing processor 10 performs a process of writing texture data corresponding to the display area range of the buffer 14 indicated by the three polygon vertex address data.
[0059]
An object such as a character in the game space is composed of a plurality of polygons. The CPU 1 stores the coordinate data of each polygon in the three-dimensional space in the buffer 14 in association with the corresponding skeleton vector data. When the character is moved on the display screen of the television monitor 21 by an operation of the controller 19 to be described later, when the character movement is expressed or the viewpoint position at which the character is viewed is changed, the following Processing is performed.
[0060]
That is, the CPU 1 obtains the graphics data generation processor 3 from the three-dimensional coordinate data of the vertices of each polygon held in the non-display area of the buffer 14, the skeleton coordinates, and the rotation amount data. Polygon movement amount data and rotation amount data are given.
[0061]
The graphics data generation processor 3 sequentially obtains the three-dimensional coordinate data after moving and rotating each polygon based on the three-dimensional coordinate data of the vertex of each polygon and the movement amount data and rotation amount data of each polygon.
[0062]
Of the three-dimensional coordinate data of each polygon thus obtained, the coordinate data in the horizontal and vertical directions are supplied to the drawing processor 10 as address data on the display area of the buffer 14, that is, polygon vertex address data.
[0063]
The drawing processor 10 writes the texture data indicated by the texture address data assigned in advance on the display area of the buffer 14 indicated by the three polygon vertex address data. As a result, on the display screen of the television monitor 21, an object in which textures are pasted on a large number of polygons is displayed.
[0064]
A drawing command for drawing a normal two-dimensional image indicates vertex address data, texture address data, color palette address data indicating the storage position on the buffer 14 of color palette data indicating the color of the texture data, and luminance of the texture. This is performed on the luminance data. Among these data, the vertex address data is obtained by the coordinate conversion of the vertex coordinate data on the two-dimensional plane from the CPU 1 by the graphics data generation processor 3 based on the movement amount data and the rotation amount data from the CPU 1.
[0065]
The audio processor 11 stores ADPCM (Adaptive Differential Pulse Code Modulation) data read from the recording medium 300 in the buffer 15, and the ADPCM data stored in the buffer 15 serves as a sound source.
[0066]
Also, the audio processor 11 reads ADPCM data from the buffer 15 based on, for example, a clock signal having a frequency of 44.1 kHz. The audio processor 11 performs processing such as pitch conversion, noise addition, envelope setting, level setting, and reverb addition on the read ADPCM data.
[0067]
When the audio data read from the recording medium 300 is PCM (Pulse Code Modulation) data such as CD-DA (Compact Disk Digital Audio), the audio processor 11 converts the audio data into ADPCM data. Further, the processing for the PCM data by the program is directly performed on the main memory 5. The PCM data processed on the main memory 5 is supplied to the audio processor 11 and converted into ADPCM data. Thereafter, the various processes described above are performed, and sound is output from the speaker 23.
[0068]
As the recording medium drive 17, for example, a DVD-ROM drive, a CD-ROM drive, a hard disk drive, an optical disk drive, a flexible disk drive, a silicon disk drive, a cassette medium reader, or the like is used. In this case, as the recording medium 300, a DVD-ROM, a CD-ROM, a hard disk, an optical disk, a flexible disk, a semiconductor memory, or the like is used.
[0069]
The recording medium drive 17 reads image data, audio data, and program data from the recording medium 300 and supplies the read data to the decoder 12. The decoder 12 performs error correction processing by ECC (Error Correction Code) on the reproduced data from the recording medium drive 17 and supplies the data subjected to the error correction processing to the main memory 5 or the audio processor 11.
[0070]
For example, a card-type memory is used as the memory 18. The card type memory is used for holding various game parameters at the time of interruption, such as holding the state at the time of interruption when the game is interrupted.
[0071]
The controller 19 is an operation device used by the user to input various operation commands, and sends an operation signal corresponding to the user's operation to the CPU 1. The controller 19 includes a first button 19a, a second button 19b, a third button 19c, a fourth button 19d, an up key 19U, a down key 19D, a left key 19L, a right key 19R, and L1 buttons 19L1, L2. A button 19L2, an R1 button 19R1, an R2 button 19R2, a start button 19e, a select button 19f, a left stick 19SL and a right stick 19SR are provided.
[0072]
The up direction key 19U, the down direction key 19D, the left direction key 19L, and the right direction key 19R are used, for example, to give the CPU 1 a command for moving a character or cursor up, down, left, or right on the screen of the television monitor 21. .
[0073]
The start button 19e is used to instruct the CPU 1 to load a game program from the recording medium 300. The select button 19f is used to instruct the CPU 1 to make various selections related to the game program loaded from the recording medium 300 to the main memory 5.
[0074]
The buttons and keys of the controller 19 except the left stick 19SL and the right stick 19SR are turned on when pressed from the neutral position by an external pressing force, and return to the neutral position when the pressing force is released. It consists of an on / off switch that turns off.
[0075]
The left stick 19SL and the right stick 19SR are stick-type controllers having almost the same configuration as a so-called joystick. This stick-type controller has an upright stick, and can be tilted over a 360 ° direction including front, rear, left and right with a predetermined position of the stick as a fulcrum. The left stick 19SL and the right stick 19SR are connected to the CPU 1 via the interface circuit 13 using the values of the x-coordinate in the left-right direction and the y-coordinate in the front-rear direction as the operation signals according to the tilt direction and tilt angle of the stick. To send.
[0076]
The first button 19a, the second button 19b, the third button 19c, the fourth button 19d, the L1 button 19L1, the L2 button 19L2, the R1 button 19R1, and the R2 button 19R2 correspond to the game program loaded from the recording medium 300. Used for various functions.
[0077]
Next, the general operation of the video game apparatus will be described. When the recording medium 300 is loaded in the recording medium drive 17, when a power switch (not shown) is turned on and the video game apparatus is turned on, the recording medium is recorded based on the operating system stored in the ROM 6. The CPU 1 instructs the recording medium drive 17 to read the game program from 300. As a result, the recording medium drive 17 reads image data, audio data, and program data from the recording medium 300. The read image data, audio data, and program data are supplied to the decoder 12, and the decoder 12 performs error correction processing on each data.
[0078]
The image data that has been subjected to error correction processing by the decoder 12 is supplied to the decompression circuit 7 via the bus line 2. The image data that has been subjected to the expansion processing described above by the expansion circuit 7 is supplied to the drawing processor 10, and is written into the non-display area of the buffer 14 by the drawing processor 10. The audio data that has been subjected to the error correction processing by the decoder 12 is written into the buffer 15 via the main memory 5 or the audio processor 11. Program data that has been subjected to error correction processing by the decoder 12 is written into the main memory 5.
[0079]
Thereafter, the CPU 1 advances the video game based on the game program stored in the main memory 5 and the content that the user instructs using the controller 19. In other words, the CPU 1 appropriately performs control of image processing, control of sound processing, control of internal processing, and the like based on contents that the user instructs using the controller 19.
[0080]
As image processing control, for example, the calculation of the coordinates of each skeleton or the calculation of the vertex coordinate data of polygons from the pattern data corresponding to the animation instructed to the character, the obtained three-dimensional coordinate data and the graphics data of the viewpoint position data Supply to the generation processor 3, issue of a rendering command including address data and luminance data on the display area of the buffer 14 obtained by the graphics data generation processor 3 are performed.
[0081]
As control of audio processing, for example, issue of an audio output command to the audio processor 11, specification of level, reverb, etc. are performed. As control of the internal processing, for example, calculation according to the operation of the controller 19 is performed.
[0082]
In the present embodiment, data of an edge model in which the reference model and the back model are overlapped and integrated is stored in advance in the recording medium 300 as model data, and the data of the edge model is stored in a predetermined buffer 14 by a drawing command of the CPU 1. Are read out on the non-display area, written in the display area by performing the above-described image processing, and then repeatedly read out and drawn on the television monitor 21 as a display means. The reference model is a polygon model composed of a plurality of polygons without contour lines, and the back model is the reference model that determines the direction of the normal vector for polygon front / back discrimination used for front / back discrimination of each polygon obtained by enlarging the reference model. Set the reference model to the direction of the normal vector for shading processing used for shading processing of each enlarged polygon, while setting the direction opposite to the direction of the normal vector for polygon front / back detection used for front / back discrimination of each polygon This is a polygon model set in the same direction as the direction of the normal vector for shading processing used for shading processing of each polygon to be performed. When the framed model is drawn, this back model is displayed on the game screen as the outline of the reference model.
[0083]
FIG. 2 is a block diagram showing the functional configuration of the main part centering on the operation of the video game apparatus shown in FIG. As shown in FIG. 2, the video game apparatus is functionally mainly composed of a CPU 1, a graphics data generation processor 3, a rendering processor 10, a computer-readable recording medium 300, a buffer 14, and a television. A monitor 21 and a controller 19 are included.
[0084]
The recording medium 300 includes a program storage unit 34 that stores a video game program including a three-dimensional game image processing program, a camera line-of-sight data storage unit 35 that stores vector data representing the viewpoint position and line-of-sight direction of the virtual camera, and a polygon. It functions as a model data storage unit 36 that stores model information. Note that when the three-dimensional game image processing program is read from the recording medium 300 and is recorded in the main memory 5, the main memory 5 functions as the program storage unit 34.
[0085]
The model data storage unit 36 sets the direction of the surface normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model to the direction of the surface normal vector used for front / back discrimination of each polygon constituting the reference model. In addition to setting the opposite direction, the direction of the vertex normal vector used for the shading process of each enlarged polygon is set to the same direction as the direction of the vertex normal vector used for the shading process of each polygon constituting the reference model The back model is superimposed on the reference model and stored as an edged model. The model data storage unit 36 includes texture data 361 that stores texture data of each polygon constituting the bordered model, vertex normal vector data 362 that stores vertex normal vectors of each vertex of each polygon constituting the border model, , Vertex coordinate data 363 storing the coordinates of each vertex position of each polygon constituting the edge model, and each polygon is a polygon that draws only the surface, or a polygon that draws both surfaces (polygon constituting a plane model) Attribute data 364 for storing whether or not there is is provided in a table format as data corresponding to each polygon for each edged model.
[0086]
In this embodiment, the surface normal vector of each polygon constituting the polygon model is a polygon front / back discrimination normal vector, and the vertex normal vector of each vertex of each polygon constituting the polygon model is a shading processing normal. Is a vector. Polygon front / back discrimination normal vector is a normal vector used to discriminate between the front and back sides of a polygon, and shading processing normal vector is a normal vector used for shading processing. is there.
[0087]
The graphics data generation processor 3 functions as a polygon determination unit 31 and a shading processing unit 32.
[0088]
The polygon discriminating unit 31 discriminates the surface as a surface when the surface normal vector of the polygon constituting the edge model faces the direction of the viewpoint position of the virtual camera, and the surface normal vector of the polygon constituting the edge model is the virtual camera. When it is facing the opposite direction with respect to the viewpoint position, it is determined as the back surface. Specifically, the polygon discriminating unit 31 calculates the inner product of the surface normal vector of each polygon constituting the edged model and the line-of-sight direction vector representing the direction of the virtual camera viewpoint from the start point of the surface normal vector. When the inner product is positive for each of the polygons constituting, the front surface is determined, and when the inner product is negative, the back surface is determined.
[0089]
The shading processing unit 32 performs a shading process based on the vertex normal vector of each polygon constituting the edged model.
[0090]
The drawing processor 10 performs texture mapping, rendering processing, and the like on each model arranged in the three-dimensional space to form an image of the entire model, and functions as the drawing processing unit 33.
[0091]
The drawing processing unit 33 draws only polygons in which the surface normal vector of each polygon constituting the bordered model is oriented in the direction of the virtual camera viewpoint position in the virtual game space. Further, when the reference model is a plane model, the drawing processing unit 33 draws regardless of the direction of the surface normal vector for polygon front / back discrimination.
[0092]
In the present embodiment, the shading processing unit 32 corresponds to a shading processing unit, the drawing processing unit 33 corresponds to a drawing unit, and the model data storage unit 35 corresponds to a storage unit.
[0093]
Polygons constituting the polygon model are polygonal planes such as triangles and quadrilaterals, and one surface of the plane is set as the front surface and the other surface is set as the back surface. The polygon is formed by connecting the vertex coordinates in order, and the order of connecting the vertex coordinates is listed. If the order of connecting the vertex coordinates is clockwise when viewed from the screen, the polygon normal vector is the direction from the back surface to the front surface. If the order of connecting the vertex coordinates is counterclockwise when viewed from the screen, the polygon surface method The line vector is in the direction from the front surface to the back surface. When the surface normal vector of the polygon faces the direction of the virtual camera viewpoint position, the polygon is identified as the surface and drawn. If the surface normal vector of the polygon faces the direction opposite to the direction of the virtual camera viewpoint position, the polygon is determined as the back surface and is not drawn. Therefore, for the reference model, the outer polygon on the virtual camera viewpoint side is drawn as the front surface, and for the back model, the inner polygon on the virtual camera viewpoint side is drawn as the front surface, and an edged model having an outline is drawn.
[0094]
In the present embodiment, when the surface normal vector of the polygon faces the direction of the virtual camera viewpoint position, the line segment connecting the virtual camera viewpoint and the start point of the surface normal vector and the surface normal vector This is a case where the included angle is less than 90 °. In addition, when the surface normal vector of the polygon is directed in the direction opposite to the direction of the virtual camera viewpoint position, the line segment connecting the virtual camera viewpoint and the start point of the surface normal vector, the surface normal vector, Is a case where the included angle is 90 ° or more. In addition, when the surface normal vector of the polygon faces the direction of the virtual camera viewpoint position, the angle between the line segment connecting the virtual camera viewpoint and the starting point of the surface normal vector and the surface normal vector is 90 degrees or less. In this case, when the surface normal vector of the polygon is directed in the direction opposite to the direction of the virtual camera viewpoint position, the virtual camera viewpoint and the surface normal vector This is the case where the included angle formed by the line segment connecting the start point and the surface normal vector is greater than 90 °.
[0095]
Further, in the present embodiment, the inner polygon is a polygon whose surface normal vector faces the inside direction of a polygon model (reference model or back model) composed of the polygon, Is a polygon whose surface normal vector faces the outside direction of a polygon model (reference model or back model) constituted by the polygon.
[0096]
FIG. 3 is a diagram illustrating an example in which the reference model and the edged model are drawn without being subjected to the shading process. FIG. 3A is an example in which only the reference model is drawn without being subjected to the shading process, and FIG. 3B is a diagram in which the reference model shown in FIG. This is an example in which the framed model is drawn without being subjected to the shading process, and is an example of a character that is actually displayed on the television monitor 21. Note that the vertex normal vector and the surface normal vector of each polygon constituting the back model B shown in FIG. 3B are both directed to the inside of the back model B.
[0097]
As shown in FIG. 3A, when a character is represented by only the reference model A without an outline, it cannot be differentiated from the surrounding background, and an animation-like expression is not achieved. Therefore, the direction of the surface normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model A is opposite to the direction of the surface normal vector used for front / back discrimination of each polygon constituting the reference model A. The set back model B is overlapped with the reference model A to form an edged model M, and by drawing the edged model M, a contour line is added to the character as shown in FIG. It will be an expression, and will be differentiated from the background image, making the model stand out.
[0098]
However, when the edge model M shown in FIG. 3B is subjected to the shading process, the vertex normal vector used for the shading process of each polygon constituting the back model B is the shading process for each polygon constituting the reference model A. Since it is directed in the direction opposite to the vertex normal vector used in the above, the shade density of the outline portion and the shade density of the reference model A are displayed differently depending on the position of the light source.
[0099]
FIG. 4 is a screen diagram showing an example of an image obtained by performing a shading process on the edged model in which the directions of the surface normal vector and the vertex normal vector of the polygon constituting the back model are both inside the back model. The screen 400 shown in FIG. 4 displays an edged model M1 in which a reference model A1 and a back model B1 obtained by enlarging the reference model A1 are overlapped. In the screen 400, the light source is provided on the left side of the edged model M1 when viewed from the virtual camera viewpoint. In the reference model A1 shown in FIG. 4, since the light source is on the left side of the fringed model M1, one reference model portion 401 of the reference model A1 is brighter and goes to the other reference model portion 402 of the reference model A1. Therefore it is fading gradually. On the other hand, although the back model B1 has a light source on the left side of the edged model M1, one contour line portion 403 of the back model B1 is dark and goes to the other contour portion 404 of the back model B1. Therefore it is getting brighter gradually. This is because the vertex normal vector for shading processing of each polygon constituting the reference model A1 faces the outside of the reference model A1, and the vertex normal vector of each polygon constituting the back model B1 is inside the back model B1. It happens because you are facing As shown in FIG. 4, if the gradations of shadows of the reference model A1 and the back model B1 are different, the display becomes very uncomfortable. Therefore, when creating the back model B1, the surface normal vector for polygon front / back discrimination of each polygon constituting the back model B1 is directed to the inside of the back model B1, and the shading processing of each polygon constituting the back model B1 is performed. The vertex normal vector is directed to the outside of the back model B1.
[0100]
Next, processing performed as a previous stage of the three-dimensional game image processing according to the present embodiment will be described below.
[0101]
FIG. 5 is a schematic diagram for explaining a reference model, a back model, and an edged model including a reference model and a back model. FIG. 5A shows a polygon PO. A FIG. 5B shows a polygon PO. B FIG. 5C is a diagram showing an edged model M in which the reference model A and the back model B are overlapped.
[0102]
First, the reference model A is expanded. At this time, the coordinates serving as the center point of the reference model A are set and enlarged from the center point in all directions at a predetermined ratio. Since this center point is the origin in the local coordinate system, the vertex coordinate of the enlarged model obtained by enlarging the reference model A is obtained by multiplying each vertex coordinate of the reference model A by a predetermined magnification. Further, the vertices of each polygon of the enlarged model obtained by enlarging the reference model A are arranged on the normal vector of each vertex of the reference model A. Thus, an enlarged model that is uniformly enlarged from the reference model A can be created. Further, the direction of the surface normal vector used for front / back discrimination of each polygon constituting the enlarged model obtained by enlarging the reference model A is the direction of the surface normal vector used for front / back discrimination of each polygon constituting the reference model A. The direction of the vertex normal vector used for the shading process of each enlarged polygon is the same as the direction of the vertex normal vector used for the shading process of each polygon constituting the reference model A. Back model B is created by setting the direction.
[0103]
Subsequently, the reference model A and the back model B are overlapped to obtain an integrated edged model M. The edged model M created as described above is corrected, and the edged model M is recorded as model data. 300 is stored. The correction here is to correct a defect in the back model B that occurs when the reference model A is enlarged at a predetermined magnification. Specifically, a new center point is set, and a predetermined magnification is set from the center point. This is performed by enlarging or reducing the image, and further by newly setting the vertex coordinates of the polygon.
[0104]
Further, as shown in FIG. 5A, the reference model A has a large number of fine polygons PO in order to give a real feeling. A For this reason, the back model B, which is obtained by enlarging the reference model A at a predetermined magnification, has a polygon PO to be drawn. B The number of images increases, and drawing processing takes time. Since the back model B is a polygon model that becomes a contour line, for example, when the contour line is represented by a single color such as black, the polygon PO B Even if the number is reduced, the displayed back model B is hardly affected. Therefore, as shown in FIG. 5B, the back model B is not simply an enlargement of the reference model A at a predetermined magnification, but a polygon PO that does not affect the texture vertices and contours of the back model B. B It is possible to reduce the number of polygons by omitting the vertices and the like, thereby reducing the time required for the drawing process and increasing the speed. Further, by reducing the number of polygons constituting the back model B, the number of vertices of each polygon constituting the back model is also reduced, and the memory area used for storing data associated with each vertex is reduced. Can do.
[0105]
Next, the surface normal vector for distinguishing the polygon front and back of each polygon constituting the back model is directed to the inside of the back model, and the vertex normal vector of each polygon constituting the back model is directed to the outside of the back model. A creation method will be described with reference to FIG.
[0106]
FIG. 6 is an enlarged view of the right side portion MA of the framed model M shown in FIG. 5C, and is a schematic view of the framed model M viewed from the side with respect to the viewing direction of the virtual camera viewpoint C.
[0107]
Polygon PO composing reference model A A Surface normal vector V A Is the polygon PO A Perpendicular to the reference model A. This surface normal vector V A Is the polygon PO A Each vertex P A Vertex normal vector V NA Can be calculated by obtaining the outer product of.
[0108]
To create the back model B, first, the polygon PO constituting the back model B B Each vertex P B Vertex normal vector V NB And the vertex normal vector -V NB And And this vertex normal vector -V NB The polygon PO constituting the back model B is obtained by calculating the outer product of B Surface normal vector V B Is calculated. This surface normal vector V B Is the polygon PO B Is facing the inside of the back model B. Subsequently, the surface normal vector V B The vertex normal vector −V that was inverted earlier is left unchanged. NB The original vertex normal vector V by inverting again NB And
[0109]
In this way, a plurality of polygons PO A Each polygon PO obtained by enlarging the reference model A composed of B Surface normal vector V used for front / back discrimination B Each polygon PO constituting the reference model A with the direction of A Surface normal vector V used for front / back discrimination A Set as the opposite direction to the direction of B Vertex normal vector V used for shading processing NB Each polygon PO constituting the reference model A A Vertex normal vector V used for shading processing NA The back model B set as the same direction with respect to the direction can be superimposed on the reference model A to create a model M with an edge. That is, the vertex normal vector V of the reference model A NA And surface normal vector V A Indicates the outside of the reference model A, and the vertex normal vector V of the back model B NB Faces the outside of the back model B, and the surface normal vector V of the back model B B Is facing the inside of the back model B. When the reference model A and the back model B are overlapped, the reference point of the reference model A and the reference point of the back model B are matched. As the reference point, for example, the center of gravity of the reference model A and the back model B is used. By superimposing the back model B created as described above and the reference model A, an edged model M in which the reference model A is included in the back model B is created, and the created edged model M is stored in advance on the recording medium. 300 or the like.
[0110]
Next, a method for discriminating the front and back surfaces of the polygon will be described with reference to FIG. To determine whether the polygon constituting the model is the front or back surface, the inner product of the line-of-sight vector representing the vector in the direction of the virtual camera viewpoint at the start position of the surface normal vector and the surface normal vector is used. If the calculated inner product is positive, it is determined as the front surface, and if the inner product is negative, it is determined as the back surface. In the reference model A shown in FIG. 6, the surface normal vector V A The line-of-sight vector V representing the vector in the direction of the virtual camera viewpoint position C at the start position a C And surface normal vector V A Inner product V A ・ V C Is represented by the following equation (1).
V A ・ V C = | V A || V C | cos θ 1 (1)
In the above equation (1), V A Is polygon PO A Represents the surface normal vector at V C Is the line-of-sight vector V C Represents θ 1 Is the surface normal vector V A And gaze direction vector V C Represents the included angle.
[0111]
As shown in FIG. 1 Is θ 1 Since it is <90 ° (π / 2), the line-of-sight direction vector V is calculated by the above equation (1). C And surface normal vector V A Inner product V A ・ V C Is V A ・ V C > 0 and the polygon PO constituting the reference model A A Is determined to be a surface.
[0112]
In the back model B shown in FIG. 6, the surface normal vector V B Eye gaze direction vector V representing a vector in the direction of the virtual camera viewpoint position C at the start point position b of C And surface normal vector V B Inner product V B ・ V C Is represented by the following equation (2).
V B ・ V C = | V B || V C | cos θ 2 (2)
In the above equation (1), V B Is polygon PO B Represents the surface normal vector at V C Is the line-of-sight vector V C Represents θ 2 Is the surface normal vector V B And gaze direction vector V C Represents the included angle.
[0113]
As shown in FIG. 2 Is θ 2 Since ≧ 90 ° (π / 2), the line-of-sight vector V C And surface normal vector V B Inner product V B ・ V C Is V B ・ V C <0, and polygon PO constituting back model B B Is determined to be the back side.
[0114]
In this way, by performing a simple calculation for calculating the inner product of the surface normal vector and the line-of-sight direction vector of the polygon, the front and back of the polygon can be easily discriminated.
[0115]
Next, a case where the reference model A is a plate-like planar model will be described. FIG. 7 is a diagram showing an edged model M2 including a planar model A2 and a back model B2. Since the plate-like plane model A2 needs to be visible from both the front and back sides, both sides are always drawn regardless of the front and back sides of the polygon. In this case, not only when the entire model is a plane but also when a part of the model is a plane, only the plane portion is always drawn regardless of the front and back. Therefore, a back model B2 and a plane model A2 in which the direction of the surface normal vector of each polygon in the enlarged model obtained by enlarging the planar model A2 by the size of the contour line and adding thickness to the inside of the enlarged model are The overlapped edge model M2 is stored in advance in the recording medium 300 so that the contour line is drawn from any angle.
[0116]
Thus, for example, the direction of the surface normal vector of the polygon along the thickness direction of the enlarged model obtained by enlarging and giving the thickness to the plate-like planar model A2 having no thickness is set to the inside of the enlarged model, and the vertex normal is obtained. By creating the back model B2 with the vector direction outside the magnified model, the edge model M2 of the planar model A2 can be drawn without being affected by the change in the viewpoint position. In addition, even when an outline is attached to such a planar model A2, the direction of the polygon normal vector along the thickness direction of the enlarged model obtained by enlarging the planar model A2 and adding thickness is set to By setting the inner side, the brightness of the contour line part and the planar model part of the edged model M2 obtained by superimposing the planar model A2 and the back model B2 can be continuously changed, and the shading can be made uniform. When the contour line is attached to the planar model, it is possible to perform an appropriate shading process for applying the same shadow shade to the contour line portion and the planar model portion.
[0117]
Next, a method for correcting the edged model M when the reference model A has a stepped portion will be described. When the reference model A has a portion where two or more reference models A overlap each other or an uneven surface such as a small stepped portion, the enlargement of the reference model A only allows the reference model A to be viewed from a specific viewpoint. A gap is formed between the edge and the polygon of the back model B, and the phenomenon that the outline appears to float or flickers occurs. Therefore, when the reference model A has a stepped portion, it is necessary to correct the polygon of the back model B.
[0118]
FIG. 8 is a schematic diagram for explaining a method of correcting the edged model M when the reference model A has a stepped portion. FIGS. 8A and 8C are schematic views of the drawn edged model M viewed from the side with respect to the line of sight from the virtual camera viewpoint, and FIGS. 8B and 8D are drawn. It is the schematic diagram which looked at the model M with the edge from the virtual camera viewpoint. As shown in FIGS. 8A and 8C, the reference model A has a stepped portion D. A Since the back model B is an enlarged version of the reference model A at a predetermined magnification, the step portion D is formed. B It is the shape which has. As shown in FIG. 8A, when the surface normal vector of the polygon constituting the back model B is inverted inward, the step portion D B Polygon PO formed by connecting the vertex Pb and the vertex Pb ′ on the extreme end of B Is drawn as an outline. Then, when the edged model M viewed with a line of sight as shown by a chain line in FIG. 8A is drawn, a gap is formed between the back model B, which is a contour line, and the reference model A as shown in FIG. 8B. S is made. As described above, when the gap S is formed between the reference model A and the back model B, the contour line is not drawn at an appropriate position, so that it appears to the user as if the contour line is floating. Therefore, in order to prevent a gap S from being formed between the reference model A and the back model B, correction is performed so as to close a portion where the gap S is seen from various viewpoints. That is, as shown in FIG. 8C, the vertex Pb ′ of the back model B is set to the step portion D of the reference model A. A Is moved to the vertex Pa on the extreme end of the polygon PO, and the polygon PO is connected between the vertex Pb and the vertex Pa. B By doing so, the gap S between the reference model A and the back model B becomes a polygon PO. B It is closed by 'and the outline is drawn without gaps. In this case, the polygon PO B The surface normal vector of 'is set to face the direction of the virtual camera viewpoint C, and the vertex normal vector is also set to face the direction of the virtual camera viewpoint C.
[0119]
In addition, the polygon PO is simply connected between the vertex Pb and the vertex Pa. B Just “Polygon PO” B The width of the contour line represented by 'becomes thicker than the width of the other contour lines, so the step portion D of the reference model A A And the step D of the back model B corresponding to the vertex Pa. B The width between the vertices Pb on the most end portion may be changed according to the width of another contour line.
[0120]
Thus, the reference model A is the stepped portion D. A Step D of the reference model A A And the stepped portion D of the back model B corresponding to the vertex Pa. B Polygon PO composed of the vertex Pb on the extreme end in B Since 'is drawn as a contour line, when the model M with a border is displayed, problems such as a contour line away from the reference model A and flickering are eliminated, and a clean model M with a border can be displayed. become. Further, such a reference model A has a stepped portion D. A Even when the shading process is applied to the rimmed model M having, the brightness of the contour line portion of the rimmed model M and the reference model portion continuously change, and the shading can be made uniform. A When a contour line is attached to the reference model A having, appropriate shading processing can be performed in which the same shadow shade is applied to the contour line portion and the reference model portion.
[0121]
FIG. 9 is a flowchart for explaining 3D game image processing by the video game apparatus shown in FIG. Note that the three-dimensional game image processing in the video game apparatus is processing performed by the CPU 1 or the like executing a three-dimensional game image processing program.
[0122]
First, in step S1, the CPU 1 uses the surface normal vector V used for front / back discrimination of each polygon obtained by enlarging the reference model A. B Is the surface normal vector V used for front / back discrimination of each polygon constituting the reference model A. A Model data related to the edge model M obtained by superimposing the back model B set in the opposite direction to the reference model A is read from the recording medium 300, and the data is sent to the graphics data generation processor 3.
[0123]
Subsequently, in step S2, the graphics data generation processor 3 determines based on the attribute data whether or not the polygons constituting the read edge model M are drawn regardless of the front and back sides. Each polygon constituting the framed model M is associated with attribute data as a flag indicating whether it is a polygon for drawing only the surface polygon of the polygon model or a polygon for which both sides are drawn. For example, when the flag is “1”, the polygon is a polygon in which only the front surface is drawn without drawing the back side, and when the flag is “0”, the polygon is a polygon in which both sides are drawn regardless of the front and back sides. It is determined. Here, when the edge model M is a polygon of a planar model drawn regardless of the front and back, and the flag is “0” (YES in step S2), the process proceeds to step S4, where the edge model M is a polygon with front and back. If the flag is “1” (NO in step S2), the process proceeds to step S3.
[0124]
In step S3, the graphics data generation processor 3 determines whether the polygon is a surface viewed from the virtual camera viewpoint. The graphics data generation processor 3 determines whether or not the polygon of the edged model M with the front and back sides is the surface. The graphics data generation processor 3 calculates the inner product between the line-of-sight direction vector and the surface normal vector of the polygon. If the inner product is positive, it is determined as a surface (YES in step S3), and the polygon data on the display area of the buffer 14 is displayed. The polygon vertex address data indicating the storage position at is sent to the drawing processor 10, and the process proceeds to step S4. If the inner product of the line-of-sight direction vector and the surface normal vector of the polygon is negative, the graphics data generation processor 3 determines that it is the back surface (NO in step S3), and ends without drawing the polygon.
[0125]
In step S4, the graphics data generation processor 3 performs a shading process on the polygon determined as the surface in step S3.
[0126]
Here, the shading process will be described. The shading process is a process for applying shades of shade generated on the model surface by irradiating the model with light from a light source. In this embodiment, the shading process uses a Gouraud shading process which is one of the smooth shading processes. As a light source used for the shading process, an infinite light source, a point light source, a spotlight, a line light source, a surface light source, or the like may be used.
[0127]
The Gouraud shading process is a process performed using the vertex normal vector of each polygon constituting the model. Specifically, the luminance of all the vertices constituting the polygon is calculated, and the luminance of the ridge line of the polygon and the luminance of each point inside the polygon are determined by linear interpolation based on the luminance of the vertex. The graphics data generation processor 3 sends the polygon brightness calculated as described above to the drawing processor 10 as brightness data. In this way, in the Gouraud shading process, the brightness of the vertex is obtained from the vertex normal vector of each polygon, and the shading process is performed to smoothly show the connection between adjacent polygons by applying gradation to the plane by linear interpolation. By performing the shading process by the Gouraud shading process, the corners and ridgelines of the polygons constituting the edged model M displayed become inconspicuous, the brightness changes continuously, and the shades of the shadow can be expressed smoothly.
[0128]
In step S5, the drawing processor 10 draws the polygon determined to be the front surface in step S3. The drawing processor 10 draws in the display area of the buffer 14 based on the luminance data and polygon vertex address data of the polygon determined to be the surface in step S3, and the polygon is displayed on the display surface of the television monitor 21. Is done.
[0129]
In this way, the surface normal vector V used for front / back discrimination of each polygon obtained by enlarging the reference model A B The direction of (polygon front / back normal vector) is the surface normal vector V used for front / back discrimination of each polygon constituting the reference model A. A The back model B set in the opposite direction to the direction of (polygon front / back discrimination normal vector) is superimposed on the reference model A to form an edged model M, so that the back model B is drawn as a contour line of the reference model A. .
[0130]
In addition, the direction of the vertex normal vector (shading processing normal vector) used for the shading process of each polygon constituting the back model B serving as the contour line is used as the vertex normal vector used for the shading process of each polygon constituting the reference model A. By setting the same direction as the (shading processing normal vector) direction, the brightness of the outline part of the edged model M in which the reference model A and the back model B are superimposed and the reference model part continuously change. In addition, when shading can be made uniform and a contour line is added to the reference model A composed of a plurality of polygons, an appropriate shading process for applying the same shadow shading to the contour portion and the reference model portion. It can be performed.
[0131]
Further, the direction of the surface normal vector (polygon front / back discrimination normal vector) used for front / back discrimination of each polygon obtained by enlarging the reference model A is the surface normal vector used for front / back discrimination of each polygon constituting the reference model A. Since the back model B set in the opposite direction to the direction of the (polygon front / back discrimination normal vector) is superimposed on the reference model A and stored in advance in the recording medium 300 as the edged model M, the reference model A is enlarged. The time required for the processing can be shortened as compared with the case where the geometric processing for superimposing and changing the direction of the normal vector to make the edged model M is performed each time drawing is performed.
[0132]
FIG. 10 is a screen diagram illustrating an example of an edged model subjected to shading processing. A screen 410 shown in FIG. 10 displays an edged model M in which a reference model A and a back model B obtained by enlarging the reference model A are overlapped. In the screen 410, the light source is provided on the left side of the framed model M when viewed from the virtual camera viewpoint. In the reference model A shown in FIG. 10, since the light source is on the left side of the fringed model M, one reference model portion 401 of the reference model A is bright and goes to the other reference model portion 402 of the reference model A. Therefore it is fading gradually. Furthermore, since the light source is also on the left side of the edged model M with respect to the back model B, it gradually darkens from one contour line portion 403 to the other contour portion 404 of the back model B. FIG. The contour part 403 of the back model B is lighter than the contour part 403 of the back model B1 shown in FIG. 4, and the contour part 404 of the back model B is compared to the contour line part 404 of the back model B1 shown in FIG. Is getting darker. Thus, the reference model A can be contoured by setting the vertex normal vector of the back model B outside the back model B and the surface normal vector of the back model B inside the back model B. At the same time, it is possible to perform an appropriate shading process for applying the same shadow density to the reference model A and the back model B, and it is possible to realize a contour line without a sense of incongruity.
[0133]
In the above embodiment, it is assumed that the edge model M is created by superimposing the reference model A and the back model B obtained by enlarging the reference model A, and data relating to the edge model M is stored in advance. Although described above, the present invention is not particularly limited to this, and only the data related to the reference model A may be stored, and the marginal model M may be created for each drawing process. Hereinafter, another embodiment of the present invention will be described with reference to FIG.
[0134]
FIG. 11 is a flowchart for explaining another embodiment of the three-dimensional game image processing by the video game apparatus shown in FIG. Note that the three-dimensional game image processing in the video game apparatus is processing performed by the CPU 1 or the like executing a three-dimensional game image processing program.
[0135]
In step S <b> 11, the CPU 1 reads data related to the reference model A from the recording medium 300 and sends the data to the graphics data generation processor 3.
[0136]
In step S12, the graphics data generation processor 3 creates an enlarged model in which the reference model A is enlarged by a predetermined magnification by the size of the contour line. The vertex coordinates of each polygon constituting the enlarged model can be obtained by multiplying the vertex coordinates of each polygon constituting the reference model A by a predetermined magnification.
[0137]
In step S13, the graphics data generation processor 3 keeps the direction of the vertex normal vector used for the shading process of each polygon constituting the enlarged model created in step S12, and determines the front and back surfaces of each polygon. A back model B is created with the normal vector as a direction opposite to the direction of the surface normal vector for distinguishing the front and back of each polygon constituting the reference model A.
[0138]
In step S14, the graphics data generation processor 3 creates an edged model M by superimposing the reference model A and the back model B created in step S13. At this time, the edged model M is created by matching the center position (for example, the center of gravity) of the reference model A with the center position (for example, the center of gravity) of the back model B.
[0139]
The processing from step S15 to step S18 is the same as the processing from step S2 to step S5 in FIG.
[0140]
The process in step S13 and the process in step S14 may be reversed. In step S13, the reference model A and the enlarged model are overlapped, and in step S14, the direction of the surface normal vector of the enlarged model is changed. A model M may be created.
[0141]
In this way, without creating the edged model M in which the reference model A and the back model B are overlapped in advance and storing them in the recording medium 300, only the data relating to the reference model A is stored in the recording medium 300, and the CPU 1 The edged model M may be created based on the reference model A by the geometry processing of the video game device in response to the drawing instruction. In this case, it takes some time to create the marginal model M, but only the data related to the reference model A needs to be stored, so the storage capacity of the memory can be reduced.
[0142]
In the present embodiment, it is possible to change the color and texture of the contour line represented by the back model. That is, by setting the texture data of each polygon of the back model to be the contour line in various colors and materials, various expressions according to the game situation are possible. For example, the aura appears by adding gradation to the polygon of the back model obtained by enlarging the reference model representing the character appearing in the game at a predetermined magnification.
[0143]
In the present embodiment, the Gouraud shading process is used as the shading process. However, the present invention is not particularly limited to this, and other smooth shading processes such as a flat shading process or a phone shading process are used. May be.
[0144]
【The invention's effect】
According to the first aspect of the present invention, the direction of the normal vector for polygon front / back discrimination used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is used to configure each polygon constituting the reference model. The back model can be drawn as the outline of the reference model by overlapping the back model set in the opposite direction to the direction of the normal vector for polygon front / back detection used for the front / back discrimination with the reference model. . In addition, the direction of the normal vector for shading processing used for shading processing of each polygon that constitutes the back model serving as the contour line is set to the same direction as the direction of the normal vector for shading processing used for shading processing of each polygon constituting the reference model. By doing so, the brightness of the outline part of the edged model that overlaps the reference model and the back model and the reference model part change continuously, and the shades of shade can be made uniform. In the case where a contour line is attached to the configured reference model, it is possible to perform an appropriate shading process for applying the same shadow shade to the contour line portion and the reference model portion.
[0145]
In addition, according to the present invention, the reference model composed of a plurality of polygons is enlarged, and the direction of the normal vector for polygon front / back discrimination for discriminating the front / back of each enlarged polygon is determined. Since the edge model in which the back model set in the opposite direction to the direction of the normal vector for discrimination is superimposed on the reference model is stored in advance, this is done after superimposing the back model on which the reference model is enlarged and the reference model. It is not necessary to perform geometry processing for changing the direction of the normal vector for polygon front / back determination of each polygon constituting the back model, and the time required for this geometry processing can be shortened.
[0146]
Furthermore, according to the present invention, since the surface normal vector of each polygon constituting the edge model is used as the polygon front / back identification normal vector used for front / back identification of each polygon constituting the edge model, This can be done by obtaining the direction of the surface normal vector. In addition, since the normal vector at each vertex of each polygon constituting the edge model is used as the shading process normal vector used for the shading process of each polygon constituting the edge model, for example, each polygon of the polygon shading process etc. Shading processing can be performed using the normal vector of the vertex.
[0147]
Furthermore, according to the present invention, the back model reduces the number of polygons that do not affect the contour line, thereby simplifying the edge model in which the reference model and the back model are overlapped, and reducing the time required for the drawing process. In addition, by reducing the number of polygons constituting the back model, the memory area used for storing data associated with each vertex of each polygon constituting the back model can be reduced. it can.
[0148]
Furthermore, according to the present invention, when the reference model has a stepped portion, the vertex on the endmost portion in the stepped portion of the reference model and the vertex on the endmost portion in the stepped portion of the back model corresponding to the vertex Since the polygon composed of and is drawn as a contour line, when displaying a model with a border, problems such as a contour line away from the reference model or flickering can be solved, and a beautiful model with a border can be displayed. In addition, even when such a reference model is subjected to a shading process on an edged model having a stepped portion, the brightness of the contoured part of the edged model and the reference model part changes continuously, and shadows change. If the reference model with a step is attached with a contour line, the same shadow shade should be applied to the contour part and the reference model part. It is possible to perform the shading process.
[0149]
Furthermore, according to the present invention, for example, the direction of the normal vector for polygon front / back discrimination of the polygon along the thickness direction of the enlarged model obtained by enlarging the plate-like planar model without thickness and giving the thickness is By using the back model as the inside, it is possible to draw a model with an edge of the plane model without being affected by changes in the viewpoint position. Furthermore, even when an outline is attached to the plane model, the plane model and the back model The brightness of the contoured part of the model with the edge and the planar model part changes continuously, and the shade of the shadow can be made uniform, and when the contour line is attached to the planar model, the contour part Appropriate shading processing for applying the same shade of shade to the plane model portion can be performed.
[0150]
Furthermore, according to the present invention, since the polygons constituting the plane model have attribute information that can be drawn on both sides, for example, the viewpoint position for displaying the surface of the plane polygon is the plane polygon. Even when moving to the viewpoint position for displaying the back of the plane, it is possible to draw regardless of the front and back of the plane model without being affected by the change of the viewpoint position. Even when a contour line is attached to the model, the brightness of the contour line part and the planar model part of the edged model where the planar model and the back model are overlaid changes continuously, making it possible to make the shadow shade uniform. When the contour line is attached to the planar model, it is possible to perform an appropriate shading process for applying the same shadow shade to the contour line portion and the planar model portion.
[0151]
According to the second aspect of the present invention, the direction of the normal vector for polygon front / back discrimination used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is used to configure each polygon constituting the reference model. The back model can be drawn as the outline of the reference model by overlapping the back model set in the opposite direction to the direction of the normal vector for polygon front / back detection used for the front / back discrimination with the reference model. . In addition, the direction of the normal vector for shading processing used for shading processing of each polygon that constitutes the back model serving as the contour line is set to the same direction as the direction of the normal vector for shading processing used for shading processing of each polygon constituting the reference model. By doing so, the brightness of the outline part of the edged model that overlaps the reference model and the back model and the reference model part change continuously, and the shades of shade can be made uniform. In the case where a contour line is attached to the configured reference model, it is possible to perform an appropriate shading process for applying the same shadow shade to the contour line portion and the reference model portion.
[0152]
According to the third aspect of the present invention, the direction of the normal vector for polygon front / back discrimination used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is used to configure each polygon constituting the reference model. The back model can be drawn as the outline of the reference model by overlapping the back model set in the opposite direction to the direction of the normal vector for polygon front / back detection used for the front / back discrimination with the reference model. . In addition, the direction of the normal vector for shading processing used for shading processing of each polygon that constitutes the back model serving as the contour line is set to the same direction as the direction of the normal vector for shading processing used for shading processing of each polygon constituting the reference model. By doing so, the brightness of the outline part of the edged model that overlaps the reference model and the back model and the reference model part change continuously, and the shades of shade can be made uniform. In the case where a contour line is attached to the configured reference model, it is possible to perform an appropriate shading process for applying the same shadow shade to the contour line portion and the reference model portion.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a video game apparatus according to an embodiment of the present invention.
2 is a block diagram showing a functional configuration of a main part centering on an operation of the video game apparatus shown in FIG. 1. FIG.
FIG. 3 is a diagram illustrating an example in which a reference model and an edged model are drawn without being subjected to shading processing.
FIG. 4 is a screen diagram illustrating an example of an image obtained by performing a shading process on an edged model in which the surface normal vector and the vertex normal vector of a polygon constituting the back model are both inside the back model.
FIG. 5 is a schematic diagram for explaining a reference model, a back model, and an edged model including a reference model and a back model.
6 is an enlarged view of the right side portion MA of the model M with an edge shown in FIG. 5 (c).
FIG. 7 is a diagram showing an edged model M2 including a plane model A2 and a back model B2.
FIG. 8 is a schematic diagram for explaining a method for correcting an edged model M when the reference model A has a shape having a stepped portion.
FIG. 9 is a flowchart for explaining 3D game image processing by the video game apparatus shown in FIG. 1;
FIG. 10 is a screen diagram showing an example of a model with an edge subjected to shading processing.
FIG. 11 is a flowchart for explaining another embodiment of three-dimensional game image processing by the video game apparatus shown in FIG. 1;
[Explanation of symbols]
1 CPU
2 Bus lines
3 Graphics data generation processor
4,13 Interface circuit
5 Main memory
6 ROM
7 Stretching circuit
8 Parallel port
9 Serial port
10 Drawing processor
11 Speech processor
12 Decoder
14-16 buffers
17 Recording media driver
18 memory
19 Controller
21 Television monitor
31 Polygon discrimination part
32 Shading processor
33 Drawing processor
34 Program storage
35 Camera line-of-sight data storage
36 Model data storage
300 recording media
361 texture data
362 Vertex normal vector data
363 Vertex coordinate data
364 attribute data
A, A1, A2 reference model
B, B1, B2 back model
M, M1, M2 Edge model

Claims (3)

仮想ゲーム空間内に複数のポリゴンで構成されるモデルを描画する3次元ゲーム画像処理プログラムであって、
複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを前記基準モデルに重ねて縁付きモデルとし、当該縁付きモデルの各ポリゴンのシェーディング処理用法線ベクトルに基づいてシェーディング処理を行うシェーディング処理手段と、
前記縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画手段としてビデオゲーム装置を機能させることを特徴とする3次元ゲーム画像処理プログラム。
A three-dimensional game image processing program for drawing a model composed of a plurality of polygons in a virtual game space,
The direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal vector used for front / back discrimination of each polygon constituting the reference model. The direction of the normal vector for shading processing used for the shading processing of each of the enlarged polygons is set to the direction of the normal vector for shading processing used for the shading processing of each polygon constituting the reference model. A back model set in the same direction on the reference model as an edged model, and a shading processing means for performing shading processing based on a normal vector for shading processing of each polygon of the edged model;
A video game device is made to function as a drawing means for drawing only a polygon in which a polygon front / back discrimination normal vector of each polygon constituting the bordered model is oriented in the direction of the viewpoint position of the virtual camera in the virtual game space. 3D game image processing program.
仮想ゲーム空間内に複数のポリゴンで構成されるモデルを描画する3次元ゲーム画像処理方法であって、
ビデオゲーム装置が、複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンの表裏判別用に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを前記基準モデルに重ねて縁付きモデルとし、当該縁付きモデルの各ポリゴンのシェーディング処理用法線ベクトルに基づいてシェーディング処理を行うシェーディング処理ステップと、
ビデオゲーム装置が、前記縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画ステップとを含むことを特徴とする3次元ゲーム画像処理方法。
A three-dimensional game image processing method for drawing a model composed of a plurality of polygons in a virtual game space,
The video game device uses the direction of the normal vector for polygon front / back discrimination used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons for front / back discrimination of each polygon constituting the reference model Shading used to set the direction opposite to the direction of the normal vector for polygon front / back discrimination and to use the direction of the normal vector for shading processing used for the shading processing of each enlarged polygon for the shading processing of each polygon constituting the reference model A shading processing step of superimposing a back model set in the same direction with respect to the direction of the processing normal vector on the reference model to form an edged model, and performing shading processing based on the shading processing normal vector of each polygon of the edged model; ,
The video game apparatus includes a drawing step of drawing only a polygon in which a polygon front / back discrimination normal vector of each polygon constituting the bordered model is oriented in the direction of the viewpoint position of the virtual camera in the virtual game space. A three-dimensional game image processing method.
仮想ゲーム空間内に複数のポリゴンで構成されるモデルを描画するビデオゲーム装置であって、
複数のポリゴンで構成される基準モデルを拡大して得られる各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンの表裏判別に用いるポリゴン表裏判別用法線ベクトルの方向に対して反対方向に設定するとともに、拡大された各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向を前記基準モデルを構成する各ポリゴンのシェーディング処理に用いるシェーディング処理用法線ベクトルの方向に対して同じ方向に設定した裏モデルを前記基準モデルに重ねて縁付きモデルとし、当該縁付きモデルの各ポリゴンのシェーディング処理用法線ベクトルに基づいてシェーディング処理を行うシェーディング処理手段と、
前記縁付きモデルを構成する各ポリゴンのポリゴン表裏判別用法線ベクトルが仮想ゲーム空間内における仮想カメラの視点位置の方向を向いているポリゴンのみを描画する描画手段とを備えることを特徴とするビデオゲーム装置。
A video game device for drawing a model composed of a plurality of polygons in a virtual game space,
The direction of the polygon front / back discrimination normal vector used for front / back discrimination of each polygon obtained by enlarging the reference model composed of a plurality of polygons is the polygon front / back discrimination normal vector used for front / back discrimination of each polygon constituting the reference model. The direction of the normal vector for shading processing used for the shading processing of each of the enlarged polygons is set to the direction of the normal vector for shading processing used for the shading processing of each polygon constituting the reference model. A back model set in the same direction on the reference model as an edged model, and a shading processing means for performing shading processing based on a normal vector for shading processing of each polygon of the edged model;
A video game apparatus comprising: a drawing unit that draws only a polygon in which a polygon front / back discrimination normal vector of each polygon constituting the edged model is oriented in the direction of the viewpoint position of the virtual camera in the virtual game space. .
JP2002137528A 2002-05-13 2002-05-13 3D game image processing program, 3D game image processing method, and video game apparatus Expired - Lifetime JP3586679B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002137528A JP3586679B2 (en) 2002-05-13 2002-05-13 3D game image processing program, 3D game image processing method, and video game apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002137528A JP3586679B2 (en) 2002-05-13 2002-05-13 3D game image processing program, 3D game image processing method, and video game apparatus

Publications (2)

Publication Number Publication Date
JP2003331312A JP2003331312A (en) 2003-11-21
JP3586679B2 true JP3586679B2 (en) 2004-11-10

Family

ID=29699256

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002137528A Expired - Lifetime JP3586679B2 (en) 2002-05-13 2002-05-13 3D game image processing program, 3D game image processing method, and video game apparatus

Country Status (1)

Country Link
JP (1) JP3586679B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112529996B (en) * 2020-12-16 2024-02-23 网易(杭州)网络有限公司 Method and device for generating model and electronic equipment

Also Published As

Publication number Publication date
JP2003331312A (en) 2003-11-21

Similar Documents

Publication Publication Date Title
JP3725524B2 (en) Method for generating computer display image and computer processing system and graphics processor for generating image data
US8602888B2 (en) Video game device and image processing program
WO2000025269A1 (en) Recording medium, image processing device, and image processing method
JP4917346B2 (en) Game image processing program and game image processing apparatus
JP3625172B2 (en) Image creating apparatus, image creating method, computer-readable recording medium on which image creating program is recorded, and video game apparatus
JP3661167B2 (en) Apparatus and method for performing refraction mapping
JP3604312B2 (en) Computer-readable recording medium having recorded video game program, object drawing method in video game, and video game apparatus
JP4082937B2 (en) GAME SYSTEM AND GAME PROGRAM
JP2006195882A (en) Program, information storage medium and image generation system
JP4193979B2 (en) Shadow volume generation program and game device
US7068273B2 (en) Recording medium which stores 3D image processing program, 3D image processor, 3D image processing method, and video game machine
JP3597792B2 (en) 3D image processing method, apparatus, 3D image processing program, and video game apparatus
JP3807654B2 (en) Computer-readable recording medium having recorded video game program, object drawing method in video game, and video game apparatus
JP4995054B2 (en) GAME PROGRAM, RECORDING MEDIUM CONTAINING THE GAME PROGRAM, AND COMPUTER
JP3586679B2 (en) 3D game image processing program, 3D game image processing method, and video game apparatus
JP3617960B2 (en) Three-dimensional game image processing program, three-dimensional game image processing method, and video game apparatus
JP2009140135A5 (en)
JP3737784B2 (en) 3D image processing program, 3D image processing method, and video game apparatus
JP3643036B2 (en) Apparatus and method for perspective transformation
JP4231684B2 (en) GAME DEVICE AND GAME PROGRAM
JP4584665B2 (en) 3D game image processing program, 3D game image processing method, and video game apparatus
JP4233859B2 (en) GAME DEVICE AND GAME PROGRAM
JP4391633B2 (en) Image generation system and information storage medium
JP3708904B2 (en) Image processing program
JP2003015214A (en) Image display device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040726

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: 20040803

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040809

R150 Certificate of patent or registration of utility model

Ref document number: 3586679

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090813

Year of fee payment: 5

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090813

Year of fee payment: 5

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090813

Year of fee payment: 5

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090813

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100813

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110813

Year of fee payment: 7

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110813

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120813

Year of fee payment: 8

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130813

Year of fee payment: 9

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130813

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140813

Year of fee payment: 10

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term