JP3715568B2 - Image drawing apparatus, recording medium, and program - Google Patents

Image drawing apparatus, recording medium, and program Download PDF

Info

Publication number
JP3715568B2
JP3715568B2 JP2001359017A JP2001359017A JP3715568B2 JP 3715568 B2 JP3715568 B2 JP 3715568B2 JP 2001359017 A JP2001359017 A JP 2001359017A JP 2001359017 A JP2001359017 A JP 2001359017A JP 3715568 B2 JP3715568 B2 JP 3715568B2
Authority
JP
Japan
Prior art keywords
polygon
leaf
image
vector
image drawing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2001359017A
Other languages
Japanese (ja)
Other versions
JP2002245481A (en
Inventor
貴之 山口
亮弥 油井
孝司 坪井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Interactive Entertainment Inc
Original Assignee
Sony Computer Entertainment Inc
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 Sony Computer Entertainment Inc filed Critical Sony Computer Entertainment Inc
Priority to JP2001359017A priority Critical patent/JP3715568B2/en
Publication of JP2002245481A publication Critical patent/JP2002245481A/en
Application granted granted Critical
Publication of JP3715568B2 publication Critical patent/JP3715568B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Generation (AREA)

Description

【0001】
本発明は、植物の葉などのように、同一形状のオブジェクトを多数描画する場合に好適な画像描画装置、この画像描画処理を実現するプログラムが記録された記録媒体及びプログラムに関する。
【0002】
【従来の技術】
近時、隠線処理、隠面消去処理、スムーズシェーディング、テクスチャマッピング等のコンピュータグラフィックス(CG)処理が、ハードウエアの飛躍的な発達と相俟って急速に進歩している。
【0003】
CG処理としては、一般に、CADの3次元モデリングによって複数の3次元形状(オブジェクト)を作成し、これらのオブジェクトに対して色や陰影をつけ、鏡面反射、拡散反射、屈折、透明感などの光学的特性を付加し、表面模様をつけ、更に、まわりの状況(窓や景色の映り込みや光の回り込み等)に応じて描画するというレンダリング処理が行われる。
【0004】
【発明が解決しようとする課題】
ところで、植物の葉などのように、同一形状のオブジェクトを多数描く場合、すべてのオブジェクトについて上述したレンダリング処理を施して描画する方法が考えられるが、細かなポリゴン単位に処理が行われるため、その計算や描画に長時間がかかり、例えばモニタの画面上でのこれらオブジェクトの表示速度が遅くなるという不都合が生じる。
【0005】
また、葉をそれぞれ1つのポリゴンで表示させる場合に、ポリゴンは平面であることから視点の位置によっては表示が不自然になることがある。
【0006】
それぞれの葉を複数のポリゴンで構成すれば、実物の葉のように緩やかな曲面をもつ形状に近似させることも可能であるがポリゴン情報データが肥大化してしまう。
【0007】
さらには、植物の葉のように多数のポリゴンを有する画像を製作する場合、画像製作者がその多数のポリゴンの配置を1つずつ決めなくてはならず、画像製作者にとって大きな負担となっている。
【0008】
本発明はこのような課題を考慮してなされたものであり、植物の葉などのように、同一形状の構成物を多数描画する場合に各々の構成物を1つのポリゴンで表し、さらに、適切な方向を向くようにポリゴンを回転させる処理を行うことで計算や描画にかかる時間を大幅に低減することができる画像描画装置、前記画像描画処理を実現することができるプログラムが記録された記録媒体及びプログラムを提供することを目的とする。
【0009】
【課題を解決するための手段】
本発明に係る画像描画装置、本発明に係る記録媒体並びに本発明に係るプログラムは、オブジェクトおよびポリゴンが配置される仮想空間上の座標系で、少なくとも1つのポリゴンについて、所定の手段により回転させる手段と、画像を描画する基準の仮想視点の方向と、回転した前記ポリゴンの面の法線の方向とのなす角が90°±a°のときに、前記ポリゴン面の向きを再設定する手段とを有することを特徴とする。
【0010】
このようにすることにより、仮想視点から見てポリゴンが見えづらいということがなく、また、植物の自然な雰囲気を表現することなどができる。ここで、前記ポリゴンは、植物の葉または枝を含む画像とすれば植物を描画することができる。
【0011】
た前記所定の手段は乱数発生手段であり、該乱数発止手段によって得られた乱数から設定された方向に前記ポリゴンを回転させてもよい。
【0013】
このようにすることにより、仮想視点から見てポリゴンが見えづらいということがなく、また、植物の自然な雰囲気を表現することなどができる。
【0019】
さらに、前記ポリゴンは、長方形又は正方形であると処理しやすい。
【0020】
またさらに、前記ポリゴンに関する情報は、前記ポリゴンの全頂点のうち少なくとも1つの頂点の位置情報データを有するようにするとデータ量を少なくすることができる。
【0021】
前記ポリゴンを回転させるステップでは、前記少なくとも1つの頂点の位置情報データに対して回転の計算を施して回転後の変換位置を求めるとともに、他の頂点は前記変換位置から換算して求めると計算量を低減させることが可能である。
【0022】
【発明の実施の形態】
以下、本発明に係る画像描画装置をエンタテインメントシステムに適用した実施の形態例と、本発明に係る記録媒体及びプログラムを前記エンタテインメントシステムで実行されるプログラムやデータが記録された記録媒体及びプログラムに適用した実施の形態例について図1〜図27を参照しながら説明する。
【0023】
まず、本実施の形態に係るエンタテインメントシステム10は、基本的には、図1に示すように、各種プログラムを実行させるエンタテインメント装置12と、該エンタテインメント装置12に対して着脱自在とされるメモリカード14と、エンタテインメント装置12に対して着脱自在とされた操作装置(コントローラ)16と、エンタテインメント装置12からの映像・音声信号が供給されるテレビ受像機等の表示装置であるモニタ(ディスプレイ)18とから構成される。
【0024】
エンタテインメント装置12は、例えば、CD−ROMやDVD−ROM等の光ディスク20等の大容量記憶媒体に記録されているプログラムを読み出して、使用者(例えば、ユーザ、ゲームプレイヤ等)からの指示に応じてゲーム等を実行するためのものである。なお、ゲームの実行とは、主として、コントローラ16からの入力をコネクタ15を通じて受け、モニタ18の画面上における表示や音声を制御しながらゲームの進行を制御することをいう。
【0025】
このエンタテインメント装置12は、図1に示すように、扁平な直方体を重ねた形状を有しており、前面パネルには、プログラム・データの記録媒体である光ディスク20が装着されるディスク装着部としての前後に移動するディスクトレイ22と、現在実行中のプログラム等を任意にリセット等するためのリセットスイッチ24と、ディスクトレイ22を引き出すためのオープンボタン26と、メモリカード14の2つの差込口30と、コントローラ16のコネクタ15が差し込まれる2つのコントローラ端子32等とが配置され、背面側には、電源スイッチ28、映像と音声の出力端子であり、AV(audio visual)ケーブルを介してモニタ18と接続される図示していないAVマルチ出力端子等が配置されている。
【0026】
エンタテインメント装置12は、コンピュータゲーム(ビデオゲーム)のプログラムやデータが記録されたCD−ROM、DVD−ROM等の記録媒体である光ディスク20から当該プログラムを読み取り、それを実行することによりモニタ18の画面上にキャラクタやシーンを表示させる制御機能のほか、他の光ディスク20であるDVD(digital video disk)による映画の再生およびCDDA(compact disk digital audio)による音楽の再生等の各種制御機能が内蔵されている。また、通信ネットワーク等を介して通信により得られるプログラムを実行する機能も有する。ゲームプログラムの実行中には、表示装置としてのモニタ18の画面上にエンタテインメント装置12が生成した3次元コンピュータグラフィックス映像が表示される。
【0027】
この場合、コントローラ16からの信号も、エンタテインメント装置12の上記制御機能の一つによって処理され、その内容がモニタ18の画面上の、例えばキャラクタの動き、シーンの切り替えなどに反映されるようになっている。
【0028】
コントローラ16は、上面の中央左右に第1、第2操作部51、52が設けられ、側面には第3、第4操作部53、54が設けられ、上面の手前側左右には、アナログ操作を行うための左側のジョイスティック70と右側のジョイスティック72が設けられている。
【0029】
第1の操作部51は、たとえばモニタ18の画面に表示されたキャラクタ等に動作を与えるための押圧操作部であり、光ディスク20に記録されているプログラム等によりその機能が設定され、キャラクタ等を上下左右等に動かす機能を有する4つの操作キー(方向キーともいう。)51a、51b、51c、51dから構成されている。方向キー51aは上方向キー、方向キー51bは下方向キー、方向キー51cは左方向キー、方向キー51dは右方向キーともいう。
【0030】
第2の操作部52は、押圧操作用の円柱状をした4個の操作ボタン52a、52b、52c、52dを有し、各操作ボタン52a〜52dの頭部には、それぞれ「△」、「○」、「×」、「□」の識別マークが付けられており、各操作ボタン52a〜52dは、それぞれ△ボタン52a、○ボタン52b、×ボタン52c、□ボタン52dともいう。
【0031】
この第2の操作部52の各操作ボタン52a〜52dは、光ディスク20に記録されたプログラム等によりその機能が設定され、各操作ボタン52a〜52dに、たとえばキャラクタ等の左腕、右腕、左足、右足を動かす機能が割り付けられる。
【0032】
第3、第4操作部53、54は、ほぼ同じ構造をしており、ともに上下に並ぶ押圧操作用の2個の操作ボタン(L1ボタンともいう。)53a、操作ボタン(L2ボタンともいう。)53b、および操作ボタン(R1ボタンともいう。)54a、操作ボタン(R2ボタンともいう。)54bを備えている。これら第3、第4操作部53、54も、光ディスク20に記録されたプログラムによりその機能が設定され、たとえばキャラクタに特殊な動作をさせる機能が割り付けられる。
【0033】
左右のジョイスティック70、72は、それぞれ操作軸を中心に360゜方向に傾動、回転可能とされる可変抵抗器等の信号入力素子を備えており、傾動、回転に応じてアナログ値が出力される。また、この左右のジョイスティック70、72は、図示していない弾性部材により中立位置に復帰するようになっている。なお、左右のジョイスティック70、72は、それぞれ下方に押圧することによって、ジョイスティック70、72の傾動、回転に伴うアナログ値とは別の信号が出力される。つまり、左右のジョイスティック70、72は、押圧操作用の第5、第6操作部としての操作ボタン(L3ボタン)70a、(R3ボタン)72aの機能を有している。
【0034】
左右のジョイスティック70、72を回転、傾動操作することにより、たとえばキャラクタ等を回転させながら移動させ、あるいは速度を可変しながら移動させ、さらには状態を変更させる等のアナログ的な動きを行うことを可能とする指令信号を入力することが可能となる。
【0035】
図1において、左右のジョイスティック70、72は、前記第1及び第2操作部51、52と切り換えて使用可能となる。その切換えは、アナログモードスイッチ74により行う。アナログモードスイッチ74により左右のジョイスティック70、72が選択されると、表示部76が点灯して、左右のジョイスティック70、72の選択状態を表示するようになっている。
【0036】
左右のジョイスティック70、72を操作することによって得られるアナログ入力値は、図3に示すように、垂直方向について上から下に向けて「0」〜「255」とされ、水平方向について左から右に向けて「0」〜「255」とされている。
【0037】
コントローラ16には、上記のほかにゲーム等の開始を指示するスタートボタン(スタートスイッチ)78や、ゲーム開始に際してゲームの難易度等を選択するためのセレクトボタン(選択スイッチ)80などが設けられている。
【0038】
次に、図2のブロック図を参照して、図1に示したエンタテインメント装置12の内部構成とその一般的な動作について説明する。
【0039】
このエンタテインメント装置12は、該エンタテインメント装置12を制御するCPU401に対して、半導体メモリとしてのRAM402及びバス403がそれぞれ接続されて構成されている。
【0040】
前記バス403には、グラフィックシンセサイザー(GS)404、インプットアウトプットプロセッサ(IOP)409がそれぞれ接続される。GS404には、フレームバッファ、Zバッファおよびテクスチャメモリ等を含むRAM(画像メモリ)405と、このRAM405中のフレームバッファへの描画機能を含むレンダリング機能を有するレンダリングエンジン(RE)406とが含まれる。
【0041】
このように構成されるGS404には、例えばデジタルRGB信号等をNTSC標準テレビジョン方式に変換するためのエンコーダ407を介して、外部機器としてのモニタ18が接続される。
【0042】
IOP409には、光ディスク20に記録されているデータを再生し、デコードするためのドライバ(DRV)410、サウンド生成系412、フラッシュメモリからなる外部メモリとしてのメモリカード14、コントローラ16およびオペレーティング・システム等の記録されたROM416がそれぞれ接続される。サウンド生成系412は、増幅器413を介して、外部機器としてのスピーカ414およびモニタ18に接続され、音声信号を供給する。
【0043】
サウンド生成系412は、CPU401からの指示に基づいて、楽音、効果音等を発生する音声処理装置(Sound Processing Unit:SPU)420と、このSPU420により発生された楽音、効果音等を記憶しているサウンドバッファ422とを有する。SPU420によって発生される楽音、効果音等の信号は、スピーカ414やモニタ18の音声端子に供給され、これらスピーカ414やモニタ18のスピーカから楽音、効果音等として出力(発音)するようになっている。
【0044】
ここで、SPU420は、例えば16ビットの音声データを4ビットの差分信号として適応予測符号化(ADPCM:Adaptive Differential PCM)された音声データを再生するADPCM復号機能と、サウンドバッファ422に記憶されている波形データを再生することにより、効果音等を発生する再生機能と、サウンドバッファ422に記憶されている波形データを変調させて再生する変調機能等を備えている。
【0045】
このような機能を備えることによって、このサウンド生成系412は、CPU401からの指示によってサウンドバッファ422に記録された波形データに基づいて楽音、効果音等を発生するいわゆるサンプリング音源として使用することができるようになっている。
【0046】
また、メモリカード14は、たとえばCPUもしくはゲートアレイおよびフラッシュメモリからなるカード型の外部記憶装置であって、図2に示されたエンタテインメント装置12に対し、その差込口30を介して着脱自在となっており、ゲームの途中状態が記憶されたり、DVD再生用のプログラム等が記憶されている。
【0047】
コントローラ16は、搭載された複数のボタンの押圧により、指令(2値指令または多値指令)をエンタテインメント装置12に与えるためのものである。また、ドライバ410は、MPEG(moving picture experts group)標準に基づいてエンコードされた画像をデコードするためのデコーダを備えている。
【0048】
また、CPU401は図示しない乱数発生器を備えている。
【0049】
ところで、木のオブジェクトを3次元画像で描く場合、一般に、幹のオブジェクトと、多数の葉のオブジェクトに分けて描くことが考えられる。通常のレンダリング処理にて幹と葉の両オブジェクトを描く場合、特に、葉のオブジェクトは、幹のオブジェクトと同様に、複数のポリゴンで、かつ、固定化した座標のもとで描くことになる。
【0050】
しかし、1つの葉を構成する複数のポリゴンについて、それぞれ各頂点データを持たせる必要から、膨大なデータ量になることは明らかである。
【0051】
そこで、本実施の形態では、幹のオブジェクトは、通常どおり、該幹のオブジェクトを構成する多数のポリゴンについてそれぞれ頂点データを持たせたデータ構造を採用するが、葉のオブジェクトについては、図4に示すように、1枚の例えば長方形又は正方形のポリゴンで描くようにする。実際には、長方形のポリゴンに葉のテクスチャを貼り付けて描くようにする。
【0052】
この場合、1つの辺をワールド座標上、鉛直方向に向かせるようにすれば、1つの頂点が決まると同時に他の頂点も自動的に決まることになり、該ポリゴンに関する頂点データの情報量を大幅に減らすことが可能となる。
【0053】
図5は幹のオブジェクトと多数の葉のオブジェクトを描いた例を平面から見た状態を示している。
【0054】
ところで、このような描画方法においては1つの問題がある。それは、ある1つの視点から木のオブジェクトを見た場合、葉を構成するポリゴンについて、全てのポリゴンの面が仮想視点eの方向に向いた状態になっているため、葉が生い茂った木として見ることができるが、視点を例えば90°転回して仮想視点eaとした場合は、葉を構成するポリゴンについて、全てのポリゴンの面が、視点の方向に対して90°±a°の角度で配置された状態になるため、この視点から木を見た場合、葉のテクスチャはほとんど見ることができず、落葉した幹となってしまい、表示上不都合が生じる。
【0055】
そこで、本実施の形態では、上述の手法に加えて、葉を構成するポリゴンのポリゴン面を視点の方向に向けて描画することで、上述の問題点を解決するようにしている。
【0056】
具体的に、本実施の形態に係るいくつかの描画方法を図6A〜図27を参照しながら説明する。一連の処理はCPU401、RE406がそれぞれ処理を分担して行うものであり、その際に使用される作業用メモリはRAM402や画像メモリ405などを用いるものとする。
【0057】
図6Aは、仮想空間100のZX平面図である。仮想空間100は、画像を描画するためにオブジェクトやポリゴンを配置するために仮想的に設定されているものである。この仮想空間100は3次元空間であり、描画する画像面に水平な向きのX軸、描画する画像面の高さ方向に相当するY軸(図6C参照)及び描画する画像面に垂直なZ軸を有する。
【0058】
なお、実際の一般のCG手法ではこのように画像面の向きを基準にした座標系(スクリーン座標系)の他に画像面に左右されないワールド座標系を有する。
【0059】
仮想空間100において、描画するための基準となる仮想視点eと、画像が描画されるZ軸に垂直な仮想のスクリーン(背景面)Z0の間にはY軸方向に伸びる幹102のオブジェクトと幹102のオブジェクトの近傍に設けられた複数の葉のポリゴン104aが配置されている。葉のポリゴン104a(図4も参照)は長方形であり、葉のポリゴン104aの4つの頂点は104a1〜104a4と表され、かつ、頂点104a1と104a4が対角をなすように構成されている。葉のポリゴン104aは必ずしも葉の絵だけが表示されるものでなく枝の絵を含むものであってもよい。また、葉の絵の数は1枚である必要はなく複数枚であってもよい。
【0060】
図6Bは、図6Aの葉のポリゴン104aの1つを拡大して示した図である。ここで、Vは葉のポリゴン104aの基準点Loを基点とした法線ベクトルであり、Veは基準点Loを基点として仮想視点eの方向を示す視点ベクトルである。葉のポリゴン104aを、法線ベクトルVと視点ベクトルVeとのなす角度θ1だけ回転させると、変換したポリゴン104bになる。変換したポリゴン104bを仮想視点eを基準にしてスクリーンZ0に投影すると葉の投影面104cになる。
【0061】
図6Cは、仮想空間100のZY平面図であり、幹102、変換したポリゴン104b、仮想視点e及び葉の投影面104cの位置関係を明確にしたものである。図6Aで表されるZX平面の投影関係はZY平面でも同様になっている。
【0062】
第1の実施の形態に係る画像描画方法は、図6A及び図6Bに示すように、幹102の周りに予め配置された任意の向きの葉のポリゴン104aのポリゴン面の法線Vが、基準点Loと仮想視点eを結ぶ直線に一致するように回転させて、変換したポリゴン104bを得る。次に、変換したポリゴン104bをスクリーン面Z0に投影する計算を行うことで葉の投影面104cを得る。
【0063】
第1の実施の形態に係る画像描画方法の具体的手法について図6A〜図16を参照しながら説明する。
【0064】
木の描画については図7に示すように初期化処理(ステップS1)、幹の描画処理(ステップS2)と葉の描画処理(ステップS3)の3つの処理に分けることができる。
【0065】
初期化処理(ステップS1)では、光ディスク20から図8に示すオブジェクト情報テーブル106、図9に示す幹のポリゴン情報テーブル108、図13に示す葉のポリゴン情報テーブル110等をRAM402にロードし、さらに、ポリゴンの模様データであるテクスチャマップを画像メモリ405のテクスチャメモリにロードする。
【0066】
オブジェクト情報テーブル106は、幹の基準絶対座標T0、幹のポリゴンの数Nm、幹のポリゴン情報テーブルアドレスADm、枝の数Nb及び枝ベクトル情報テーブルアドレスADbを含む情報である。
【0067】
幹のポリゴン情報テーブル108は、Nm個の幹のポリゴンの情報を有し、それぞれの幹のポリゴン情報はポリゴンの4つの頂点104a1〜104a4の相対位置座標、4つの頂点104a1〜104a4の色データ及びテクスチャマップアドレスADtiを含む。iは幹のポリゴンの番号を表し0〜Nm−1の数値をとる。
【0068】
幹の描画(ステップS2)について、その処理内容を示した図10を参照しながら説明する。
【0069】
まず、ステップS101において、図8に示すオブジェクト情報テーブル106から幹のポリゴンの数Nm、幹の基準絶対座標T0及び幹のポリゴン情報テーブル108のアドレスADmをレジスタ等に確保する。
【0070】
そして、ステップS102において、カウンタiに初期値「0」を格納して、該カウンタiを初期化する。
【0071】
次に、ステップS103において、アドレスADmで示される幹のポリゴン情報テーブル108からカウンタiで示される幹のポリゴン情報を読み込む。
【0072】
ステップS104において、読み込まれた幹のポリゴン情報のうち4つの頂点104a1〜104a4の相対座標に幹の基準絶対座標T0を加算する。こうして、葉のポリゴン104aの4つの頂点104a1〜104a4のワールド座標値を得る。また、この4つの頂点104a1〜104a4のワールド座標値からスクリーンZ0に対してZ軸上の相対位置Zrを求める。
【0073】
次に、色の補正及びスクリーンZ0への投影処理等を行う。これらの処理ステップS105〜S108においては一般にレンダリング処理と呼ばれているものである。
【0074】
レンダリング処理では、まず、ステップS105において、変換されたポリゴンの色の計算を行う。まず、幹102のポリゴン情報に含まれる4つの頂点104a1〜104a4の色データを用いて、変換したポリゴン104bの範囲内の色を補正する。そして、図示しない仮想光源の情報などから光学計算を行うことで表面輝度を求めて、さらに表面の質感の補正を行う。
【0075】
そして、ステップS106において、変換したポリゴン104bをスクリーンZ0に投影した葉の投影面104c(図6A参照)を求める。
【0076】
ステップS107において、この投影面の範囲に対して、ポリゴン情報のうちテクスチャマップアドレスADtiで示されるテクスチャを投影面形状に合わせて加え描画画像を得る。
【0077】
ステップS108では、得られた描画画像をRAM405のうち表示バッファに書き込むとともに、前記Z軸上の相対位置ZrをRAM405のZバッファに書き込む。
【0078】
そして、ステップS109において、カウンタiを+1更新した後、次のステップS110において処理が完了したか判別される。つまり、iとNmが等しければ幹のポリゴンに対しては全ての処理が完了したので、図7に示す葉の描画処理(ステップS3)に移る。iとNmが異なれば(iがNmより小さければ)、前記ステップS103に戻り処理を繰り返す。
【0079】
次に、葉の描画(ステップS3)について、その処理内容を示した図11を参照しながら説明する。
【0080】
まず、ステップS201において、描画する葉のポリゴン104aの数Nlを決定する。葉のポリゴン104aの数Nlは予め決定されたもので光ディスク20等に記憶されているものでもよいし、また、ステップS1で描画した幹102の形状に応じた葉のポリゴン104aの数を適宜決定してもよい。
【0081】
そして、ステップS202において、葉の配置を決める処理を行い、ステップS203において、葉の向きを決める処理レンダリング処理を行うことで、葉を描画することができる。このうち、ステップS202の処理については後述する。
【0082】
ステップS203の葉の向きを決める処理においては、その内部の処理としてまず、ステップS203aにおいて最初にカウンタiを初期化して「0」にする。次に、ステップS203bにおいて、カウンタiで示される葉の向きを決定する。このステップS203bの処理の詳細については後述する。
【0083】
そして、ステップS203cにおいて、カウンタiを+1更新した後、次のステップS203dにおいて処理が完了したか判別される。つまり、iとNlが等しければ幹のポリゴンに対しては全ての処理が完了したので、レンダリング処理(ステップS204)に移る。iとNlが異なれば(iがNlより小さければ)前記ステップS203bに戻り処理を繰り返す。
【0084】
ステップS204おけるレンダリング処理は、幹の描画処理で説明したステップS105〜S108と同じ処理であるのでその詳細な説明は省略する。
【0085】
図11における葉の配置を決定する処理(ステップS202)について、その処理内容を示した図12及び図13を参照しながら説明する。
【0086】
まず、ステップS301において、カウンタiに初期値「0」を格納して、該カウンタiを初期化する。
【0087】
次に、ステップS302において、葉のポリゴン情報テーブル110からカウンタiで示される葉のポリゴン情報を読み出す。
【0088】
図13に示すように、それぞれの葉のポリゴン情報テーブル110は幹のポリゴン情報テーブル108とほぼ同様の構成であり、葉を1つのポリゴンとして表している。つまり、4つの頂点104a1〜104a4の相対座標値と、その4つの頂点104a1〜104a4の色のデータ及びテクスチャマップアドレスADliを有する構造である。この4つの頂点104a1〜104a4の相対座標は平面を構成するように設定されている。また、葉のポリゴン情報テーブル110は描画する葉の数Nl個の情報を有する。
【0089】
そして、ステップS303に移り、4つの頂点104a1〜104a4の相対座標値を幹102の基準絶対座標T0を基準にして絶対座標に変換して、カウンタiで示される葉のポリゴン104aの4つの頂点104a1〜104a4のワールド座標値が決定する。このように、葉の位置の情報は相対座標で構成されているので、幹102が仮想空間100上のどこに配置されていても対応が可能である。
【0090】
そして、ステップS304において、カウンタiを+1更新した後、次のステップS305において処理が完了したか判別される。つまり、iとNlが等しければ幹のポリゴンに対しては全ての処理が完了したので、図11における葉の描画処理(ステップS203)に移る。iとNlが異なれば(iがNlより小さければ)、前記ステップS301に戻り処理を繰り返す。
【0091】
次に、図11におけるカウンタiが示す葉の向きを決める処理(ステップS203b)について図6A、図6B、図15及び図16を参照しながら説明する。葉の向きを決める処理はいくつかの手法が考えられ、図15及び図16は葉の向きを決める処理の種別をフローチャートに表したものである。このうち第1の実施の形態に係る葉の向きを決める方法について説明する。
【0092】
まず、ステップS401において、前記ステップS202で行った処理で葉のポリゴン104aの向きが決定されているか判別する。第1の実施の形態においては、葉のポリゴン104aの情報は4つの頂点104a1〜104a4のワールド座標値を持っており、しかも、この4つの頂点104a1〜104a4の座標は平面を構成するように設定されているので葉の向きは一義的に決定される。従って、次のステップS402に移る。
【0093】
ステップS402においては、4つの頂点104a1〜104a4のワールド座標値から葉の法線ベクトルVを演算する。4つの頂点104a1〜104a4は平面を構成するように設定されているので、このうち3つを選択して得られる2つのベクトルに対して法線ベクトルVを演算するようにすればよい。
【0094】
次に、ステップS403においては、法線ベクトルVの向きが仮想視点eに対して表示上不都合な向きになっていないか考慮するかどうかを決める。この判断は画像製作者が処理速度などを勘案して予め決めておくものであり、CPU401が判断するものでなくてもよい。法線ベクトルVを考慮しない場合、つまり、一律に葉のポリゴン104aの向きを変更する場合はステップS405に移る。
【0095】
法線ベクトルVを考慮する場合はステップS404に移り、法線ベクトルVの向きを判定する。この判定は葉ポリゴン104aの基準点Loと仮想視点eを結ぶ直線のベクトルを視点ベクトルVeとして、この視点ベクトルVeと法線ベクトルVとのなす角度θ1を演算する。得られた角度θeが90°±a°以内であるときは、葉が仮想視点eに対して略平行の向きとなっているので表示上不都合である。従ってステップS405に移り葉の向きを変更する処理を行う。またそれ以外の角度であるときは、葉の向きに変更は加えないものとして図15に示す処理を終了する。ここで、a°とは画像製作者が任意に決定するものであるが、概ね45°以内の数値である。
【0096】
ステップS405及びS405aでは葉の向きを変更するにおいてどのような基準で変更するか決定する。この判断は画像製作者が予め決定しておいてもよい。第1の実施の形態ではステップS406へ移るものとする。
【0097】
ステップS406においては、葉のポリゴン104aの向きを仮想視点eの方向へ向けるように回転させる。この回転の処理を図6A及び図6Bを参照しながら説明する。
【0098】
葉のポリゴン104aの基準点Loを中心に法線ベクトルVが視点ベクトルVeに一致するように角度θ1だけ回転させる。つまり、その回転によりポリゴン104aの4つの頂点104a1〜104a4が移る変換したポリゴン104bの座標値をそれぞれ計算する。図6Bは、基準点Loを葉のポリゴン104aの4つの頂点104a1〜104a4のうちの1つ、例えば頂点104a1に設定した例を示している。このように、4つの頂点104a1〜104a4のうちの1つを基準点Loにとれば、残りの3つの頂点だけを計算すればよい。
【0099】
また、葉のポリゴン104aが長方形又は正方形で、かつ、法線ベクトルVがZX平面に平行になるように設定しておくことにより、葉のポリゴン104aの対角の2頂点、例えば、頂点104a1及び頂点104a4だけについて計算して回転後の変換位置を求めておけば、残りの2つの頂点104a2、104a3については頂点104a1及び頂点104a4に関する計算の結果の変換位置から換算して表現できる。さらに、この場合、基準点Loを4つの頂点104a1〜104a4のうちの1つ、例えば104a1に設定すれば、その対角の頂点104a4の1点だけについて回転後の変換位置を求めておけば、他の頂点については換算して表現できるので計算量が大幅に低減される。
【0100】
しかも、葉のポリゴン104aに関して必要な情報は、複数の頂点のうち1つの頂点の情報だけでよいことになるのでデータ量を少なくすることができる。
【0101】
こうして、ポリゴン104aを回転させて得られた変換したポリゴン104bは仮想視点eの方向を向いているので、表示上不都合がない。
【0102】
葉の向きが決定したので、図11におけるステップS203bが終了する。この処理をカウンタiの制御処理(ステップS203a、ステップS203c及びステップS203d)に従い実行し、Nl個の葉のポリゴン104aについて向きが決定したらレンダリング処理(ステップS204)に移ればよい。
【0103】
なお、葉の向きを決定する処理(ステップS203)については、図6A及び図6Bを参照してZX平面上で説明したが、実際には葉のポリゴン104aを3次元空間内で回転させてもよい。
【0104】
葉のポリゴン104aを3次元空間内で回転させる方法について図14A及び図14Bを参照しながら説明する。なお、図14A及び図14Bで示すX軸、Y軸及びZ軸はスクリーン座標系の軸と同じ向きであるが、スクリーン座標系の原点は無視して、相対的な方向だけを表すものとする。
【0105】
図14Aは、葉のポリゴン104aの法線ベクトルVを視点ベクトルVeの方向へZX平面上で回転させた状態を説明した図である。
【0106】
Vy、Veyは、法線ベクトルVと視点ベクトルVeのそれぞれのZX平面成分の2次元ベクトルである。θ11は2次元ベクトルVyとVeyのなす角度である。V1は法線ベクトルVをY軸を中心に角度θ11だけ回転させたベクトルである。
【0107】
図14Bは、2次元ベクトルVeyとY軸で構成した2次元座標を示す。θ12は回転したベクトルV1と視点ベクトルVeyとのなす角度である。
【0108】
葉のポリゴン104aを仮想視点eの方向へ向けるためには、まず、葉の法線ベクトルVをY軸を中心にして角度θ11だけ回転させる第1の回転処理を行う。この処理により法線ベクトルVはベクトルV1の位置に移る。この状態では移動後のベクトルV1と視点ベクトルVeのZX平面成分が一致することになる。
【0109】
次に、図14Bで示す2次元座標系で移動後のベクトルV1を角度θ12だけ回転させる第2の回転処理を行う。この処理によりベクトルV1は視点ベクトルVeに一致して、葉のポリゴン104aは仮想視点eの方向を向くことになる。
【0110】
なお、このように回転処理を2回に分けなくとも、3次元空間上で法線ベクトルVから視点ベクトルVeの方向へ直接的に回転するように処理してもよい。
【0111】
さらに、上述の説明では図11に示すとおり、ステップS202で全ての葉の配置を決定し、その後、ステップS203で葉の向きを決定する、いわゆるバッチ式で処理しているが、各葉ごとに葉の向きと葉の配置を連続して決定するように処理してもよい。
【0112】
また、ポリゴンは長方形、正方形など4角形に限定されるものではなく3角形、5角形などでもよい。
【0113】
このように、第1の実施の形態に係る画像描画方法においては、葉のポリゴンを全て仮想視点eの方向へ向くようにするので、仮想視点eから見てポリゴンが見えづらいということがない。
【0114】
また、葉のポリゴン情報テーブル110を持つことから、個別の葉に対して配置や色、及びテクスチャを自由に設定できるので表現上の自由度が高い。
【0115】
さらに、葉のポリゴン104aの形状を長方形にして、回転の基準点をポリゴンの頂点に設定することで回転に係る計算量を大幅に低減することができる。
【0116】
次に、第2の実施の形態に係る画像描画方法について図17A〜図18を参照しながら説明する。
【0117】
第2の実施の形態においては、第1の実施の形態とほぼ同じ処理を行うが、葉のポリゴン104aを回転させる処理において、回転させる方向が異なる。すなわち、図17A及び図17Bに示すようにポリゴン104aをZ軸の方向へ回転させて、変換したポリゴン104dを得る。
【0118】
具体的には、図15における処理でステップS405からステップS405aの分岐処理を経由してステップS407へ移る。
【0119】
ステップS407においては、葉のポリゴン104aの向きをZ軸の方向へ向けるように回転させる。この回転の処理を図17A及び図17Bを参照しながら説明する。
【0120】
図17Aは、第2の実施の形態に係る仮想空間100のZX平面図である。104dはポリゴン104aをZ軸の方向へ回転させた変換したポリゴンである。それ以外の符号は図6Aと同じである。また、図17Bは図17Aの葉のポリゴン104a部分の拡大図である。Vzは葉のポリゴン104aの基準点Loを起点としたZ軸方向を示すZ軸ベクトルである。角度θ2は法線ベクトルVとZ軸ベクトルVzとのなす角度である。
【0121】
基準点Loを中心に法線ベクトルVがZ軸ベクトルVzに一致するように角度θ2だけ回転させる。つまり、その回転によりポリゴン104aの4つの頂点104a1〜104a4が移る変換したポリゴン104dの座標値をそれぞれ計算する。このように、Z軸の方向へ向くように回転させる場合に、仮想視点eの方向を考慮する必要がなく演算が単純になるという効果がある。また、葉がZ軸の方向を向くことで、仮想視点eの方向とは異なるもののスクリーンZ0に対しては平行なので画像描画上特に見えづらいということはない。
【0122】
また、基準点Loの選択の方法や、ポリゴンの形状設定は第1の実施の形態と同様にすれば計算量の低減を図ることができる。
【0123】
葉の向きが決定したので、図11におけるステップS203bが終了する。この処理をカウンタiの制御処理(ステップS203a、ステップS203c及びステップS203d)に従い実行し、Nl個の葉のポリゴン104aについて向きが決定したらレンダリング処理(ステップS204)に移ればよい。
【0124】
なお、葉の向きを決定する処理(ステップS203)については、図17Bを参照してZX平面上で説明したが、実際には葉のポリゴン104aを3次元空間内で回転させてもよい。
【0125】
葉のポリゴン104aを3次元空間内で回転させる方法について図18を参照しながら説明する。
【0126】
図18は、葉のポリゴン104aの法線ベクトルVをZ軸ベクトルVzの方向へZX平面上で回転させた状態を説明した図である。
【0127】
図18において、座標と法線ベクトルVの位置関係および2次元ベクトルVyは図14Aと同じである。角度θ21は2次元ベクトルVyとZ軸ベクトルVzのなす角度である。V2は法線ベクトルVをY軸を中心に角度θ21だけ回転させたベクトルである。角度θ22は回転したベクトルV2とZ軸ベクトルVzとのなす角度である。
【0128】
葉のポリゴン104aをZ軸ベクトルVzの方向へ向けるためには、まず、葉の法線ベクトルVをY軸を中心にして角度θ21だけ回転させる第1の回転処理を行う。この処理により法線ベクトルVはベクトルV2の位置に移る。この状態では移動後のベクトルV1とZ軸ベクトルVzのZX平面成分が一致することになる。
【0129】
次に、ZY平面上で移動後のベクトルV2を角度θ22だけ回転させる第2の回転処理を行う。この処理によりベクトルV2はZ軸ベクトルVzに一致して、葉はZ軸の方向を向くことになる。
【0130】
なお、このように2回に分けて計算しなくとも、3次元空間上で法線ベクトルVからZ軸ベクトルVzの方向へ直接的に回転するように処理してもよい。
【0131】
このように、第2の実施の形態に係る画像描画方法においては、葉を全てZ軸の方向へ向くようにするので、回転の計算量が少なくて済み、また、仮想視点eから見て特に見えづらいということはない。
【0132】
次に、第3の実施の形態に係る画像描画方法について図15、図16及び図19を参照しながら説明する。
【0133】
第3の実施の形態においては、第1の実施の形態とほぼ同じ処理を行うが、葉のポリゴン104aを回転させる処理において、回転させる処理が異なる。すなわち、特定の方向へ向けるのではなく乱数発生器により得られた乱数により任意の方向を向くようにしてる。
【0134】
具体的には、図15及び図16における処理でステップS405からステップS405aの分岐処理を経由してステップS408に移る。
【0135】
ステップS408においては、乱数発生器によりいくつかの乱数を得る。そしてこの乱数によりある一定方向の範囲内の方向を向く乱数ベクトルVr(図19参照)を設定する。
【0136】
図19に示すようにZ軸を中心とした4角錐Pyの範囲を考える。図19において、x0、y0はそれぞれ4角錐Pyを規定するX座標値、Y座標値である。x1、y1は設定する乱数ベクトルVrのX座標値、及びY座標値である。z1は乱数ベクトルVrのZ座標値である。
【0137】
乱数ベクトルVrのZ軸座標値z1と、4角錐を規定するX軸座標値x0とY軸座標値y0を適当な値に設定する。X軸座標値x0、Y軸座標値y0はZ軸座標値z1より小さい値が好ましい。次に、乱数発生器により2つの乱数を取得する。この乱数発生器は±1の範囲内の値を発生するものとする。そして、得られた2つの乱数とX軸座標値x0、Y軸座標値y0をそれぞれ掛け合わせて乱数ベクトルVrのX軸座標値x1及び乱数ベクトルVrのY軸座標値y1を得る。この値をZ軸座標値z1と組み合わせて乱数ベクトルVr(x1、y1、z1)が規定されることになる。この乱数ベクトルVrは、Z軸を中心としてX軸には±x0、Y軸には±y0の範囲内の方向を示す。
【0138】
乱数ベクトルVrが規定されたら、次にステップS409に移る。
【0139】
ステップS409においては、ステップS408で得られた乱数ベクトルVrの向きを判定する。この判定は視点ベクトルVeと乱数ベクトルVrとのなす角度を演算することにより判断する。そして、得られた角度が90°±a°以内であるときは、葉が仮想視点eに対して略平行の向きとなっているので表示上不都合である。従ってステップS408に移り葉の向きを変更する処理を行う。また、それ以外の角度であるときは、葉の向きに変更は加えないものとして次のステップS410に移る。
【0140】
ステップS410においては、葉のポリゴン104aの向きを乱数ベクトルVrの方向へ向けるように葉のポリゴン104aを回転させる。この回転の処理は第1の実施の形態で説明した図6A、図6B、図14A及び図14Bにおいて、視点ベクトルVeの代わりに乱数ベクトルVrの方向へ回転させるものである。その処理手順は同様であるのでその詳細な説明を省略する。
【0141】
葉の向きが決定したので、図11におけるステップS203bが終了する。この処理をカウンタiの制御処理(ステップS203a、ステップS203c及びステップS203d)に従い実行し、Nl個の葉のポリゴン104aについて向きが決定したらレンダリング処理(ステップS204)に移ればよい。
【0142】
なお、葉の向きを決定する処理(ステップS203)については、図19を参照して乱数ベクトルVrが4角錐Pyの範囲内の方向を向くように設定したが、この範囲は4角錐Pyで示されるものでなくともよく、また、特に範囲を設定せずに任意の方向を向くようにしてもよい。
【0143】
このように、第3の実施の形態に係る画像描画方法においては、乱数を用いて葉のポリゴン104aの向きを決定するので、各々の葉の向きが異なるように設定され、植物の自然な雰囲気を表現することができる。
【0144】
また、仮想視点eの方向と略平行になる葉については向きを再設定する処理を施すので、仮想視点eから見て特に見えづらいということはない。
【0145】
以上の第1乃至第3の実施の形態においては、葉のポリゴン104aの向きが適切な方向になるように描画する方法を示した。以下の第4乃至第6の実施の形態においては、葉のポリゴン104aを幹102の周りに配置する方法について説明する。
【0146】
第4の実施の形態に係る画像描画方法について図15、図16、図20及び図21を参照しながら説明する。
【0147】
第4の実施の形態においては、第1の実施の形態とほぼ同じ処理を行うが、葉のポリゴン104aを配置させる処理が異なる。すなわち、乱数を用いることで各葉のオブジェクトごとにその配置位置を決定する。
【0148】
具体的には、図11における葉の配置を決める処理(ステップS202)の処理内容として図15、図16及び図20で示す処理を行う。
【0149】
図21は、基準絶対座標T1を幹102の略中央部に設定し、さらに葉を描画する空間の範囲Sを半径rの球状体に設定した例を示す。
【0150】
図20のステップS501において、葉を描画する基準絶対座標T1を適当に決定する。この基準絶対座標T1は幹102の座標値に基づいて決めればよい。
【0151】
次に、ステップS502において、基準絶対座標T1を基準として、葉を描画する空間の範囲Sを設定する。この範囲Sは球状体、楕円体、円柱体又は円錐体などのような形状でもよい。以下、範囲Sを球状体(図21参照)として説明する。
【0152】
ステップS503において、カウンタiに初期値「0」を格納して、該カウンタiを初期化する。
【0153】
そして、ステップS504において、CPU401の乱数発生器により3つの乱数を作りその乱数を範囲Sに合わせて葉の基準位置を得る。具体的には、乱数発生器によって得られた3つの乱数をq1、q2、q3として、また半径rを用いて、
K=r/(sqr(q1×q1+q2×q2+q3×q3))
なる定数値Kを求める。ここでsqr(…)は平方根関数である。
【0154】
そして、定数値Kをq1、q2、q3にそれぞれ掛け合わせて葉のポリゴン104aの4つの頂点104a1〜104a4のうちの1つ、例えば、頂点104a1のX軸相対座標値r1、Y軸相対座標値r2及びZ軸相対座標値r3を得る。
【0155】
葉のポリゴン104aの1つの頂点104a1の相対座標値(r1、r2、r3)が求まったら、この相対座標値を基準絶対座標T1を基準としてワールド座標値に変換し、カウンタiが示す番目の葉のポリゴン104aの1つの頂点104a1の位置としてRAM402などに記憶する。
【0156】
そして、ステップS505において、カウンタiを+1更新した後、次のステップS506において処理が完了したか判別される。つまり、iとNlが等しければNl個の葉のポリゴン104aの1つの頂点104a1の配置が決定したので、図20に示す処理を終了して、図11に示すステップS203に移る。iとNlが異なれば(iがNlより小さければ)、ステップS504に戻り処理を繰り返す。
【0157】
葉のポリゴン104aの配置が決定したら、図11におけるステップS202が終了したことになる。
【0158】
次に、図11の葉の向きを決める処理(ステップS203)に移る。この中でカウンタiで示される描画する葉の向きを決める処理(ステップS203b)以外は第1の実施の形態と同じである。
【0159】
ステップS203bを説明した図15及び図16において、まず最初にステップS401において、葉の向きが一義的に特定されているか判別する。第4の実施の形態においては、葉のポリゴン104aは4つの頂点104a1〜104a4のうち1つの頂点104a1の座標しか決まっていないので、向きは特定されていない。
【0160】
そこで、図16のステップS411に移り、葉のポリゴン104aの向きを仮に特定する。ここでは、第2の実施の形態の場合と同じ向きであるZ軸方向に規定するものとする。
【0161】
以降の処理は、第1の実施の形態及び第2の実施の形態の場合と同様である。すなわち、図15及び図16においてステップS412とステップS412aはステップS405とステップS405aに、ステップS413はステップS406に、ステップS414はステップS408に、ステップS415はステップS409に、そして、ステップS416はステップS410にそれぞれ相当する。
【0162】
第2の実施の形態の場合のステップS407に相当する処理はないが、当初の向きが第2の実施の形態の場合の向きと同じなのでステップS412aにおける分岐後の処理は不要であり、結果としてステップS407が不要となっている。
【0163】
これにより、図11における葉の向きを決める処理(ステップS203)が終了するので、以降は第1の実施の形態と同様に処理をすればよい。
【0164】
このように、第4の実施の形態に係る画像描画方法においては、乱数を用いて葉のポリゴン104aの配置を決定するので、画像製作者は葉の枚数Nlだけを決定すればよく、通常のモデリング作業が不要になる。しかも、異なった葉の配置を有する木を何種類でも構成することができる。
【0165】
次に、第5の実施の形態に係る画像描画方法について図22、図23A、図23B及び図23Cを参照しながら説明する。
【0166】
第5の実施の形態においては、第1の実施の形態とほぼ同じ処理を行うが、葉のポリゴン104aを配置させる処理が異なる。すなわち、所定の関数を用いることで各葉のオブジェクトごとにその配置位置を決定する。
【0167】
具体的には、図11における描画する葉の配置を決める処理(ステップS202)の処理内容として図15、図16及び図22で示す処理を行う。
【0168】
図23Aは関数fに最大値がrである正規分布関数を変形したものを使用して前記X軸相対座標値r1を計算する例である。関数fは正規分布関数の縦軸を逆にしたものであり、この関数fを用いることでカウンタiに対して比較的0に近い値が多く得られ、半径rに近い値は少なくなる。また半径r以上の値はあり得ない。
【0169】
図23Bも、関数gに最大値がrである正規分布関数を変形したものを使用して前記Y軸相対座標値r2を計算する例である。関数gは通常の正規分布関数を2つに分けて位相をずらしたものであり、関数fとは異なる値が得られるようになっている。
【0170】
図23Cは、関数hに1次関数を使用して前記Z軸相対座標値r3を計算する例である。正規分布関数のように複雑な演算を必要としないので簡易に計算できる。
【0171】
図22のステップS601において、葉を描画する基準絶対座標T1を適当に決める。さらに、ステップS602において、基準絶対座標T1を基準として葉を描画する空間の範囲Sを設定する。基準絶対座標T1及び範囲Sは第4の実施の形態で説明したとおりであり、以下の説明においても範囲Sを半径rの球状体とする(図21参照)。
【0172】
次に、ステップS603において、カウンタiに初期値「0」を格納して、該カウンタiを初期化する。
【0173】
そして、ステップS604において、適当な関数により葉のポリゴン104aの4つの頂点104a1〜104a4のうちの1つ、例えば、頂点104a1の配置を決定する。関数は3つ用意し、それぞれ、
r1=f(i、r)
r2=g(i、r)
r3=h(i、r)
とする。関数f、g、hはそれぞれカウンタiと半径rにより値を決定するものである。
【0174】
関数f、g、hの例を図23A、図23B及び図23Cに示す。
【0175】
なお、これらの関数f、g、hは適宜設定すればよく、上記以外のものでもよい。また、各関数f、g、hの横軸値はカウンタiにより順次増加させるのではなく、乱数などを用いてランダムに横軸値を選択するようにしてもよい。
【0176】
このようにして、半径rの球状体の範囲S内に分布する葉のポリゴン104aの4つの頂点104a1〜104a4のうち1つの頂点104a1の相対座標(r1、r2、r3)が決まる。
【0177】
この相対座標値を基準絶対座標T1を基準としてワールド座標値に変換し、カウンタiで示す葉のポリゴン104aの4つの頂点104a1〜104a4のうち1つの頂点104a1の位置としてRAM402などに記憶する。
【0178】
そして、ステップS605において、カウンタiを+1更新した後、次のステップS606において処理が完了したか判別される。つまり、iとNlが等しければNl個の葉のポリゴン104aの配置が決定したので、図20に示す処理を終了して図11に示すステップS203に移る。iとNlが異なれば(iがNlより小さければ)ステップS604に戻り処理を繰り返す。
【0179】
葉のポリゴン104aの配置が決定したら、図11におけるステップS202が終了したことになる。
【0180】
次に、図11、図15及び図16で示される葉の向きを決める処理に移る。これらの処理は第4の実施の形態の場合と同様であるのでその詳細な説明を省略する。
【0181】
また、葉の向きを決める処理が終了したら、それ以降は第1の実施の形態と同様に処理をすればよい。
【0182】
このように、第5の実施の形態に係る画像描画方法においては、関数を用いて葉のポリゴンの配置を決定するので、画像製作者は葉の枚数Nlと関数f、g、hだけを決定すればよいので通常のモデリング作業が不要になり、しかも、正規分布関数などを用いることで、基準絶対座標T1を中心として、中心が密で、半径rの方向に向かい遠方になるほど粗であるような葉の配置を実現し、植物の自然な雰囲気を表現することができる。
【0183】
次に、第6の実施の形態に係る画像描画方法について図24〜図27を参照しながら説明する。
【0184】
第6の実施の形態においては、第1の実施の形態とほぼ同じ処理を行うが、葉のポリゴン104aを配置させる処理が異なる。すなわち、幹102の枝ベクトルVbi(図26参照)を用意しておくことで、この枝ベクトルVbi上に葉のポリゴン104aを配置するようにする。なお、iはカウンタiの値である。
【0185】
具体的には、図11における葉の配置を決める処理(ステップS202)の処理内容として図15、図16及び図24で示す処理を行う。
【0186】
図25に示す枝ベクトル情報テーブル112は、Nb個の枝ベクトルVbiの情報を有し、それぞれの枝ベクトル情報は基準に対する枝ベクトルVbiの起点の相対座標、角度データ及び長さLiを含む。
【0187】
図26は枝ベクトルVbiを説明する図である。ここで、枝ベクトルVbiとは幹102に関してNb個の枝を示すものであり、その起点は相対座標で表されている。つまり幹102が仮想空間100のどこに配置されていても対応が可能である。また、枝ベクトルVbi角度と大きさLiで表される極座標形式で表されるものとする。
【0188】
図27は葉のポリゴン104aの頂点の4つの頂点104a1〜104a4のうち1つの頂点104a1の位置を示すベクトルVbijを説明する図である。ベクトルVbijは枝ベクトルVbiと同じ向きで大きさのみを変更したものであることを示す。
【0189】
図24のステップS701において、幹102の枝に関するデータを読み込む。つまりオブジェクト情報テーブル106(図8参照)に含まれている枝の数Nb、枝ベクトル情報テーブルアドレスADb、図25に示す枝ベクトル情報テーブル112を読み込む。
【0190】
次に、ステップS702において、カウンタiに初期値「0」を格納して、該カウンタiを初期化する。
【0191】
ステップS703に移り、アドレスADbで示される枝ベクトル情報テーブル112からカウンタiで示される枝ベクトルVbiの情報を読み込む。
【0192】
そして、ステップS704において、枝ベクトルVbiに関する葉の数Nbiを決定する。説明を簡略化するためにNbi=Nl/Nbとする。つまり、全ての葉の数の合計が他の実施の形態と同様にNlになるようにする。
【0193】
ステップS705において、カウンタjに初期値「0」を格納して、該カウンタjを初期化する。
【0194】
ステップS706に移り、カウンタiで示される枝ベクトルVbiに関して、その枝ベクトルVbi上にNbi枚の葉のポリゴン104aの配置を計算する。
【0195】
つまり、図25及び図27に示すように、枝ベクトルVbiの大きさがLiであることから、枝ベクトルVbiと向きが同じで大きさがLi×j/Nbiである葉のポリゴン104aの1つの頂点104a1の相対座標ベクトルVbijを求める。そしてこの相対座標値を基準絶対座標T1を基準としてワールド座標値に変換し、(i×Nbi)+j番目の葉の位置としてRAM402などに記憶する。
【0196】
そして、ステップS707において、カウンタjを+1更新した後、次のステップS708において処理が完了したか判別される。つまり、カウンタjと枝ベクトルVbi上の葉の数Nbiが等しければステップS709に移る。jとNbiが異なれば(jがNbiより小さければ)ステップS706に戻り次の処理を行う。
【0197】
さらに、ステップS709において、カウンタiを+1更新した後、次のステップS710において処理が完了したか判別される。つまり、カウンタiと枝ベクトルVbiの数Nmが等しければNl個の葉のポリゴン104aの頂点104a1の配置が決定したので、図24に示す処理を終了して図11に示すステップS203に移る。iとNmが異なれば(iがNmより小さければ)、ステップS703に戻り次の処理を行う。
【0198】
葉のポリゴン104aの配置が決定したら、図11におけるステップS202が終了したことになる。
【0199】
次に、図11、図15及び図16で示される葉の向きを決める処理に移る。これらの処理は第4の実施の形態の場合と同様であるのでその詳細な説明を省略する。
【0200】
また、葉の向きを決める処理が終了したら、それ以降は第1の実施の形態と同様に処理をすればよい。
【0201】
枝ベクトルは実際に幹102の一部として描画されている箇所を例示して説明したが、枝の存在しない箇所に葉だけを表示させるために、架空の位置に枝ベクトルVbiを設定してもよい。
【0202】
このように、第6の実施の形態に係る画像描画方法においては、幹102に枝ベクトルVbiを用意して、その枝ベクトル上に葉を配置するようにしたので、画像製作者は葉の枚数Nlと枝ベクトルVbiだけを決定すればよいので通常のモデリング作業が不要になり、しかも、各葉は枝上に配置されることからより実際の植物に近い雰囲気を表現することができる。
【0203】
上述の説明では葉の描画について述べたが、葉の描画以外にも動物の群の描画など他の態様に適用してもよい。
【0204】
なお、この発明に係る画像描画装置、記録媒体及びプログラムは、上述の実施の形態に限らず、この発明の要旨を逸脱することなく、種々の構成を採り得ることはもちろんである。
【0205】
【発明の効果】
以上説明したように、本発明に係る画像描画装置、記録媒体及びプログラムによれば、所定のポリゴン面の法線が所定の方向を向くようにポリゴン面を回転させる。
【0206】
このため、描画上不都合な向きのポリゴンを修正することができるという効果が達成される。
【図面の簡単な説明】
【図1】本実施の形態に係るハードウェア構成図である。
【図2】本実施の形態に係る電気回路の構成図である。
【図3】左右のジョイスティックにより得られるアナログ入力値の説明図である。
【図4】葉のポリゴンを表す図である。
【図5】幹のオブジェクトと多数の葉のオブジェクトを描いた例を示す図である。
【図6】図6Aは仮想空間のZX平面図であり、図6Bは図6Aの拡大図であり、図6Cは仮想空間のZY平面図である。
【図7】木の描画処理のフローチャートである。
【図8】オブジェクト情報テーブルを示す図である。
【図9】幹のポリゴン情報テーブルを示す図である。
【図10】幹の描画処理のフローチャートである。
【図11】葉の描画処理のフローチャートである。
【図12】第1の実施の形態に係る葉の向きを決定するフローチャートである。
【図13】葉のポリゴン情報テーブルを示す図である。
【図14】図14Aは第1の実施の形態に係る第1の回転処理を説明する図であり、図14Bは第1の実施の形態に係る第2の回転処理を説明する図である。
【図15】葉の向きを決定する処理方法を選択する流れを示すフローチャート(その1)である。
【図16】葉の向きを決定する処理方法を選択する流れを示すフローチャート(その2)である。
【図17】図17Aは第2の実施の形態に係る仮想空間のZX平面図であり、図17Bは図17Aの拡大図である。
【図18】第2の実施の形態に係る回転処理を説明する図である。
【図19】第3の実施の形態に係る回転処理において、ベクトルを説明する図である。
【図20】第4の実施の形態に係る葉の配置を決定するフローチャートである。
【図21】第4の実施の形態に係る葉の描画範囲を説明する図である。
【図22】第5の実施の形態に係る葉の配置を決定するフローチャートである。
【図23】図23Aは第5の実施の形態に係る葉の配置のX軸成分を決定する関数を示す図であり、図23Bは第5の実施の形態に係る葉の配置のY軸成分を決定する関数を示す図であり、図23Cは第5の実施の形態に係る葉の配置のZ軸成分を決定する関数を示す図である。
【図24】第6の実施の形態に係る葉の配置を決定するフローチャートである。
【図25】枝ベクトル情報テーブルを示す図である。
【図26】枝ベクトルを表す図である。
【図27】枝ベクトルを表す図である。
【符号の説明】
100…仮想空間 102…幹
104a…葉のポリゴン
104a1〜104a4…葉のポリゴンの頂点
e…仮想視点 f、g、h…関数
V…ポリゴン面の法線ベクトル Vbi…枝ベクトル
Z0…スクリーン面
[0001]
The present invention is suitable for drawing a large number of objects having the same shape, such as plant leaves. Painting The present invention relates to an image drawing apparatus, a recording medium on which a program for realizing the image drawing process is recorded, and a program.
[0002]
[Prior art]
Recently, computer graphics (CG) processing such as hidden line processing, hidden surface removal processing, smooth shading, texture mapping, and the like has rapidly progressed in conjunction with the rapid development of hardware.
[0003]
As CG processing, in general, a plurality of three-dimensional shapes (objects) are created by CAD three-dimensional modeling, and colors and shadows are given to these objects, and optical properties such as specular reflection, diffuse reflection, refraction, and transparency are applied. A rendering process is performed in which a special characteristic is added, a surface pattern is added, and drawing is performed in accordance with surrounding conditions (such as reflection of a window or a scene, or a reflection of light).
[0004]
[Problems to be solved by the invention]
By the way, when drawing a lot of objects of the same shape, such as plant leaves, a method of drawing by applying the above-described rendering processing to all the objects can be considered, but the processing is performed in units of fine polygons, so that It takes a long time to calculate and draw, and for example, the display speed of these objects on the monitor screen is slow.
[0005]
In addition, when each leaf is displayed as a single polygon, the display may be unnatural depending on the position of the viewpoint because the polygon is a plane.
[0006]
If each leaf is composed of a plurality of polygons, it can be approximated to a shape having a gentle curved surface like a real leaf, but the polygon information data will be enlarged.
[0007]
Furthermore, when producing an image having a large number of polygons such as plant leaves, the image producer must determine the arrangement of the large number of polygons one by one, which is a heavy burden on the image producer. Yes.
[0008]
The present invention has been made in consideration of such problems, and when drawing a large number of components having the same shape, such as plant leaves, each component is represented by a single polygon. By rotating the polygon so that it faces the correct direction, the time required for calculation and drawing can be greatly reduced. Painting An object of the present invention is to provide an image drawing apparatus, a recording medium on which a program capable of realizing the image drawing process is recorded, and a program.
[0009]
[Means for Solving the Problems]
Image drawing apparatus according to the present invention, recording medium according to the present invention, and program according to the present invention Is In a coordinate system in a virtual space where objects and polygons are arranged, at least one polygon is rotated by a predetermined means. means And the direction of the reference virtual viewpoint for drawing the image and the direction of the normal direction of the surface of the rotated polygon are 90 ° ± a °, the orientation of the polygon surface is reset. means It is characterized by having.
[0010]
By doing so, the polygon is not difficult to see from the virtual viewpoint, and the natural atmosphere of the plant can be expressed. Here, if the polygon is an image including leaves or branches of a plant, the plant can be drawn.
[0011]
Ma The predetermined means may be a random number generation means, and the polygon may be rotated in a direction set from the random number obtained by the random number generation means.
[0013]
By doing so, the polygon is not difficult to see from the virtual viewpoint, and the natural atmosphere of the plant can be expressed.
[0019]
Furthermore, it is easy to process the said polygon if it is a rectangle or a square.
[0020]
Furthermore, the amount of data related to the polygon can be reduced by having position information data of at least one vertex among all the vertices of the polygon.
[0021]
In the step of rotating the polygon, a rotation calculation is performed on the position information data of the at least one vertex to obtain a converted position after the rotation, and the other vertex is calculated from the converted position. Can be reduced.
[0022]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, the present invention relates to Painting An embodiment in which an image drawing apparatus is applied to an entertainment system, and an embodiment in which a recording medium and a program according to the present invention are applied to a recording medium and a program on which a program and data executed by the entertainment system are recorded This will be described with reference to FIGS.
[0023]
First, as shown in FIG. 1, an entertainment system 10 according to the present embodiment basically includes an entertainment device 12 that executes various programs, and a memory card 14 that is detachable from the entertainment device 12. And an operation device (controller) 16 that is detachable from the entertainment device 12 and a monitor (display) 18 that is a display device such as a television receiver to which video / audio signals from the entertainment device 12 are supplied. Composed.
[0024]
The entertainment device 12 reads out a program recorded on a large-capacity storage medium such as an optical disc 20 such as a CD-ROM or DVD-ROM, and responds to an instruction from a user (for example, a user or a game player). This is for executing a game or the like. The execution of the game mainly means that the input from the controller 16 is received through the connector 15 and the progress of the game is controlled while controlling the display and sound on the screen of the monitor 18.
[0025]
As shown in FIG. 1, the entertainment device 12 has a shape in which flat rectangular parallelepipeds are stacked, and the front panel is a disc mounting portion on which an optical disc 20 serving as a program / data recording medium is mounted. A disk tray 22 that moves back and forth, a reset switch 24 for arbitrarily resetting a program currently being executed, an open button 26 for pulling out the disk tray 22, and two insertion ports 30 of the memory card 14 And two controller terminals 32 and the like into which the connector 15 of the controller 16 is inserted. On the back side, there are a power switch 28, video and audio output terminals, and a monitor 18 via an AV (audio visual) cable. An AV multi-output terminal (not shown) connected to is arranged.
[0026]
The entertainment device 12 reads the program from the optical disc 20 which is a recording medium such as a CD-ROM or DVD-ROM in which a computer game (video game) program and data are recorded, and executes the program to thereby display the screen of the monitor 18. In addition to the control function for displaying characters and scenes above, various control functions such as movie playback using a DVD (digital video disk), which is another optical disc 20, and music playback using a CDDA (compact disk digital audio) are incorporated. Yes. It also has a function of executing a program obtained by communication via a communication network or the like. During the execution of the game program, the three-dimensional computer graphics image generated by the entertainment device 12 is displayed on the screen of the monitor 18 as a display device.
[0027]
In this case, the signal from the controller 16 is also processed by one of the control functions of the entertainment device 12, and the contents are reflected on the screen of the monitor 18, for example, on the movement of the character, switching of the scene, and the like. ing.
[0028]
The controller 16 is provided with first and second operation units 51 and 52 on the center left and right of the upper surface, third and fourth operation units 53 and 54 on the side surface, and analog operation on the front left and right of the upper surface. A left joystick 70 and a right joystick 72 for performing the above are provided.
[0029]
The first operation unit 51 is a pressing operation unit for giving an action to a character or the like displayed on the screen of the monitor 18, for example. The function is set by a program or the like recorded on the optical disc 20, and the character or the like is selected. It is composed of four operation keys (also referred to as direction keys) 51a, 51b, 51c, 51d having a function of moving up, down, left and right. The direction key 51a is also referred to as an up key, the direction key 51b as a down key, the direction key 51c as a left key, and the direction key 51d as a right key.
[0030]
The second operation unit 52 has four operation buttons 52a, 52b, 52c, and 52d in a columnar shape for pressing operation, and “△” and “ The identification marks “O”, “X”, and “□” are attached, and the operation buttons 52a to 52d are also referred to as a Δ button 52a, a ○ button 52b, an X button 52c, and a □ button 52d, respectively.
[0031]
The functions of the operation buttons 52a to 52d of the second operation unit 52 are set by a program or the like recorded on the optical disc 20. The operation buttons 52a to 52d have, for example, a left arm, a right arm, a left foot, and a right foot such as a character. The function to move is assigned.
[0032]
The third and fourth operation units 53 and 54 have substantially the same structure, and both of them are two operation buttons (also referred to as L1 buttons) 53a for pressing operation that are lined up and down, and are also referred to as operation buttons (L2 buttons). ) 53b, operation buttons (also referred to as R1 buttons) 54a, and operation buttons (also referred to as R2 buttons) 54b. The functions of the third and fourth operation units 53 and 54 are also set by a program recorded on the optical disc 20, and for example, a function for causing a character to perform a special action is assigned.
[0033]
The left and right joysticks 70 and 72 are each provided with a signal input element such as a variable resistor that can be tilted and rotated in the direction of 360 ° around the operation axis, and an analog value is output according to the tilt and rotation. . The left and right joysticks 70 and 72 are returned to the neutral position by an elastic member (not shown). When the left and right joysticks 70 and 72 are pressed downward, signals different from the analog values associated with the tilting and rotation of the joysticks 70 and 72 are output. That is, the left and right joysticks 70 and 72 have the functions of operation buttons (L3 button) 70a and (R3 button) 72a as fifth and sixth operation units for pressing operation.
[0034]
By rotating and tilting the left and right joysticks 70 and 72, for example, moving the character or the like while rotating it, or moving it while changing the speed, and further performing an analog movement such as changing the state. It becomes possible to input a command signal to be enabled.
[0035]
In FIG. 1, the left and right joysticks 70 and 72 can be used by switching to the first and second operation units 51 and 52. The switching is performed by an analog mode switch 74. When the left and right joysticks 70 and 72 are selected by the analog mode switch 74, the display unit 76 is turned on, and the selection state of the left and right joysticks 70 and 72 is displayed.
[0036]
As shown in FIG. 3, analog input values obtained by operating the left and right joysticks 70 and 72 are “0” to “255” in the vertical direction from top to bottom, and from left to right in the horizontal direction. “0” to “255”.
[0037]
In addition to the above, the controller 16 is provided with a start button (start switch) 78 for instructing the start of a game and the like, a select button (selection switch) 80 for selecting a difficulty level of the game at the start of the game, and the like. Yes.
[0038]
Next, the internal configuration and general operation of the entertainment apparatus 12 shown in FIG. 1 will be described with reference to the block diagram of FIG.
[0039]
The entertainment apparatus 12 is configured by connecting a RAM 402 and a bus 403 as semiconductor memories to a CPU 401 that controls the entertainment apparatus 12.
[0040]
A graphic synthesizer (GS) 404 and an input / output processor (IOP) 409 are connected to the bus 403, respectively. The GS 404 includes a RAM (image memory) 405 including a frame buffer, a Z buffer, a texture memory, and the like, and a rendering engine (RE) 406 having a rendering function including a drawing function to the frame buffer in the RAM 405.
[0041]
A monitor 18 as an external device is connected to the GS 404 configured as described above via an encoder 407 for converting a digital RGB signal or the like into an NTSC standard television system, for example.
[0042]
The IOP 409 includes a driver (DRV) 410 for reproducing and decoding data recorded on the optical disc 20, a sound generation system 412, a memory card 14 as an external memory including a flash memory, a controller 16, an operating system, and the like. The ROMs 416 on which are recorded are respectively connected. The sound generation system 412 is connected to a speaker 414 and a monitor 18 as external devices via an amplifier 413, and supplies an audio signal.
[0043]
The sound generation system 412 stores a sound processing unit (SPU) 420 that generates musical sounds, sound effects, and the like, and a musical sound, sound effects, etc. generated by the SPU 420 based on instructions from the CPU 401. Sound buffer 422. Signals such as musical sounds and sound effects generated by the SPU 420 are supplied to the audio terminals of the speaker 414 and the monitor 18 and output (sound) as musical sounds, sound effects and the like from the speakers of the speaker 414 and the monitor 18. Yes.
[0044]
Here, the SPU 420 is stored in the sound buffer 422 and an ADPCM decoding function for reproducing, for example, adaptive predictive coding (ADPCM: Adaptive Differential PCM) using 16-bit audio data as a 4-bit differential signal. A reproduction function for generating sound effects and the like by reproducing waveform data, a modulation function for reproducing waveform data stored in the sound buffer 422, and the like are provided.
[0045]
By providing such a function, the sound generation system 412 can be used as a so-called sampling sound source that generates musical sounds, sound effects, and the like based on the waveform data recorded in the sound buffer 422 according to instructions from the CPU 401. It is like that.
[0046]
The memory card 14 is a card-type external storage device comprising, for example, a CPU or a gate array and a flash memory, and is removable from the entertainment device 12 shown in FIG. The game state during the game is stored, and a DVD playback program and the like are stored.
[0047]
The controller 16 is for giving a command (a binary command or a multi-value command) to the entertainment device 12 by pressing a plurality of buttons. The driver 410 includes a decoder for decoding an image encoded based on the MPEG (moving picture experts group) standard.
[0048]
The CPU 401 includes a random number generator (not shown).
[0049]
By the way, when drawing a tree object as a three-dimensional image, it is generally considered that the tree object is divided into a trunk object and a large number of leaf objects. When drawing both the stem and leaf objects in a normal rendering process, the leaf object is drawn with a plurality of polygons and fixed coordinates, as in the case of the trunk object.
[0050]
However, it is clear that the amount of data is enormous because it is necessary to have each vertex data for a plurality of polygons constituting one leaf.
[0051]
Therefore, in the present embodiment, the trunk object adopts a data structure in which vertex data is provided for each of the polygons constituting the trunk object as usual, but the leaf object is shown in FIG. As shown, it is drawn with a single rectangular or square polygon. Actually, a leaf texture is pasted on a rectangular polygon.
[0052]
In this case, if one side is oriented in the vertical direction in world coordinates, one vertex is determined and the other vertex is automatically determined at the same time, which greatly increases the amount of vertex data related to the polygon. It becomes possible to reduce it.
[0053]
FIG. 5 shows an example in which a trunk object and a large number of leaf objects are drawn as seen from the plane.
[0054]
There is one problem with such a drawing method. That is, when a tree object is viewed from a certain viewpoint, the polygons constituting the leaves are viewed as trees with leaves over because all the polygon faces are in the direction of the virtual viewpoint e. However, when the viewpoint is turned by 90 °, for example, to make the virtual viewpoint ea, all polygon surfaces are arranged at an angle of 90 ° ± a ° with respect to the direction of the viewpoint for the polygons constituting the leaves. Therefore, when the tree is viewed from this viewpoint, the texture of the leaves can hardly be seen, resulting in a fallen trunk, resulting in inconvenience in display.
[0055]
Therefore, in the present embodiment, in addition to the above-described method, the above-mentioned problems are solved by drawing the polygon surfaces of the polygons constituting the leaves in the direction of the viewpoint.
[0056]
Specifically, several drawing methods according to the present embodiment will be described with reference to FIGS. A series of processing is performed by the CPU 401 and the RE 406, and the RAM 402, the image memory 405, and the like are used as a working memory.
[0057]
FIG. 6A is a ZX plan view of the virtual space 100. The virtual space 100 is virtually set for arranging objects and polygons for drawing an image. This virtual space 100 is a three-dimensional space, and the X axis is oriented horizontally to the image plane to be drawn, the Y axis corresponding to the height direction of the image plane to be drawn (see FIG. 6C), and the Z axis perpendicular to the image plane to be drawn. Has an axis.
[0058]
In addition, the actual general CG method has a world coordinate system that is not influenced by the image plane in addition to the coordinate system (screen coordinate system) based on the orientation of the image plane.
[0059]
In the virtual space 100, the object and the trunk of the trunk 102 extending in the Y-axis direction are between the virtual viewpoint e serving as a reference for drawing and the virtual screen (background plane) Z0 perpendicular to the Z-axis on which the image is drawn. A plurality of leaf polygons 104a provided in the vicinity of the object 102 are arranged. The leaf polygon 104a (see also FIG. 4) is a rectangle, the four vertices of the leaf polygon 104a are represented as 104a1 to 104a4, and the vertices 104a1 and 104a4 are configured to be diagonal. The leaf polygon 104a does not necessarily display only a leaf picture, but may include a branch picture. Also, the number of leaf pictures need not be one, but may be a plurality.
[0060]
FIG. 6B is an enlarged view of one of the leaf polygons 104a in FIG. 6A. Here, V is a normal vector based on the reference point Lo of the leaf polygon 104a, and Ve is a viewpoint vector indicating the direction of the virtual viewpoint e with the reference point Lo as the base point. When the leaf polygon 104a is rotated by an angle θ1 formed between the normal vector V and the viewpoint vector Ve, a converted polygon 104b is obtained. When the converted polygon 104b is projected on the screen Z0 based on the virtual viewpoint e, a leaf projection surface 104c is obtained.
[0061]
FIG. 6C is a ZY plan view of the virtual space 100 in which the positional relationship among the trunk 102, the converted polygon 104b, the virtual viewpoint e, and the leaf projection plane 104c is clarified. The projection relationship on the ZX plane shown in FIG. 6A is the same on the ZY plane.
[0062]
In the image drawing method according to the first embodiment, as shown in FIGS. 6A and 6B, the normal V of the polygon surface of the leaf polygon 104a in an arbitrary direction arranged around the trunk 102 in advance is used as a reference. The converted polygon 104b is obtained by rotating it so as to coincide with a straight line connecting the point Lo and the virtual viewpoint e. Next, a calculation for projecting the converted polygon 104b onto the screen surface Z0 is performed to obtain a leaf projection surface 104c.
[0063]
A specific method of the image drawing method according to the first embodiment will be described with reference to FIGS. 6A to 16.
[0064]
As shown in FIG. 7, tree drawing can be divided into three processes: initialization processing (step S1), trunk drawing processing (step S2), and leaf drawing processing (step S3).
[0065]
In the initialization process (step S1), the object information table 106 shown in FIG. 8, the polygon information table 108 of the trunk shown in FIG. 9, the polygon information table 110 of the leaf shown in FIG. The texture map, which is the polygon pattern data, is loaded into the texture memory of the image memory 405.
[0066]
The object information table 106 is information including the reference absolute coordinate T0 of the trunk, the number of trunk polygons Nm, the trunk polygon information table address ADm, the number of branches Nb, and the branch vector information table address ADb.
[0067]
The stem polygon information table 108 has information on Nm trunk polygons. The stem polygon information includes the relative position coordinates of the four vertices 104a1 to 104a4 of the polygon, the color data of the four vertices 104a1 to 104a4, and Texture map address ADt i including. i represents the number of the polygon of the trunk, and takes a numerical value of 0 to Nm-1.
[0068]
The trunk drawing (step S2) will be described with reference to FIG.
[0069]
First, in step S101, the number Nm of trunk polygons, the reference absolute coordinates T0 of the trunk, and the address ADm of the trunk polygon information table 108 are secured in a register or the like from the object information table 106 shown in FIG.
[0070]
In step S102, the initial value “0” is stored in the counter i, and the counter i is initialized.
[0071]
In step S103, the trunk polygon information indicated by the counter i is read from the stem polygon information table 108 indicated by the address ADm.
[0072]
In step S104, the reference absolute coordinate T0 of the trunk is added to the relative coordinates of the four vertices 104a1 to 104a4 in the read polygon information of the trunk. In this way, the world coordinate values of the four vertices 104a1 to 104a4 of the leaf polygon 104a are obtained. Further, a relative position Zr on the Z axis with respect to the screen Z0 is obtained from the world coordinate values of the four vertices 104a1 to 104a4.
[0073]
Next, color correction, projection processing onto the screen Z0, and the like are performed. These processing steps S105 to S108 are generally called rendering processing.
[0074]
In the rendering process, first, in step S105, the color of the converted polygon is calculated. First, using the color data of the four vertices 104a1 to 104a4 included in the polygon information of the trunk 102, the color within the range of the converted polygon 104b is corrected. Then, the surface brightness is obtained by performing optical calculation from information on a virtual light source (not shown), and the texture of the surface is further corrected.
[0075]
In step S106, a leaf projection surface 104c (see FIG. 6A) obtained by projecting the converted polygon 104b onto the screen Z0 is obtained.
[0076]
In step S107, the texture map address ADt of the polygon information is applied to the projection plane range. i A drawing image is obtained by adding the texture indicated by the above to the shape of the projection surface.
[0077]
In step S108, the obtained drawing image is written in the display buffer of the RAM 405, and the relative position Zr on the Z axis is written in the Z buffer of the RAM 405.
[0078]
In step S109, after updating the counter i by +1, it is determined in the next step S110 whether the processing is completed. That is, if i and Nm are equal, all the processing has been completed for the trunk polygon, and the processing moves to the leaf drawing processing (step S3) shown in FIG. If i and Nm are different (if i is smaller than Nm), the process returns to step S103 to repeat the process.
[0079]
Next, leaf drawing (step S3) will be described with reference to FIG.
[0080]
First, in step S201, the number Nl of leaf polygons 104a to be drawn is determined. The number Nl of leaf polygons 104a is determined in advance and may be stored in the optical disc 20 or the like, or the number of leaf polygons 104a corresponding to the shape of the trunk 102 drawn in step S1 is appropriately determined. May be.
[0081]
Then, in step S202, a process for determining the placement of leaves is performed, and in step S203, a process rendering process for determining the orientation of leaves is performed, thereby rendering the leaves. Among these, the process of step S202 will be described later.
[0082]
In the process of determining the orientation of the leaves in step S203, first, in step S203a, the counter i is first initialized to “0” as an internal process. Next, in step S203b, the orientation of the leaf indicated by the counter i is determined. Details of the processing in step S203b will be described later.
[0083]
In step S203c, after updating the counter i by +1, it is determined whether the processing is completed in the next step S203d. In other words, if i and Nl are equal, all the processing has been completed for the trunk polygon, and the process proceeds to rendering processing (step S204). If i and Nl are different (if i is smaller than Nl), the process returns to step S203b and the process is repeated.
[0084]
The rendering process in step S204 is the same process as steps S105 to S108 described in the trunk drawing process, and thus detailed description thereof is omitted.
[0085]
The processing for determining the arrangement of leaves in FIG. 11 (step S202) will be described with reference to FIGS. 12 and 13 showing the processing contents.
[0086]
First, in step S301, an initial value “0” is stored in the counter i, and the counter i is initialized.
[0087]
In step S302, the leaf polygon information indicated by the counter i is read from the leaf polygon information table 110.
[0088]
As shown in FIG. 13, each leaf polygon information table 110 has substantially the same configuration as the trunk polygon information table 108, and represents a leaf as one polygon. That is, the relative coordinate values of the four vertices 104a1 to 104a4, the color data of the four vertices 104a1 to 104a4, and the texture map address ADl. i It is the structure which has. The relative coordinates of the four vertices 104a1 to 104a4 are set so as to form a plane. Further, the leaf polygon information table 110 has information on the number Nl of leaves to be drawn.
[0089]
In step S303, the relative coordinate values of the four vertices 104a1 to 104a4 are converted into absolute coordinates based on the reference absolute coordinate T0 of the trunk 102, and the four vertices 104a1 of the leaf polygon 104a indicated by the counter i are converted. The world coordinate values of ˜104a4 are determined. Thus, since the leaf position information is composed of relative coordinates, it is possible to cope with the trunk 102 wherever the virtual space 100 is arranged.
[0090]
In step S304, after updating the counter i by +1, it is determined in the next step S305 whether the process is completed. In other words, if i and Nl are equal, all the processing has been completed for the trunk polygon, and the processing moves to the leaf drawing processing (step S203) in FIG. If i and Nl are different (if i is smaller than Nl), the process returns to step S301 to repeat the process.
[0091]
Next, processing for determining the orientation of the leaf indicated by the counter i in FIG. 11 (step S203b) will be described with reference to FIGS. 6A, 6B, 15 and 16. FIG. Several methods can be considered for determining the leaf orientation, and FIGS. 15 and 16 are flowcharts showing the types of processing for determining the leaf orientation. Of these, the method for determining the orientation of the leaves according to the first embodiment will be described.
[0092]
First, in step S401, it is determined whether or not the orientation of the leaf polygon 104a has been determined in the processing performed in step S202. In the first embodiment, the information of the leaf polygon 104a has the world coordinate values of the four vertices 104a1 to 104a4, and the coordinates of the four vertices 104a1 to 104a4 are set to form a plane. Therefore, the direction of the leaves is uniquely determined. Accordingly, the process proceeds to the next step S402.
[0093]
In step S402, a leaf normal vector V is calculated from the world coordinate values of the four vertices 104a1 to 104a4. Since the four vertices 104a1 to 104a4 are set so as to constitute a plane, the normal vector V may be calculated for two vectors obtained by selecting three of them.
[0094]
Next, in step S403, it is determined whether or not to consider whether the direction of the normal vector V is an inconvenient display direction with respect to the virtual viewpoint e. This determination is determined in advance by the image producer in consideration of the processing speed and the like, and may not be determined by the CPU 401. When the normal vector V is not considered, that is, when the orientation of the leaf polygon 104a is uniformly changed, the process proceeds to step S405.
[0095]
When the normal vector V is considered, the process proceeds to step S404, and the direction of the normal vector V is determined. In this determination, a straight line vector connecting the reference point Lo of the leaf polygon 104a and the virtual viewpoint e is set as the viewpoint vector Ve, and an angle θ1 formed by the viewpoint vector Ve and the normal vector V is calculated. When the obtained angle θe is within 90 ° ± a °, the leaves are in an inconvenient display because the leaves are oriented substantially parallel to the virtual viewpoint e. Therefore, the process moves to step S405 to change the orientation of the leaves. If the angle is other than that, the process shown in FIG. 15 is terminated assuming that the direction of the leaf is not changed. Here, a ° is determined arbitrarily by the image producer, but is generally a numerical value within 45 °.
[0096]
In steps S405 and S405a, it is determined on what basis to change the leaf orientation. This determination may be determined in advance by the image producer. In the first embodiment, the process proceeds to step S406.
[0097]
In step S406, the leaf polygon 104a is rotated so as to face the virtual viewpoint e. The rotation process will be described with reference to FIGS. 6A and 6B.
[0098]
The normal vector V is rotated by an angle θ1 around the reference point Lo of the leaf polygon 104a so that the normal vector V coincides with the viewpoint vector Ve. That is, the coordinate values of the converted polygon 104b to which the four vertices 104a1 to 104a4 of the polygon 104a are moved by the rotation are calculated. FIG. 6B shows an example in which the reference point Lo is set to one of the four vertices 104a1 to 104a4 of the leaf polygon 104a, for example, the vertex 104a1. In this way, if one of the four vertices 104a1 to 104a4 is taken as the reference point Lo, only the remaining three vertices need be calculated.
[0099]
Also, by setting the leaf polygon 104a to be rectangular or square and the normal vector V to be parallel to the ZX plane, two diagonal vertices of the leaf polygon 104a, for example, the vertex 104a1 and If only the vertex 104a4 is calculated and the converted positions after rotation are obtained, the remaining two vertices 104a2 and 104a3 can be expressed by conversion from the converted positions of the results of the calculations for the vertices 104a1 and 104a4. Furthermore, in this case, if the reference point Lo is set to one of the four vertices 104a1 to 104a4, for example, 104a1, if the converted position after rotation is obtained for only one point of the diagonal vertex 104a4, Since other vertices can be expressed in terms of conversion, the amount of calculation is greatly reduced.
[0100]
In addition, since the information necessary for the leaf polygon 104a is only information on one vertex among the plurality of vertices, the amount of data can be reduced.
[0101]
Thus, since the converted polygon 104b obtained by rotating the polygon 104a faces the virtual viewpoint e, there is no inconvenience in display.
[0102]
Since the leaf orientation has been determined, step S203b in FIG. 11 ends. This process is executed according to the control process of the counter i (step S203a, step S203c and step S203d), and when the orientation is determined for the Nl leaf polygon 104a, the process may be shifted to the rendering process (step S204).
[0103]
Note that the processing for determining the leaf orientation (step S203) has been described on the ZX plane with reference to FIGS. 6A and 6B, but in reality, the leaf polygon 104a may be rotated in the three-dimensional space. Good.
[0104]
A method of rotating the leaf polygon 104a in the three-dimensional space will be described with reference to FIGS. 14A and 14B. 14A and 14B have the same orientation as the axes of the screen coordinate system, but the origin of the screen coordinate system is ignored and only the relative direction is represented. .
[0105]
FIG. 14A is a diagram illustrating a state in which the normal vector V of the leaf polygon 104a is rotated on the ZX plane in the direction of the viewpoint vector Ve.
[0106]
Vy and Vey are two-dimensional vectors of ZX plane components of the normal vector V and the viewpoint vector Ve, respectively. θ11 is an angle formed by the two-dimensional vectors Vy and Vey. V1 is a vector obtained by rotating the normal vector V by an angle θ11 around the Y axis.
[0107]
FIG. 14B shows a two-dimensional coordinate constituted by a two-dimensional vector Vey and the Y axis. θ12 is an angle formed by the rotated vector V1 and the viewpoint vector Vey.
[0108]
In order to orient the leaf polygon 104a in the direction of the virtual viewpoint e, first, a first rotation process for rotating the leaf normal vector V about the Y axis by an angle θ11 is performed. By this processing, the normal vector V moves to the position of the vector V1. In this state, the ZX plane component of the vector V1 after movement and the viewpoint vector Ve match.
[0109]
Next, a second rotation process is performed in which the moved vector V1 is rotated by an angle θ12 in the two-dimensional coordinate system shown in FIG. 14B. By this processing, the vector V1 coincides with the viewpoint vector Ve, and the leaf polygon 104a faces the virtual viewpoint e.
[0110]
Note that the rotation processing may be performed directly in the direction from the normal vector V to the viewpoint vector Ve in the three-dimensional space without dividing the rotation processing twice.
[0111]
Furthermore, in the above description, as shown in FIG. 11, all leaf arrangements are determined in step S202, and then the leaf orientation is determined in step S203. You may process so that the direction of a leaf and the arrangement | positioning of a leaf may be determined continuously.
[0112]
The polygon is not limited to a rectangle such as a rectangle or a square, but may be a triangle or a pentagon.
[0113]
As described above, in the image drawing method according to the first embodiment, since the leaf polygons are all directed toward the virtual viewpoint e, the polygons are not difficult to see from the virtual viewpoint e.
[0114]
Further, since the leaf polygon information table 110 is provided, the arrangement, color, and texture can be freely set for individual leaves, so that the degree of freedom in expression is high.
[0115]
Furthermore, by making the shape of the leaf polygon 104a rectangular and setting the rotation reference point as the vertex of the polygon, the amount of calculation related to rotation can be greatly reduced.
[0116]
Next, an image drawing method according to the second embodiment will be described with reference to FIGS. 17A to 18.
[0117]
In the second embodiment, substantially the same processing as in the first embodiment is performed, but in the processing of rotating the leaf polygon 104a, the direction of rotation is different. That is, as shown in FIGS. 17A and 17B, the polygon 104a is rotated in the Z-axis direction to obtain a converted polygon 104d.
[0118]
Specifically, in the process in FIG. 15, the process proceeds from step S405 to step S407 via the branch process in step S405a.
[0119]
In step S407, the leaf polygon 104a is rotated in the direction of the Z-axis. The rotation process will be described with reference to FIGS. 17A and 17B.
[0120]
FIG. 17A is a ZX plan view of the virtual space 100 according to the second embodiment. Reference numeral 104d denotes a converted polygon obtained by rotating the polygon 104a in the Z-axis direction. The other symbols are the same as in FIG. 6A. FIG. 17B is an enlarged view of the leaf polygon 104a portion of FIG. 17A. Vz is a Z-axis vector indicating the Z-axis direction starting from the reference point Lo of the leaf polygon 104a. The angle θ2 is an angle formed by the normal vector V and the Z-axis vector Vz.
[0121]
The normal vector V is rotated by an angle θ2 around the reference point Lo so that the normal vector V coincides with the Z-axis vector Vz. That is, the coordinate values of the converted polygon 104d to which the four vertices 104a1 to 104a4 of the polygon 104a are moved by the rotation are calculated. Thus, when rotating in the direction of the Z-axis, there is an effect that the calculation is simplified without considering the direction of the virtual viewpoint e. Also, since the leaves are directed in the Z-axis direction, they are different from the direction of the virtual viewpoint e, but are parallel to the screen Z0, so that they are not particularly difficult to see in image drawing.
[0122]
Further, if the method for selecting the reference point Lo and the polygon shape setting are the same as in the first embodiment, the amount of calculation can be reduced.
[0123]
Since the leaf orientation has been determined, step S203b in FIG. 11 ends. This process is executed according to the control process of the counter i (step S203a, step S203c and step S203d), and when the orientation is determined for the Nl leaf polygon 104a, the process may be shifted to the rendering process (step S204).
[0124]
Note that the processing for determining the leaf orientation (step S203) has been described on the ZX plane with reference to FIG. 17B, but the leaf polygon 104a may actually be rotated in the three-dimensional space.
[0125]
A method of rotating the leaf polygon 104a in the three-dimensional space will be described with reference to FIG.
[0126]
FIG. 18 is a diagram illustrating a state in which the normal vector V of the leaf polygon 104a is rotated on the ZX plane in the direction of the Z-axis vector Vz.
[0127]
In FIG. 18, the positional relationship between the coordinates and the normal vector V and the two-dimensional vector Vy are the same as those in FIG. 14A. The angle θ21 is an angle formed by the two-dimensional vector Vy and the Z-axis vector Vz. V2 is a vector obtained by rotating the normal vector V about the Y axis by an angle θ21. The angle θ22 is an angle formed by the rotated vector V2 and the Z-axis vector Vz.
[0128]
In order to orient the leaf polygon 104a in the direction of the Z-axis vector Vz, first, a first rotation process is performed to rotate the leaf normal vector V about the Y axis by an angle θ21. By this processing, the normal vector V moves to the position of the vector V2. In this state, the ZX plane component of the vector V1 after movement and the Z-axis vector Vz coincides.
[0129]
Next, a second rotation process for rotating the vector V2 after movement on the ZY plane by an angle θ22 is performed. With this processing, the vector V2 coincides with the Z-axis vector Vz, and the leaves are directed in the Z-axis direction.
[0130]
In addition, even if it does not calculate in two steps in this way, you may process so that it may rotate directly in the direction of the normal vector V to the Z-axis vector Vz on a three-dimensional space.
[0131]
As described above, in the image drawing method according to the second embodiment, since all the leaves are directed in the Z-axis direction, the amount of calculation of rotation is small, and particularly when viewed from the virtual viewpoint e. It is not difficult to see.
[0132]
Next, an image drawing method according to the third embodiment will be described with reference to FIG. 15, FIG. 16, and FIG.
[0133]
In the third embodiment, almost the same processing as that in the first embodiment is performed, but the rotation processing is different in the processing of rotating the leaf polygon 104a. In other words, it is not directed in a specific direction, but is directed in an arbitrary direction by a random number obtained by a random number generator.
[0134]
Specifically, in the process in FIGS. 15 and 16, the process proceeds from step S405 to step S408 via the branch process in step S405a.
[0135]
In step S408, several random numbers are obtained by a random number generator. Then, a random number vector Vr (see FIG. 19) pointing in a certain direction is set by this random number.
[0136]
Consider a range of a quadrangular pyramid Py centered on the Z-axis as shown in FIG. In FIG. 19, x0 and y0 are an X coordinate value and a Y coordinate value that define the quadrangular pyramid Py, respectively. x1 and y1 are the X coordinate value and the Y coordinate value of the random number vector Vr to be set. z1 is the Z coordinate value of the random number vector Vr.
[0137]
The Z-axis coordinate value z1 of the random number vector Vr, the X-axis coordinate value x0 that defines the quadrangular pyramid, and the Y-axis coordinate value y0 are set to appropriate values. The X-axis coordinate value x0 and the Y-axis coordinate value y0 are preferably smaller than the Z-axis coordinate value z1. Next, two random numbers are acquired by a random number generator. This random number generator generates a value within a range of ± 1. Then, the obtained two random numbers are multiplied by the X-axis coordinate value x0 and the Y-axis coordinate value y0, respectively, to obtain the X-axis coordinate value x1 of the random number vector Vr and the Y-axis coordinate value y1 of the random number vector Vr. This value is combined with the Z-axis coordinate value z1 to define the random number vector Vr (x1, y1, z1). The random number vector Vr indicates a direction within the range of ± x0 on the X axis and ± y0 on the Y axis with the Z axis as the center.
[0138]
If the random number vector Vr is defined, the process proceeds to step S409.
[0139]
In step S409, the direction of the random number vector Vr obtained in step S408 is determined. This determination is made by calculating the angle formed by the viewpoint vector Ve and the random number vector Vr. When the obtained angle is within 90 ° ± a °, the leaves are in an inconvenient display because the leaves are oriented substantially parallel to the virtual viewpoint e. Accordingly, the process moves to step S408 to change the orientation of the leaves. If the angle is any other angle, the process proceeds to the next step S410 assuming that the leaf orientation is not changed.
[0140]
In step S410, the leaf polygon 104a is rotated so that the orientation of the leaf polygon 104a is directed to the direction of the random number vector Vr. This rotation processing is to rotate in the direction of the random number vector Vr instead of the viewpoint vector Ve in FIGS. 6A, 6B, 14A, and 14B described in the first embodiment. Since the processing procedure is the same, detailed description thereof is omitted.
[0141]
Since the leaf orientation has been determined, step S203b in FIG. 11 ends. This process is executed according to the control process of the counter i (step S203a, step S203c and step S203d), and when the orientation is determined for the Nl leaf polygon 104a, the process may be shifted to the rendering process (step S204).
[0142]
Note that the processing for determining the orientation of the leaves (step S203) is set so that the random number vector Vr faces the direction within the range of the quadrangular pyramid Py with reference to FIG. 19, but this range is indicated by the quadrangular pyramid Py. It does not have to be set, and it may be directed in any direction without setting a range.
[0143]
As described above, in the image drawing method according to the third embodiment, since the orientation of the leaf polygon 104a is determined using a random number, the orientation of each leaf is set differently, and the natural atmosphere of the plant Can be expressed.
[0144]
In addition, since a process for resetting the direction of leaves that are substantially parallel to the direction of the virtual viewpoint e is performed, it is not particularly difficult to see from the virtual viewpoint e.
[0145]
In the first to third embodiments described above, the drawing method has been described so that the orientation of the leaf polygon 104a becomes an appropriate direction. In the following fourth to sixth embodiments, a method of arranging the leaf polygon 104a around the trunk 102 will be described.
[0146]
An image drawing method according to the fourth embodiment will be described with reference to FIGS. 15, 16, 20, and 21.
[0147]
In the fourth embodiment, substantially the same processing as in the first embodiment is performed, but the processing for arranging the leaf polygon 104a is different. In other words, the arrangement position is determined for each leaf object by using a random number.
[0148]
Specifically, the processing shown in FIG. 15, FIG. 16 and FIG. 20 is performed as the processing contents of the processing for determining the placement of leaves in FIG.
[0149]
FIG. 21 shows an example in which the reference absolute coordinate T1 is set at a substantially central portion of the trunk 102, and the space range S for drawing the leaves is set to a spherical body with a radius r.
[0150]
In step S501 in FIG. 20, a reference absolute coordinate T1 for drawing a leaf is appropriately determined. The reference absolute coordinate T1 may be determined based on the coordinate value of the trunk 102.
[0151]
Next, in step S502, a range S of a space for drawing leaves is set with reference to the reference absolute coordinate T1. The range S may be a shape such as a spherical body, an ellipsoid, a cylinder, or a cone. Hereinafter, the range S will be described as a spherical body (see FIG. 21).
[0152]
In step S503, an initial value “0” is stored in the counter i, and the counter i is initialized.
[0153]
In step S504, three random numbers are generated by the random number generator of the CPU 401, and the random number is matched with the range S to obtain the reference position of the leaf. Specifically, the three random numbers obtained by the random number generator are set as q1, q2, q3 and using the radius r,
K = r / (sqr (q1 * q1 + q2 * q2 + q3 * q3))
A constant value K is obtained. Here, sqr (...) is a square root function.
[0154]
Then, the constant value K is multiplied by q1, q2, and q3, respectively, and one of the four vertices 104a1 to 104a4 of the leaf polygon 104a, for example, the X-axis relative coordinate value r1 and the Y-axis relative coordinate value of the vertex 104a1. r2 and the Z-axis relative coordinate value r3 are obtained.
[0155]
When the relative coordinate values (r1, r2, r3) of one vertex 104a1 of the leaf polygon 104a are obtained, the relative coordinate values are converted into world coordinate values using the reference absolute coordinate T1 as a reference, and the th leaf indicated by the counter i is displayed. Is stored in the RAM 402 or the like as the position of one vertex 104a1 of the polygon 104a.
[0156]
In step S505, after updating the counter i by +1, it is determined in step S506 whether the processing is completed. That is, if i and Nl are equal, the arrangement of one vertex 104a1 of the Nl leaf polygon 104a has been determined, so the processing shown in FIG. 20 is terminated, and the process proceeds to step S203 shown in FIG. If i and Nl are different (if i is smaller than Nl), the process returns to step S504 and the process is repeated.
[0157]
When the arrangement of the leaf polygon 104a is determined, step S202 in FIG. 11 is completed.
[0158]
Next, the process proceeds to the process of determining the orientation of the leaves in FIG. 11 (step S203). The process is the same as that of the first embodiment except for the process of determining the orientation of the leaf to be drawn indicated by the counter i (step S203b).
[0159]
In FIG. 15 and FIG. 16 describing step S203b, first, in step S401, it is determined whether or not the orientation of the leaf is uniquely specified. In the fourth embodiment, since the leaf polygon 104a has only the coordinates of one vertex 104a1 among the four vertices 104a1 to 104a4, the orientation is not specified.
[0160]
Accordingly, the process proceeds to step S411 in FIG. 16 to temporarily specify the orientation of the leaf polygon 104a. Here, it is defined in the Z-axis direction, which is the same direction as in the second embodiment.
[0161]
The subsequent processing is the same as in the case of the first embodiment and the second embodiment. 15 and 16, step S412 and step S412a are step S405 and step S405a, step S413 is step S406, step S414 is step S408, step S415 is step S409, and step S416 is step S410. Each corresponds.
[0162]
Although there is no processing corresponding to step S407 in the case of the second embodiment, since the initial direction is the same as that in the case of the second embodiment, the processing after branching in step S412a is unnecessary, and as a result Step S407 is not necessary.
[0163]
This completes the process of determining the orientation of the leaves in FIG. 11 (step S203), and thereafter, the process may be performed in the same manner as in the first embodiment.
[0164]
As described above, in the image drawing method according to the fourth embodiment, since the arrangement of the leaf polygon 104a is determined using random numbers, the image producer only needs to determine the number of leaves Nl. No modeling work is required. Moreover, any number of trees having different leaf arrangements can be constructed.
[0165]
Next, an image drawing method according to the fifth embodiment will be described with reference to FIGS. 22, 23A, 23B, and 23C.
[0166]
In the fifth embodiment, almost the same processing as that of the first embodiment is performed, but the processing for arranging the leaf polygon 104a is different. That is, the arrangement position is determined for each leaf object by using a predetermined function.
[0167]
Specifically, the processing shown in FIG. 15, FIG. 16, and FIG. 22 is performed as the processing contents of the processing for determining the arrangement of the leaves to be drawn (step S202) in FIG.
[0168]
FIG. 23A shows an example in which the X-axis relative coordinate value r1 is calculated using a function f obtained by modifying a normal distribution function whose maximum value is r. The function f is obtained by reversing the vertical axis of the normal distribution function. By using this function f, a value relatively close to 0 is obtained for the counter i, and a value close to the radius r is decreased. Also, a value greater than the radius r is not possible.
[0169]
FIG. 23B is also an example of calculating the Y-axis relative coordinate value r2 using a function g obtained by modifying a normal distribution function whose maximum value is r. The function g is obtained by dividing the normal normal distribution function into two and shifting the phase, and a value different from the function f can be obtained.
[0170]
FIG. 23C is an example of calculating the Z-axis relative coordinate value r3 using a linear function as the function h. Since it does not require a complicated operation like the normal distribution function, it can be calculated easily.
[0171]
In step S601 in FIG. 22, a reference absolute coordinate T1 for drawing a leaf is appropriately determined. Further, in step S602, a space range S in which leaves are drawn with reference absolute coordinates T1 as a reference is set. The reference absolute coordinate T1 and the range S are as described in the fourth embodiment. In the following description, the range S is a spherical body having a radius r (see FIG. 21).
[0172]
Next, in step S603, an initial value “0” is stored in the counter i, and the counter i is initialized.
[0173]
In step S604, the arrangement of one of the four vertices 104a1 to 104a4 of the leaf polygon 104a, for example, the vertex 104a1, is determined by an appropriate function. Three functions are prepared.
r1 = f (i, r)
r2 = g (i, r)
r3 = h (i, r)
And The functions f, g, and h determine values based on the counter i and the radius r, respectively.
[0174]
Examples of functions f, g, and h are shown in FIGS. 23A, 23B, and 23C.
[0175]
These functions f, g, and h may be set as appropriate, and may be other than the above. Further, the horizontal axis values of the functions f, g, and h may not be sequentially increased by the counter i, but may be selected at random using random numbers or the like.
[0176]
In this way, the relative coordinates (r1, r2, r3) of one vertex 104a1 among the four vertices 104a1 to 104a4 of the leaf polygon 104a distributed within the spherical range S of radius r are determined.
[0177]
This relative coordinate value is converted into a world coordinate value based on the reference absolute coordinate T1, and stored in the RAM 402 as the position of one vertex 104a1 of the four vertices 104a1 to 104a4 of the leaf polygon 104a indicated by the counter i.
[0178]
In step S605, after the counter i is updated by +1, it is determined in step S606 whether the processing is completed. In other words, if i and Nl are equal, the arrangement of the Nl leaf polygons 104a has been determined, so the processing shown in FIG. 20 is terminated and the process proceeds to step S203 shown in FIG. If i and Nl are different (if i is smaller than Nl), the process returns to step S604 and the process is repeated.
[0179]
When the arrangement of the leaf polygon 104a is determined, step S202 in FIG. 11 is completed.
[0180]
Next, the process proceeds to the process of determining the leaf orientation shown in FIGS. Since these processes are the same as those in the fourth embodiment, a detailed description thereof will be omitted.
[0181]
Further, after the process of determining the leaf orientation is completed, the process may be performed in the same manner as in the first embodiment.
[0182]
As described above, in the image drawing method according to the fifth embodiment, the layout of leaf polygons is determined using a function, so the image producer determines only the number of leaves Nl and the functions f, g, and h. As a result, normal modeling work becomes unnecessary, and by using a normal distribution function or the like, the center is dense with the reference absolute coordinate T1 as the center, and it becomes rougher toward the radius r. The arrangement of the leaves can be realized and the natural atmosphere of the plant can be expressed.
[0183]
Next, an image drawing method according to the sixth embodiment will be described with reference to FIGS.
[0184]
In the sixth embodiment, almost the same processing as in the first embodiment is performed, but the processing for arranging the leaf polygon 104a is different. That is, the branch vector Vb of the trunk 102 i By preparing (see FIG. 26), this branch vector Vb i The leaf polygon 104a is arranged on the top. Note that i is the value of the counter i.
[0185]
Specifically, the processing shown in FIG. 15, FIG. 16 and FIG. 24 is performed as the processing content of the processing for determining the placement of leaves in FIG.
[0186]
The branch vector information table 112 shown in FIG. 25 includes Nb branch vectors Vb. i Each branch vector information is a branch vector Vb with respect to the reference. i Relative coordinates, angle data and length L i including.
[0187]
FIG. 26 shows the branch vector Vb. i FIG. Where branch vector Vb i Indicates Nb branches with respect to the trunk 102, and its starting point is expressed in relative coordinates. That is, it is possible to deal with the trunk 102 wherever it is arranged in the virtual space 100. The branch vector Vb i Angle and size L i It shall be represented in the polar coordinate format represented by
[0188]
FIG. 27 shows a vector Vb indicating the position of one vertex 104a1 of the four vertices 104a1 to 104a4 of the leaf polygon 104a. ij FIG. Vector Vb ij Is the branch vector Vb i Indicates that only the size is changed in the same direction as.
[0189]
In step S701 in FIG. 24, data relating to the branches of the trunk 102 is read. That is, the number Nb of branches, the branch vector information table address ADb, and the branch vector information table 112 shown in FIG. 25 are read in the object information table 106 (see FIG. 8).
[0190]
Next, in step S702, the initial value “0” is stored in the counter i, and the counter i is initialized.
[0191]
Proceeding to step S703, the branch vector Vb indicated by the counter i from the branch vector information table 112 indicated by the address ADb. i Read the information.
[0192]
In step S704, the branch vector Vb i Number of leaves for Nb i To decide. Nb for simplicity of explanation i = Nl / Nb. That is, the total number of all leaves is set to Nl as in the other embodiments.
[0193]
In step S705, the initial value “0” is stored in the counter j, and the counter j is initialized.
[0194]
Moving to step S706, the branch vector Vb indicated by the counter i i The branch vector Vb i Nb above i The arrangement of the leaf polygons 104a is calculated.
[0195]
That is, as shown in FIGS. 25 and 27, the branch vector Vb i The size of L i Therefore, the branch vector Vb i The direction is the same and the size is L i × j / Nb i Relative coordinate vector Vb of one vertex 104a1 of the leaf polygon 104a ij Ask for. Then, the relative coordinate value is converted into a world coordinate value based on the reference absolute coordinate T1, and (i × Nb i ) The position of the + jth leaf is stored in the RAM 402 or the like.
[0196]
In step S707, after updating the counter j by +1, it is determined in step S708 whether the processing is completed. That is, the counter j and the branch vector Vb i Number of leaves Nb i If they are equal, the process proceeds to step S709. j and Nb i Are different (j is Nb i If smaller, the process returns to step S706 to perform the next process.
[0197]
Further, after updating the counter i by +1 in step S709, it is determined whether or not the processing is completed in the next step S710. That is, the counter i and the branch vector Vb i If the number Nm is equal, the arrangement of the vertices 104a1 of the Nl leaf polygons 104a has been determined, so the processing shown in FIG. If i and Nm are different (if i is smaller than Nm), the process returns to step S703 to perform the next process.
[0198]
When the arrangement of the leaf polygon 104a is determined, step S202 in FIG. 11 is completed.
[0199]
Next, the process proceeds to the process of determining the leaf orientation shown in FIGS. Since these processes are the same as those in the fourth embodiment, a detailed description thereof will be omitted.
[0200]
Further, after the process of determining the leaf orientation is completed, the process may be performed in the same manner as in the first embodiment.
[0201]
Although the branch vector has been described by exemplifying a part actually drawn as a part of the trunk 102, in order to display only the leaf at a part where no branch exists, the branch vector Vb is displayed at a fictitious position. i May be set.
[0202]
As described above, in the image drawing method according to the sixth embodiment, the branch vector Vb is applied to the trunk 102. i Since the leaves are arranged on the branch vector, the image creator can determine the number of leaves Nl and the branch vector Vb. i Therefore, normal modeling work is not necessary, and each leaf is arranged on a branch, so that an atmosphere closer to an actual plant can be expressed.
[0203]
In the above description, the drawing of leaves has been described, but the present invention may be applied to other forms such as drawing of a group of animals in addition to drawing of leaves.
[0204]
It should be noted that the present invention Painting The image drawing device, the recording medium, and the program are not limited to the above-described embodiments, and various configurations can be adopted without departing from the gist of the present invention.
[0205]
【The invention's effect】
As described above, the present invention relates to Painting According to the image drawing apparatus, the recording medium, and the program, the polygon surface is rotated so that the normal line of the predetermined polygon surface faces a predetermined direction.
[0206]
For this reason, the effect that the polygon of the direction which is inconvenient on drawing can be corrected is achieved.
[Brief description of the drawings]
FIG. 1 is a hardware configuration diagram according to the present embodiment.
FIG. 2 is a configuration diagram of an electric circuit according to the present embodiment.
FIG. 3 is an explanatory diagram of analog input values obtained by left and right joysticks.
FIG. 4 is a diagram illustrating a leaf polygon.
FIG. 5 is a diagram illustrating an example in which a trunk object and a large number of leaf objects are drawn.
6A is a ZX plan view of the virtual space, FIG. 6B is an enlarged view of FIG. 6A, and FIG. 6C is a ZY plan view of the virtual space.
FIG. 7 is a flowchart of a tree drawing process.
FIG. 8 is a diagram illustrating an object information table.
FIG. 9 is a diagram showing a stem polygon information table;
FIG. 10 is a flowchart of trunk drawing processing;
FIG. 11 is a flowchart of leaf drawing processing;
FIG. 12 is a flowchart for determining the orientation of leaves according to the first embodiment.
FIG. 13 is a diagram illustrating a leaf polygon information table;
FIG. 14A is a diagram illustrating a first rotation process according to the first embodiment, and FIG. 14B is a diagram illustrating a second rotation process according to the first embodiment.
FIG. 15 is a flowchart (part 1) illustrating a flow of selecting a processing method for determining a leaf direction;
FIG. 16 is a flowchart (part 2) showing a flow of selecting a processing method for determining the leaf direction;
17A is a ZX plan view of a virtual space according to the second embodiment, and FIG. 17B is an enlarged view of FIG. 17A.
FIG. 18 is a diagram illustrating a rotation process according to the second embodiment.
FIG. 19 is a diagram for explaining vectors in the rotation processing according to the third embodiment.
FIG. 20 is a flowchart for determining the placement of leaves according to the fourth embodiment.
FIG. 21 is a view for explaining a leaf drawing range according to the fourth embodiment;
FIG. 22 is a flowchart for determining the arrangement of leaves according to the fifth embodiment.
FIG. 23A is a diagram illustrating a function for determining the X-axis component of the leaf arrangement according to the fifth embodiment, and FIG. 23B is a Y-axis component of the leaf arrangement according to the fifth embodiment; FIG. 23C is a diagram illustrating a function for determining the Z-axis component of the leaf arrangement according to the fifth embodiment.
FIG. 24 is a flowchart for determining the arrangement of leaves according to the sixth embodiment.
FIG. 25 is a diagram showing a branch vector information table.
FIG. 26 is a diagram illustrating a branch vector.
FIG. 27 is a diagram illustrating a branch vector.
[Explanation of symbols]
100 ... virtual space 102 ... trunk
104a ... Leaf polygon
104a1 to 104a4 ... vertex of leaf polygon
e ... Virtual viewpoint f, g, h ... Function
V ... Normal vector of polygon surface Vb i … Branch vector
Z0: Screen surface

Claims (8)

画像を表示するための表示装置が接続可能とされ、各種プログラムを実行するCPUが内蔵された画像描画装置において、In an image drawing apparatus in which a display device for displaying an image is connectable and a CPU for executing various programs is built-in,
前記プログラムは、The program is
オブジェクトおよびポリゴンが配置される仮想空間上の座標系で、A coordinate system in the virtual space where objects and polygons are placed.
少なくとも1つのポリゴンについて、所定の手段により回転させる手段と、Means for rotating at least one polygon by predetermined means;
画像を描画する基準の仮想視点の方向と、回転した前記ポリゴンの面の法線の方向とのなす角が90°±a°のときに、前記ポリゴン面の向きを再設定する手段と、Means for resetting the orientation of the polygonal surface when the angle formed by the direction of the reference virtual viewpoint for drawing the image and the direction of the normal of the surface of the rotated polygon is 90 ° ± a °;
して機能することを特徴とする画像描画装置。An image drawing apparatus characterized by functioning.
請求項1記載の画像描画装置において、
前記ポリゴンは、植物の葉または枝を含む画像であることを特徴とする画像描画装置
The image drawing apparatus according to claim 1.
The polygon image drawing apparatus, characterized in that the image including the leaves or branches of the plant.
請求項1又は2記載の画像描画装置において、
前記所定の手段は乱数発生手段であり、該乱数発止手段によって得られた乱数から設定された方向に前記ポリゴンを回転させることを特徴とする画像描画装置
The image drawing apparatus according to claim 1 or 2,
The image drawing apparatus characterized in that the predetermined means is a random number generating means, and the polygon is rotated in a direction set from the random number obtained by the random number starting means .
請求項1〜のいずれか1項に記載の画像描画装置において、
前記ポリゴンは、長方形又は正方形であることを特徴とする画像描画装置
The image drawing apparatus according to any one of claims 1 to 3 ,
The image drawing apparatus , wherein the polygon is a rectangle or a square.
請求項1〜のいずれか1項に記載の画像描画装置において、
前記ポリゴンに関する情報は、前記ポリゴンの全頂点のうち少なくとも1つの頂点の位置情報データを有することを特徴とする画像描画装置
In the image drawing device according to any one of claims 1 to 4 ,
The image drawing apparatus characterized in that the information about the polygon includes position information data of at least one vertex among all the vertices of the polygon.
請求項記載の画像描画装置において、
前記ポリゴンを回転させる手段では、前記少なくとも1つの頂点の位置情報データに対して回転の計算を施して回転後の変換位置を求めるとともに、他の頂点は前記変換位置から換算して求めることを特徴とする画像描画装置
The image drawing apparatus according to claim 5 .
The means for rotating the polygon performs a rotation calculation on the position information data of the at least one vertex to obtain a converted position after the rotation, and obtains the other vertex by converting from the converted position. An image drawing apparatus .
画像を表示するための表示装置が接続可能とされ、各種プログラムを実行するCPUが内蔵された画像描画装置で使用されるプログラムやデータが記録され、前記CPUが読み取り可能な記録媒体において、
前記プログラムは、
オブジェクトおよびポリゴンが配置される仮想空間上の座標系で、
少なくとも1つのポリゴンについて、所定の手段により回転させる手段と、
画像を描画する基準の仮想視点の方向と、回転した前記ポリゴンの面の法線の方向とのなす角が90°±a°のときに、前記ポリゴン面の向きを再設定する手段と、
して機能することを特徴とする記録媒体。
In a recording medium in which a display device for displaying an image is connectable, and a program and data used in an image drawing device including a CPU for executing various programs are recorded and readable by the CPU,
The program is
A coordinate system in the virtual space where objects and polygons are placed.
Means for rotating at least one polygon by predetermined means;
Means for resetting the orientation of the polygonal surface when the angle formed by the direction of the reference virtual viewpoint for drawing the image and the direction of the normal of the surface of the rotated polygon is 90 ° ± a °;
A recording medium that functions as a recording medium.
画像を表示するための表示装置が接続可能とされ、各種プログラムを実行するCPUが内蔵された画像描画装置で使用され、コンピュータにて読み取り、実行可能なプログラムにおいて、
オブジェクトおよびポリゴンが配置される仮想空間上の座標系で、
少なくとも1つのポリゴンについて、所定の手段により回転させる手段と、
画像を描画する基準の仮想視点の方向と、回転した前記ポリゴンの面の法線の方向とのなす角が90°±a°のときに、前記ポリゴン面の向きを再設定する手段と、
して機能することを特徴とするプログラム。
In a program that can be connected to a display device for displaying an image, is used in an image drawing device with a built-in CPU that executes various programs, and can be read and executed by a computer,
A coordinate system in the virtual space where objects and polygons are placed.
Means for rotating at least one polygon by predetermined means;
Means for resetting the orientation of the polygonal surface when the angle formed by the direction of the reference virtual viewpoint for drawing the image and the direction of the normal of the surface of the rotated polygon is 90 ° ± a °;
A program characterized by functioning.
JP2001359017A 2000-12-14 2001-11-26 Image drawing apparatus, recording medium, and program Expired - Fee Related JP3715568B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001359017A JP3715568B2 (en) 2000-12-14 2001-11-26 Image drawing apparatus, recording medium, and program

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2000380786 2000-12-14
JP2000-380786 2000-12-14
JP2001359017A JP3715568B2 (en) 2000-12-14 2001-11-26 Image drawing apparatus, recording medium, and program

Publications (2)

Publication Number Publication Date
JP2002245481A JP2002245481A (en) 2002-08-30
JP3715568B2 true JP3715568B2 (en) 2005-11-09

Family

ID=26605849

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001359017A Expired - Fee Related JP3715568B2 (en) 2000-12-14 2001-11-26 Image drawing apparatus, recording medium, and program

Country Status (1)

Country Link
JP (1) JP3715568B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3401899B2 (en) * 1994-03-01 2003-04-28 株式会社セガ Image display processing device
JP2981516B2 (en) * 1995-03-10 1999-11-22 富士通株式会社 3D shape editing device
JP3420870B2 (en) * 1995-12-18 2003-06-30 株式会社ナムコ Image composition method, image composition device, and game device
JPH09305738A (en) * 1996-05-10 1997-11-28 Sony Computer Entertainment:Kk Image processing method and device therefor
US6831659B1 (en) * 1998-05-20 2004-12-14 Kabushiki Kaisha Sega Enterprises Image processor unit, game machine, image processing method, and recording medium
JP2000132703A (en) * 1998-10-23 2000-05-12 Sega Enterp Ltd Picture processor

Also Published As

Publication number Publication date
JP2002245481A (en) 2002-08-30

Similar Documents

Publication Publication Date Title
JP3668019B2 (en) Recording medium, image processing apparatus, and image processing method
JP3637031B2 (en) GAME DEVICE AND GAME PROGRAM
US6317130B1 (en) Apparatus and method for generating skeleton-based dynamic picture images as well as medium storing therein program for generation of such picture images
JP4443012B2 (en) Image generating apparatus, method and recording medium
EP2105905A2 (en) Image generation apparatus
US6670957B2 (en) Entertainment apparatus, storage medium and object display method
US7062157B2 (en) Method and system for modifying a displayed symbolic image based on the accuracy of an input geometric shape
US7075533B2 (en) System for and method of implementing refraction mapping
JP3001538B1 (en) VIDEO GAME DEVICE, MODEL DISPLAY METHOD FOR VIDEO GAME, AND READABLE RECORDING MEDIUM ON WHICH MODEL DISPLAY PROGRAM FOR VIDEO GAME IS RECORDED
JP3602835B2 (en) VIDEO GAME DEVICE, ITS CONTROL METHOD, AND GAME PROGRAM
JP3715568B2 (en) Image drawing apparatus, recording medium, and program
JP4447000B2 (en) Image generation system, program, and information storage medium
JP2004159922A (en) Image generation system, program and information storage medium
US6585594B2 (en) Storage medium storing display control program, entertainment apparatus, and display control program
JP3539839B2 (en) Cursor display method, game system, and recording medium in pseudo-three-dimensionally displayed field
US20020082078A1 (en) Storage medium storing display control program, entertainment apparatus, and display control program
JP4824738B2 (en) GAME PROGRAM, GAME DEVICE, AND GAME CONTROL METHOD
JP3839355B2 (en) GAME DEVICE AND GAME PROGRAM
JP3429271B2 (en) 3D image processing method, apparatus thereof, computer-readable recording medium recording 3D image processing program, and video game apparatus
JP4054708B2 (en) GAME DEVICE AND GAME PROGRAM
US20020075275A1 (en) Storage medium storing display control program, entertainment apparatus, and display control program
JP3183636B2 (en) Three-dimensional game device and information storage medium
JP3735535B2 (en) Texture mapping method, recording medium, program, and program execution device
JP2002251626A (en) Method for generating image and program used for the same
JP2000167241A (en) Video game machine having feature in function for displaying attention pattern on game video generated by three-dimensional computer graphics, and program storage medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050113

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050125

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050324

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050524

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050720

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050825

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080902

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090902

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090902

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100902

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100902

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110902

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120902

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130902

Year of fee payment: 8

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

LAPS Cancellation because of no payment of annual fees