JP2004206329A - Simulation device, method and program - Google Patents

Simulation device, method and program Download PDF

Info

Publication number
JP2004206329A
JP2004206329A JP2002373561A JP2002373561A JP2004206329A JP 2004206329 A JP2004206329 A JP 2004206329A JP 2002373561 A JP2002373561 A JP 2002373561A JP 2002373561 A JP2002373561 A JP 2002373561A JP 2004206329 A JP2004206329 A JP 2004206329A
Authority
JP
Japan
Prior art keywords
point
coordinates
time
hair
initial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002373561A
Other languages
Japanese (ja)
Inventor
Ritsushi Takahashi
律視 高橋
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2002373561A priority Critical patent/JP2004206329A/en
Publication of JP2004206329A publication Critical patent/JP2004206329A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method for simulating the movement of hairs suitable for utilization in the field of a computer graphics (CG). <P>SOLUTION: By using initial data inputted in an initial data input part 101, a shape restriction initialization part 102 derives a relative positional relation among individual grid points constituting the hairs at the initial time. A state updating part 103 calculates the coordinates and the speed at the time t+Δt from the coordinates, speed and force of the grid points at the time t. A length restriction part 104 corrects the coordinates and speed of the grid points so as to keep the length of the hairs fixed. A shape restriction correction part 105 performs further correction based on the relative positional relation among the grid points at the initial time to the coordinates and speed of the grid points. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、シミュレーション装置、方法、プログラムに関するものであり、特にコンピュータグラフィックス分野(CG)で利用するのに好適な、体毛の動きをシミュレーションする装置、方法、プログラムに関するものである。
【0002】
【従来の技術】
従来からCG(コンピュータグラフィックス)によるアニメーション分野、コンピュータゲームの分野において、髪の毛のシミュレーション、モデリング等は幅広く行われてきた。
【0003】
これまでに髪の毛シミュレーションの手法として、運動方程式を解いて厳密に髪の毛の運動を求める手法、形状制約を行う手法、2Dの長方形領域を用いた手法等が提案されている。
【0004】
運動方程式を解いて厳密に髪の毛の運動を求める手法は、髪の毛の長さ方向と曲げ方向とに弾性力が働くと仮定して運動方程式をたてて、これを解くことにより髪の毛の自然な動きを表現しようとするものである。髪の毛の長さ方向にバネのような弾性力が働くと仮定して髪の毛の長さを制約するとともに、髪の毛の曲げ方向(長さ方向に垂直な方向)に対しても弾性力を仮定して髪の毛の癖を考慮するようにしている(例えば非特許文献1)。
【0005】
しかし、運動方程式を解く手法は、バネのような弾性力を仮定しているためにシミュレーションが不安定であり、時として結果が発散するという問題がある。
【0006】
形状制約を行う手法は、髪の毛をモデル化する際に例えば人間の顔や頭の輪郭形状に合わせて形状制約を行うことで、自然な髪の動き、形状を表現しようとするものである(例えば、特許文献1)。
【0007】
しかし、髪全体の形状を強制的に制約するために、髪の毛の形状に制約を強く加えてしまうので、髪の毛の動きが非常に硬くなてしまい柔軟性に欠けるという問題があった。
【0008】
また、2Dの長方形の領域をまとまった領域としてシミュレーションを行い、そこに、髪の毛のテクスチャーを重ねることで髪の動きを表現する方法もある(例えば非特許文献2)。しかし、長方形の領域でシミュレーションしているため、動きの方向性によっては不自然な結果が得られるなどの問題があった。
【0009】
【特許文献1】
特開2001−357415公報
【0010】
【非特許文献1】
Johnny Chang, Jingyi Jin, and Yizhou Yu. A Practical Model for Hair Mutual Interactions,Siggraph2002 pp.73−80
【0011】
【非特許文献2】
Koh C.K. and Huang Z. A simple physics model to animate human hair modeled in 2D strips in real time. EG CAS2001 pp.127−138
【0012】
【発明が解決しようとする課題】
上述したように、従来のシミュレーション方法はいずれも完全とはいえず、計算結果が発散してしまったり、あるいは、髪の毛の動きが不自然になる等の問題を抱えている。
【0013】
そこで、本発明では、安定に計算可能であるとともに、見た目に自然で髪の毛の癖も考慮された動きを計算可能なシミュレーション装置及び方法を提供することを目的とする。
【0014】
【課題を解決するための手段】
上記課題を解決するため本発明のシミュレーション装置、方法、プログラムでは、体毛の一本一本を任意間隔で配置された複数点で構成されているとモデル化し、その挙動をシミュレーションする。これら複数点のそれぞれを格子点とする。
【0015】
まず、初期時刻における、各点の座標及び速度並びに各点にかかる力の入力を行う。そして、初期時刻における各点の座標から、各点とこれに隣接する点との間隔である初期間隔及び各点付近の体毛の形状を算出する。具体的には、初期時刻における体毛の各格子点間の距離l(エル)と、体毛の各格子点における体毛の曲がる方向(3次元的角度)とである。
【0016】
次に、ある時刻tにおける、各点の座標、各点の速度、各点にかかる力を用いて、微小時間△t経過後の時刻t+△tにおける各点の座標を求める。すなわち、体毛を構成する各格子点について、それぞれの位置、速度、働く力から、現在の時刻から微小な時間経過後の各格子点の位置、速度を計算する。
【0017】
そして、前記初期間隔に基づいて、更新された各点の座標を修正する。体毛を構成する格子点間の距離を所定の間隔に保つため、格子点の位置、速度を所定の長さ制約の条件に従って修正する。長さ制約の条件とは、前述の初期時刻における各格子点間の距離である。
【0018】
さらに、初期時刻での前記各点付近の体毛の形状に基づいて、更新された各点の座標を修正する。体毛の癖を特徴付けるために、体毛を構成する各格子点とその近傍の点との間の相対的な位置関係から制約をかける。相対的な位置関係はとは、前述の初期時刻における各格子点間の距離及び曲がる方向である。
【0019】
具体例を挙げて説明する(後に図5を用いて説明する)。相対的な位置関係とは、初期時刻においてある格子点(格子点X)から根元方向に隣接する格子点(格子点Y)と、格子点Yからさらに根元方向に隣接する格子点(格子点Z)とに注目した時の、格子点Yと格子点Zとを通る直線YZと、格子点Xと格子点Yとを通る直線XYとがなす3次元的角度αと、格子点Yと格子点Xとの距離l(エル)である。
【0020】
例えば、格子点Yを原点とし、直線YZを軸とし、格子点Zからさらに根元方向に隣接する格子点(格子点W)と格子点Y、Zとを含む平面YZWを方位角の基準とする3次元球極座標系を考える。
【0021】
格子点Xの座標は、この座標系では(動径r、極角(軸に対する角度)θ、方位角φ)とで表される。3次元的角度αは、この座標系における格子点Xの極角θと、方位角φとを用いて表すことができる。また、格子点Yと格子点Xとの距離l(エル)は、この座標系における格子点Xの動径rになる。
【0022】
時刻t+△tにおける具体的な修正手法の一例は次のとおりである(後で図6〜図8を用いて説明する)。
【0023】
まず、長さ制約の条件に基づく修正を次のように行う。格子点Xを、格子点Xと格子点Yとを通る直線XY上で移動させる。格子点Xを初期時刻における格子点Xと格子点Yとの距離l(エル)と等しくなる点に移動させる。このように格子点Xを修正して得られる点を修正点X’とする。
【0024】
次に、体毛の癖に基づく修正を行う。初期時刻において求めておいた格子点Yと格子点Xとの距離l(エル)及び3次元的角度α及び時刻t+△tにおける格子点W、Z、Yの座標から候補点X”を求める。
【0025】
すなわち、初期時刻において、格子点Yを原点とする3次元球極座標系を考えたのと同様に、時刻t+△tにおいても格子点Yを原点とし、直線YZを軸とし、格子点Zからさらに根元方向に隣接する格子点(格子点W)と格子点Y、Zとを含む平面YZWを方位角の基準とする3次元球極座標系を考える。
【0026】
そして、以下の条件を満たす点X”を求める。
(1)格子点Yからの距離がl(エル)である。
(2)極角が初期時刻におけるθと等しい。
(3)方位角が初期時刻におけるφと等しい。
【0027】
そして、候補点X”を、時刻t+△tにおける格子点Y及び格子点Zを通る直線YZを軸に所定の角度だけ回転させる。すなわち、極角θを固定して方位角φのみを所定の範囲で変動させて回転させる。回転により候補点X”が描く円弧上で、前述の修正点X’に最も近い位置にある点を体毛の癖に基づく修正後の格子点Xとする。
【0028】
尚、前述の候補点X”を回転させる「所定の角度」は、体毛の性質(硬い、柔らかい)、各格子点の位置(根元か先端か)に応じて値を変えると良い。
【0029】
尚、各格子点の座標を修正した場合、修正前の格子点から修正後の格子点へ向かう方向である修正方向に平行な方向について、速度の修正を行うと良い。
【0030】
例えば、格子点の修正方向に平行な方向の速度を0にする、0より大きく1より小さい値を乗じて減衰させる、符号を反転させる、−1より大きく0より小さい値を乗じて符号を反転させた上で減衰させる等の修正方法が挙げられる。
【0031】
【発明の実施の形態】
以下、図面を参照して本発明の一実施形態のシミュレーション装置について説明する。
【0032】
(概略構成)図1は本発明の一実施形態のシミュレーション装置の概略構成を説明するブロック図である。
【0033】
このシミュレーション装置は、利用者から髪の毛の各格子点について、座標・速度・加速度等の初期値を入力する初期データ入力部101と、初期データに基づいて髪の毛の特徴(形状・長さ)を制約情報として算出する形状制約初期化部102と、各格子点の速度・各格子点にかかる力に基づいて運動方程式を解いて微小時間経過後の格子点の座標を算出する状態更新部103とを備える。
【0034】
さらに、状態更新部103で求めた微小時間経過後の格子点の座標を長さに関する制約に基づいて修正する長さ制約部104と、修正された格子点の座標を形状に関する制約に基づいて修正する形状制約修正部105と、長さ及び形状の条件で修正された格子点の座標データ列を出力する結果出力部106とを備える。
【0035】
尚、結果出力部106から得られる座標データ列は、外部プロッタや表示装置で描画されたり、記憶装置に蓄積される。
【0036】
本実施形態のシミュレーション装置はコンピュータ上で動作させるプログラムとして実現される。すなわち、コンピュータに上述の各部の機能を実現させるシミュレーションプログラムである。尚、本装置の一部あるいは全部を半導体集積回路等のハードウエアとして実現しても良い。
【0037】
図2はシミュレーションプログラムを動作させるコンピュータの概略構成を説明する図である。
【0038】
このコンピュータは本シミュレーションプログラム及び処理データを一時記憶するメモリ202と、シミュレーション処理を行う中央演算処理装置201と、本シミュレーションプログラムや結果を格納する磁気ディスクドライブ203と、光ディスクドライブ204とを備える。
【0039】
さらに、LCDやCRT等の表示デバイスに表示する画面を描画して画像データを出力するインターフェースである画像出力部205と、LCDやCRT等の表示デバイスである表示装置207と、キーボード、マウス等の各種入力デバイスである入力装置208と、入力装置208からの入力を受け付けるインターフェースである入力受付部206とを備える。
【0040】
シミュレーションプログラムは磁気ディスクドライブ203に格納されている。そして、シミュレーションを行う時に読み出されてメモリ202に展開されて中央演算処理装置201において実行される。実行結果は磁気ディスクドライブ203に格納されるほか、適宜、画像出力部205を介して表示装置207に出力されるものとする。尚、シミュレーション結果は、他のプログラム(例えばゲームプログラムやCGアニメーションプログラム等)で使用するために、プロセス間通信の機能(例えば、共有メモリ、パイプ)を用いて出力しても良い。
【0041】
以下、シミュレーション装置の各部の説明を行う。
【0042】
(初期データ入力部101)初期データ入力部101は、シミュレーション対象となる髪の毛の一本一本を構成する格子点の座標の入力と、各格子点の質量、初期速度、加速度、各格子点にかかる力(外力)、シミュレーション時間等のシミュレーションの初期条件の入力を受ける。
【0043】
尚、頭にある全ての髪の毛を一本一本シミュレーションしても良いが、使用する計算機の性能によっては計算量過多になることもある。その場合は、計算機の性能に応じて数百〜数千本程度に適宜間引いて入力を行っても良い。
【0044】
間引いた場合であっても、後述するように一本の髪の毛のシミュレーション結果に基づいて、その周囲に同じ結果を用いた髪の毛を複数生成(平行移動させたデータを生成)することで、髪の毛のボリューム感、質感を損なうことを避けられる。
【0045】
シミュレーションの初期条件は、予め磁気ディスク等に格納しておいた、各格子点の質量、初期座標、初期速度、初期加速度、各格子点に働く力を表す関数、各格子点に働く力の初期値、各格子点がどの髪の毛の根元から何番目の格子点であるかを表す識別情報等の情報を読み込むことにより入力を行う。
【0046】
尚、格子点の座標等の入力を対話的に行っても良い。例えば、コンピュータの画面上にシミュレーション対象の髪の毛を有する人の頭部を映し、利用者が画面に表示された頭部を見ながら、ポインティングデバイス等で格子点を指示するようにしても良い。各格子点の初期速度、各格子点に働く力の関数、各格子点に働く力の初期値も同様にして各点ごとに対話的に設定する。
【0047】
例えば、図4のように顔401を画面に表示しておく。利用者はポインティングデバイスで格子点402の座標を指定する(例えば利用者がマウスをクリックした場所に格子点を設定する)。そして、格子点を設定する毎にダイアログを表示させ、利用者に質量、速度、加速度、外力も設定してもらう(例えば数値や数式を入力してもらう)という方法が考えられる。
【0048】
(形状制約初期化部102)形状制約初期化部102は、初期時刻t0において、各格子点毎に、それぞれの近傍の格子点との相対的な位置関係から髪の毛の癖を特徴付けるパラメータを求める。ここでは、髪の毛の癖として、髪の毛の各格子点間の距離(間隔)と各格子点近傍における曲がり具合とを考える。
【0049】
本実施形態では、それぞれの格子点について髪の毛の根元方向に向かって3個隣までにある格子点との相対的な位置関係を求める。
【0050】
図5は、ある一本の髪の毛において、ある格子点xと、その根元方向に隣接する格子点yと、格子点yから根元方向に隣接する格子点zと、格子点zから根元方向に隣接する格子点wとを用いて相対的な位置関係を求める様子を説明する図である。
【0051】
本実施形態では、相対的な位置関係を表すパラメータとして、格子点yを原点とし、格子点yと格子点zとを通る直線yzを軸とし、格子点y、z、wを含む平面yzwを方位角の基準とする3次元球極座標における、格子点xの座標を用いる。尚、本実施形態では、方位角0度の基準となるのは、平面yzwを直線yzで二分割した際に格子点wを含まない側とする。
【0052】
上述の3次元球極座標を用いると、格子点xの座標は(距離l(エル)、極角α1、方位角α2)の3成分で表すことができる。格子点yが原点なので、格子点xの座標のうち「距離l(エル)」の成分は格子点yと格子点xとの間の距離を表すパラメータになる。
【0053】
また、「極角α1」「方位角α2」の成分は、格子点yに対する格子点xの方向を表すので、髪の毛の曲がり具合を表すパラメータとなる。
【0054】
尚、方位角の基準の取り方は本実施形態と逆(格子点wを含む側)にしても構わないし、平面yzwの法線を用いても構わない。平面yzwを直線yzを軸に任意の角度回転させた平面を基準にしても良い。
【0055】
(状態更新部103)状態更新部103は、各格子点毎の座標、速度、力から運動方程式を解いて、微小時間△t経過後の時刻t+△tにおける座標、速度を求める。
【0056】
時刻tにおける格子点の座標x(t)、速度v(t)、格子点にかかる力f(t)、質量mと表現して、
【0057】
【数1】

Figure 2004206329
【0058】
等の式で表される運動方程式を解く。
【0059】
(長さ制約部104)長さ制約部104は状態更新部103において計算した各格子点の座標、速度を修正する。修正は、髪の毛の根元にあたる格子点から先端に向かって順番に行う。
【0060】
髪の毛はバネと異なりほとんど伸び縮みしない。従って各格子点間の距離はほとんど不変になるはずである。そこで長さ制約部104では、形状制約初期化部102で求めた各格子点間の距離l(エル)を用いて、状態更新部103で求めた時刻t+△tにおける座標を修正する。
【0061】
図6は長さ制約部104において、ある格子点xの座標を修正する様子を説明する図である。時刻t+△tでも距離が初期時刻t0と等しいl(エル)になるように修正する。
【0062】
状態更新部103で求めた時刻t+△tにおける、ある格子点の座標x(t+△t)、速度v(t+△t)、この格子点の髪の毛の根元方向に隣接する格子点の座標y(t+△t)を用いると、修正された座標は
【0063】
【数2】
Figure 2004206329
【0064】
のようになる。
【0065】
格子点xよりも髪の毛の先端側にある各格子点についても、同様に(d−l)eyx(t+△t)を差し引いておく。すなわち、格子点xから髪の毛の先端までを(d−l)eyx(t+△t)だけ平行移動させる。
【0066】
速度に関しては座標を修正するために移動した方向の成分を0にする。すなわち、
【0067】
【数3】
Figure 2004206329
【0068】
尚、座標修正のために移動した方向の速度成分を0にする代わりに、適当な抵抗係数(1より小さい)を掛けて減衰させたり、あるいは符号を反転させても良い。また、減衰させて符号を反転させても良い。
【0069】
本実施形態では、速度に関しては、座標の場合とは異なり、格子点xよりも髪の毛の先端側にある各格子点については修正しない。
【0070】
(形状制約修正部105)形状制約修正部105は長さ制約部104で修正した格子点の座標を髪の毛の曲がり具合に応じて修正する。
【0071】
通常、髪の毛は極端な曲がり方はしないはずである。従って、各格子点の曲がり具合は初期値と比較して大幅には変化しないものと考えられる。そこで、髪の毛の曲がり具合は初期値から所定の範囲内に収まると見做して各格子点の座標を修正する。
【0072】
ある格子点xの座標を修正するに先だって、まず、形状制約の条件から格子点xの座標x候補1(t+△t)を求める。それから、x候補1(t+△t)と長さ制約部104で求めたx修正(t+△t)とを用いて曲げ方向に修正された格子点xの座標であるx候補2(t+△t)を求める。
【0073】
図7は時刻t+△tにおいて、ある格子点xの座標を形状制約の条件から求める様子を説明する図である。
【0074】
まず、修正対象格子点から髪の毛の根元方向に向かって1つ隣にある格子点yの座標y(t+△t)と、髪の毛の根元方向に向かって2つ隣にある格子点zのの座標z(t+△t)と、形状制約初期化部102で求めた極角α1、方位角α2と、形状制約初期化部102で求めた格子点yと格子点xとの間の距離の初期値l(エル)を用いて、形状制約から導かれる格子点xの座標であるx候補1(t+△t)を求める。
【0075】
具体的には、初期時刻において格子点yを原点とする3次元球極座標を考えたのと同様にして、時刻t+△tにおいて格子点y(t+△t)を原点とし、直線yz(t+△t)を軸とし、平面yzw(t+△t)を方位角の基準とする3次元球極座標を考える。
【0076】
この球極座標において、以下の条件を満たす点をx候補1(t+△t)とする。
(1)原点である格子点y(t+△t)からの距離がl(エル)。すなわち座標の動径成分がl(エル)。
(2)極角がα1
(3)方位角がα2
【0077】
このようにして求めたx候補1(t+△t)は、髪の毛の曲がり具合が初期時刻t0の時と全く同じであると仮定した場合の格子点の座標である。
【0078】
次に、上述の3次元球極座標においてx候補1(t+△t)の方位角α2を所定の範囲で変動させる。そして、x修正(t+△t)に最も近い点を求めることで、曲げ方向に修正された格子点xの座標x候補2(t+△t)を求める。
【0079】
図8は時刻t+△tにおいて、x候補1(t+△t)とx修正(t+△t)とを用いて、格子点xの曲げ方向について修正された座標であるx候補2(t+△t)を求める様子を説明する図である。
【0080】
上述の3次元球極座標においてx候補1(t+△t)の方位角α2を±βの範囲で変動させて得られる円弧802について考える。円弧802上でx修正(t+△t)に最も近い点をx候補2(t+△t)とする。方位角の変動範囲を修正範囲の条件と呼ぶ。本実施形態では修正範囲の条件βは30度とする。
【0081】
上述の円弧802は、x候補1(t+△t)を直線yz(t+△t)を軸に回転させて得られる円軌道801の一部に相当する。
【0082】
尚、修正範囲の条件βの値は、髪の毛の質(硬い、柔らかい)等に応じて適宜変化させて良い。また、βの値を髪の毛の先端と根元とで変化させても良い。例えば、根元ではβを小さくしておき、先端に行くに従ってβを大きくしても良い。
【0083】
x候補2(t+△t)を時刻t+△tにおける格子点xの座標とする。さらに、格子点xより髪の毛の先端側にある全ての格子点についても、x候補2(t+△t)−x修正(t+△t)だけ移動させ、格子点xから髪の毛の先端までがx候補2(t+△t)−x修正(t+△t)だけ平行移動するように修正する。
【0084】
また、長さ制約部で修正して得られた速度v修正を、さらに修正してv修正2を求める。具体的には、座標をx修正(t+△t)からx候補2(t+△t)に修正するために移動した方向の成分を0にする。式で表すと、
【0085】
【数4】
Figure 2004206329
【0086】
となる。
【0087】
尚、長さ制約部102で行った速度修正と同様、座標修正のために格子点xを移動させた方向の速度成分を0にする代わりに、適当な抵抗係数(1より小さい)を掛けて減衰させたり、あるいは符号を反転させても良い。また、減衰させて符号を反転させても良い。
【0088】
また、本実施形態では、x候補2(t+△t)を円弧802上で見つけたが、これに限らず、例えばy(t+△t)を中心としてx候補1(t+△t)を通る球面のうち、x候補1(t+△t)を中心とする含む所定の領域(例えば、ある所定の立体角内の範囲)の中からx候補2(t+△t)を見つけても良い。
【0089】
(結果出力部106)形状制約修正部105において得られた各格子点の座標を基に髪の毛を表現するデータ列を生成する。本実施形態では各格子点を根元から順番に連結して髪の毛を描画する。
【0090】
尚、これまでに計算してきた一部或いは全部髪の毛について、それぞれ髪の毛の周囲に一定幅、ランダム幅あるいはガウス分布等を用いて決めた幅で平行移動した位置に格子点を複製して髪の毛を描画しても良い。このようにすれば、シミュレーションを行った本数以上の髪の毛を表現することが可能となる。
【0091】
(動作)以下、図面を参照して本実施形態のシミュレーション装置の動作について説明する。図3は本実施形態のシミュレーション装置の処理の流れを説明する図である。
【0092】
(ステップ301)まず、初期データとして、シミュレーションを行う時間、シミュレーションを行う時間間隔(すなわち微小時間△tの値)、各格子点の座標、速度、加速度の初期値、各格子点の質量、各格子点に働く外力(例えば、空気抵抗等の粘性抵抗や重力)の関数、各格子点がどの髪の毛の何番目の点であるかを表す識別情報等の入力を受ける。入力された初期データはメモリ202に記憶しておく。
【0093】
初期データの入力は、予め磁気ディスク等に格納しておいたデータを読み込むことで行うが、前述したように、対話的に行っても構わない。
【0094】
(ステップ302)入力された初期データから、各格子点毎に、それぞれの近傍の格子点との相対的な位置関係から髪の毛の癖を特徴付けるパラメータを求める。髪の毛の癖として、髪の毛の長さ(格子点間の間隔、距離)と曲がり具合とを考える。
【0095】
髪の毛の長さと曲がり具合を特徴付けるパラメータとして、それぞれの格子点について髪の毛の根元方向に向かって3個隣までにある格子点との相対的な位置関係を求める。前述したように、根元方向に隣接する格子点を原点とする3次元球極座標を考え、原点からの距離、極角、方位角を求める。すなわち、図5における、隣接する格子点との距離l(エル)と、極角α1と、方位角α2とを求める。
【0096】
尚、本実施形態では距離l(エル)は各格子点間ごとに異なる値とするが、初期データを工夫して同一の値にしても良い。
【0097】
(ステップ303)各格子点毎に運動方程式を解いて微小時間△t経過後の座標を求める。すなわち、前述の状態更新部103の処理を行う。
【0098】
(ステップ304)ステップ303で求めた各格子点の微小時間△t経過後の座標を、微小時間△t経過後も各格子点間の長さが初期データの時と同じ距離l(エル)となるように座標の修正を行う。すなわち、前述の長さ制約部104の処理を行う。
【0099】
(ステップ305)ステップ304で修正した各格子点の座標を、さらに髪の毛の曲げ方向について修正を行う。すなわち、前述の形状制約修正部105の処理を行う。ここで修正して得られる座標を微小時間△t経過後の格子点の座標とする。
【0100】
(ステップ306)微小時間△t経過後の各格子点の座標を結果として出力する。結果の出力は座標値を用いて髪の毛を描画して画面に表示させるようにしても良いし、座標データとして磁気ディスク等の記憶媒体に記憶させておいても良い。また、必要に応じて、速度、加速度等を出力しても良い。
【0101】
(ステップ307)シミュレーションを行う時間が経過したかを調べる。シミュレーションを行う時間が終わっていなければステップ303に戻り、次の微小時間△t経過後のシミュレーションを行う。微小時間△tが積み重なり、シミュレーションを行う時間が満了した場合はシミュレーションを終了する。
【0102】
(本実施形態の効果)以上、本実施形態によれば、物理的な運動方程式による計算に加えて、長さによる制約と、髪の毛の曲がり具合による制約とに基づく修正を行うようにしたことで、自然で、しかも、髪の毛の癖の影響が考慮された動きを計算することができる。
【0103】
(変形例)本実施形態では、初期時刻における各格子点間の距離については特に制約をしていないが、これを一定の値に固定しても良い。こうすれば、形状制約初期化部102で格子点間の距離を求める必要がなくなり、計算処理量を減らすことができる。
【0104】
【発明の効果】
以上、本発明によれば、物理的な運動方程式による計算と、体毛の格子点間の長さによる制約と、体毛の形状による制約とに基づく修正を行うようにしたことで、自然で、しかも、体毛の癖の影響が考慮された動きを計算することができる。
【図面の簡単な説明】
【図1】本発明の一実施形態のシミュレーション装置の構成を説明する図。
【図2】本発明の一実施形態のシミュレーションプログラムを動作させるコンピュータの図。
【図3】本発明の一実施形態のシミュレーションプログラムの動作の流れを説明する図。
【図4】対話的に格子点を設定する例を説明する図。
【図5】初期データにおいて、格子点間の相対的な位置関係を求める処理を説明する図。
【図6】長さ制約部における処理を説明する図。
【図7】形状制約修正部における修正処理の前半を説明する図。
【図8】形状制約修正部における修正処理の後半を説明する図。
【符号の説明】
101 初期データ入力部
102 形状制約初期化部
103 状態更新部
104 長さ制約部
105 形状制約修正部
106 結果出力部[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a simulation device, a method, and a program, and more particularly, to a device, a method, and a program suitable for use in the computer graphics field (CG) for simulating the movement of body hair.
[0002]
[Prior art]
2. Description of the Related Art In the field of animation by CG (computer graphics) and the field of computer games, simulation and modeling of hair have been widely performed.
[0003]
So far, as a method of hair simulation, a method of solving the equation of motion to strictly determine the motion of the hair, a method of performing shape restriction, a method using a 2D rectangular area, and the like have been proposed.
[0004]
The method of precisely calculating the motion of the hair by solving the equation of motion is based on the assumption that elastic force acts in the length direction and the bending direction of the hair. Is to be expressed. Assuming that a spring-like elastic force acts in the length direction of the hair, the length of the hair is restricted, and the elastic force is also assumed in the bending direction of the hair (the direction perpendicular to the length direction). The hair habit is taken into consideration (for example, Non-Patent Document 1).
[0005]
However, the method of solving the equation of motion has a problem that the simulation is unstable because an elastic force like a spring is assumed, and the result sometimes diverges.
[0006]
The method of performing shape restriction is to express natural hair movement and shape by performing shape restriction according to, for example, the contour shape of a human face or head when modeling hair (for example, , Patent Document 1).
[0007]
However, since the shape of the whole hair is forcibly restricted, the shape of the hair is strongly restricted, so that the movement of the hair becomes very hard and lacks flexibility.
[0008]
There is also a method in which a simulation is performed by assuming a 2D rectangular area as a grouped area, and the texture of the hair is overlaid thereon to express the movement of the hair (for example, Non-Patent Document 2). However, since the simulation is performed in a rectangular area, an unnatural result may be obtained depending on the direction of the motion.
[0009]
[Patent Document 1]
JP 2001-357415 A
[0010]
[Non-patent document 1]
Johnny Chang, Jingyi Jin, and Yizhou Yu. A Practical Model for Hair Mutual Interactions, Graph 2002 pp. 73-80
[0011]
[Non-patent document 2]
Koh C .; K. and Huang Z. A simple physics model toanimate human hair modeled in 2D strips in real time. EG CAS 2001 pp. 127-138
[0012]
[Problems to be solved by the invention]
As described above, all of the conventional simulation methods are not perfect, and have a problem that the calculation result diverges or the movement of the hair becomes unnatural.
[0013]
Therefore, an object of the present invention is to provide a simulation apparatus and method capable of calculating a movement that can be stably calculated, and that can calculate a movement that is natural in appearance and takes into consideration the habit of the hair.
[0014]
[Means for Solving the Problems]
In order to solve the above problems, the simulation apparatus, method, and program of the present invention model each body hair as being constituted by a plurality of points arranged at arbitrary intervals, and simulate the behavior. Let each of these plural points be a lattice point.
[0015]
First, the coordinates and speed of each point and the force applied to each point at the initial time are input. Then, based on the coordinates of each point at the initial time, an initial interval, which is an interval between each point and an adjacent point, and the shape of body hair near each point are calculated. Specifically, the distance 1 (ell) between the lattice points of the hair at the initial time and the direction (three-dimensional angle) in which the hair is bent at each lattice point of the hair.
[0016]
Next, using the coordinates of each point, the speed of each point, and the force applied to each point at a certain time t, the coordinates of each point at a time t + Δt after the elapse of the minute time Δt are obtained. That is, for each grid point constituting the body hair, the position and speed of each grid point after a lapse of a minute time from the current time are calculated from the respective positions, speeds and working forces.
[0017]
Then, the updated coordinates of each point are corrected based on the initial interval. In order to keep the distance between the grid points constituting the body hair at a predetermined interval, the positions and speeds of the grid points are corrected according to the conditions of the predetermined length constraint. The condition of the length constraint is the distance between each grid point at the above-mentioned initial time.
[0018]
Further, the updated coordinates of each point are corrected based on the shape of the body hair near each point at the initial time. In order to characterize the hair habit, restrictions are imposed on the relative positional relationship between each lattice point constituting the hair and points in the vicinity thereof. The relative positional relationship is the distance between the respective grid points and the direction of the turn at the initial time.
[0019]
A specific example will be described (described later with reference to FIG. 5). The relative positional relationship includes a lattice point (lattice point Y) adjacent to a root point from a certain lattice point (lattice point X) at an initial time and a lattice point (lattice point Z) further adjacent to the lattice point Y in a root direction. ), A three-dimensional angle α formed by a straight line YZ passing through the grid points Y and Z, a straight line XY passing through the grid points X and Y, a grid point Y and the grid points It is the distance 1 (ell) from X.
[0020]
For example, a lattice point Y is set as an origin, a straight line YZ is set as an axis, and a plane YZW including a lattice point (lattice point W) adjacent to the lattice point Z in the root direction and lattice points Y and Z is used as a reference of the azimuth angle. Consider a three-dimensional spherical polar coordinate system.
[0021]
The coordinates of the lattice point X are represented by (radial radius r, polar angle (angle with respect to axis) θ, azimuth angle φ) in this coordinate system. The three-dimensional angle α can be represented using the polar angle θ of the lattice point X in this coordinate system and the azimuth angle φ. Further, a distance 1 (ell) between the lattice point Y and the lattice point X becomes a moving radius r of the lattice point X in this coordinate system.
[0022]
An example of a specific correction method at time t + Δt is as follows (described later with reference to FIGS. 6 to 8).
[0023]
First, the correction based on the condition of the length constraint is performed as follows. The grid point X is moved on a straight line XY passing through the grid point X and the grid point Y. The grid point X is moved to a point equal to the distance 1 (ell) between the grid point X and the grid point Y at the initial time. A point obtained by correcting the grid point X in this manner is referred to as a corrected point X ′.
[0024]
Next, the correction based on the habit of the body hair is performed. A candidate point X ″ is obtained from the distance l (ell) between the lattice point Y and the lattice point X obtained at the initial time, the three-dimensional angle α, and the coordinates of the lattice points W, Z, and Y at the time t + Δt.
[0025]
That is, at the initial time, the grid point Y is set as the origin, the straight line YZ is set as the axis, and further from the grid point Z at time t + Δt, as in the case of the three-dimensional spherical polar coordinate system having the grid point Y as the origin. Consider a three-dimensional spherical polar coordinate system in which a plane YZW including grid points (grid points W) adjacent to the root direction and grid points Y and Z is used as a reference for the azimuth angle.
[0026]
Then, a point X ″ that satisfies the following condition is obtained.
(1) The distance from the lattice point Y is 1 (ell).
(2) The polar angle is equal to θ at the initial time.
(3) The azimuth is equal to φ at the initial time.
[0027]
Then, the candidate point X ″ is rotated by a predetermined angle about a straight line YZ passing through the grid point Y and the grid point Z at the time t + Δt. That is, the polar angle θ is fixed and only the azimuth angle φ is set to the predetermined angle. The point closest to the correction point X ′ on the arc drawn by the candidate point X ″ by the rotation is defined as the corrected lattice point X based on the habit of the body hair.
[0028]
The value of the "predetermined angle" for rotating the candidate point X "may be changed according to the properties of the hair (hard or soft) and the position of each lattice point (root or tip).
[0029]
When the coordinates of each grid point are corrected, the speed may be corrected in a direction parallel to the correction direction, which is a direction from the grid point before correction to the grid point after correction.
[0030]
For example, the velocity in the direction parallel to the correction direction of the lattice point is set to 0, attenuated by multiplying by a value greater than 0 and less than 1, inverted by a sign, and inverted by a value greater than -1 and less than 0 There is a correction method such as attenuating and then attenuating.
[0031]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, a simulation device according to an embodiment of the present invention will be described with reference to the drawings.
[0032]
(Schematic Configuration) FIG. 1 is a block diagram illustrating a schematic configuration of a simulation apparatus according to one embodiment of the present invention.
[0033]
The simulation apparatus includes an initial data input unit 101 for inputting initial values such as coordinates, speed, and acceleration for each grid point of a hair from a user, and restricts characteristics (shape and length) of the hair based on the initial data. A shape constraint initialization unit 102 for calculating information and a state update unit 103 for calculating the coordinates of the lattice point after a lapse of a short time by solving the equation of motion based on the speed of each lattice point and the force applied to each lattice point. Prepare.
[0034]
Further, a length constraint unit 104 that modifies the coordinates of the grid point after the elapse of a short time obtained by the state updating unit 103 based on the constraint on the length, and modifies the coordinates of the corrected grid point based on the constraint on the shape. And a result output unit 106 that outputs a coordinate data sequence of grid points corrected under conditions of length and shape.
[0035]
Note that the coordinate data sequence obtained from the result output unit 106 is drawn by an external plotter or a display device or stored in a storage device.
[0036]
The simulation device according to the present embodiment is realized as a program operated on a computer. That is, it is a simulation program that causes a computer to realize the functions of the above-described units. A part or all of the present device may be realized as hardware such as a semiconductor integrated circuit.
[0037]
FIG. 2 is a diagram illustrating a schematic configuration of a computer that operates a simulation program.
[0038]
The computer includes a memory 202 for temporarily storing the simulation program and processing data, a central processing unit 201 for performing a simulation process, a magnetic disk drive 203 for storing the simulation program and results, and an optical disk drive 204.
[0039]
Further, an image output unit 205, which is an interface for drawing a screen to be displayed on a display device such as an LCD or CRT and outputting image data, a display device 207, which is a display device such as an LCD or CRT, and a keyboard, a mouse, etc. An input device 208 as various input devices and an input receiving unit 206 as an interface for receiving an input from the input device 208 are provided.
[0040]
The simulation program is stored in the magnetic disk drive 203. Then, it is read out at the time of performing the simulation, expanded in the memory 202 and executed in the central processing unit 201. The execution result is stored in the magnetic disk drive 203 and output to the display device 207 via the image output unit 205 as appropriate. Note that the simulation result may be output using an inter-process communication function (for example, a shared memory or a pipe) for use in another program (for example, a game program or a CG animation program).
[0041]
Hereinafter, each part of the simulation apparatus will be described.
[0042]
(Initial Data Input Unit 101) The initial data input unit 101 inputs coordinates of grid points constituting each hair to be simulated, and inputs mass, initial velocity, acceleration, and grid points of each grid point. Input of initial conditions of the simulation such as the force (external force) and the simulation time is received.
[0043]
Note that all the hairs in the head may be simulated one by one, but the amount of calculation may be excessive depending on the performance of the computer used. In that case, the input may be appropriately thinned out to several hundreds to several thousands depending on the performance of the computer.
[0044]
Even in the case where the hair is thinned out, a plurality of hairs using the same result are generated around the periphery of the simulation based on the simulation result of one hair as described later (data generated by moving the hairs in parallel), thereby generating the hair. It can avoid losing the volume and texture.
[0045]
The initial conditions of the simulation include the mass, initial coordinates, initial velocity, initial acceleration, a function representing the force acting on each grid point, and the initial force acting on each grid point, which are stored in advance on a magnetic disk or the like. The input is performed by reading values and information such as identification information indicating the number of grid points from the root of which hair each grid point is.
[0046]
The input of the coordinates of the grid points and the like may be performed interactively. For example, the head of a person having hair to be simulated may be projected on the screen of a computer, and the user may point a grid point using a pointing device or the like while looking at the head displayed on the screen. Similarly, the initial speed of each grid point, the function of the force applied to each grid point, and the initial value of the force applied to each grid point are set interactively for each point.
[0047]
For example, a face 401 is displayed on the screen as shown in FIG. The user specifies the coordinates of the grid point 402 with the pointing device (for example, the grid point is set at the place where the user clicks the mouse). Then, a method is conceivable in which a dialog is displayed every time a grid point is set, and the user is also required to set the mass, speed, acceleration, and external force (for example, to input a numerical value or a mathematical expression).
[0048]
(Shape Constraint Initializing Unit 102) At initial time t0, the shape constraint initializing unit 102 obtains, for each grid point, a parameter characterizing the habit of the hair from the relative positional relationship with each neighboring grid point. Here, as the habit of the hair, the distance (interval) between each lattice point of the hair and the degree of bending near each lattice point are considered.
[0049]
In the present embodiment, a relative positional relationship between each grid point and three grid points adjacent to the grid point in the root direction of the hair is determined.
[0050]
FIG. 5 shows that a certain hair has a certain grid point x, a grid point y adjacent in the root direction, a grid point z adjacent in the root direction from the grid point y, and a root point adjacent in the root direction from the grid point z. FIG. 7 is a diagram for explaining how to determine a relative positional relationship using a lattice point w.
[0051]
In the present embodiment, as a parameter indicating a relative positional relationship, a plane yzw including a lattice point y, z, and w is used as a parameter, with a lattice point y as an origin, a straight line yz passing through the lattice point y and a lattice point z as an axis. The coordinates of the lattice point x in the three-dimensional spherical polar coordinates used as the reference for the azimuth are used. In the present embodiment, the reference of the azimuth angle of 0 degree is a side not including the grid point w when the plane yzw is divided into two by the straight line yz.
[0052]
Using the three-dimensional spherical polar coordinates described above, the coordinates of the grid point x are (distance l (el), polar angle α 1 , Azimuth α Two )). Since the grid point y is the origin, the component of “distance l (el)” of the coordinates of the grid point x is a parameter representing the distance between the grid point y and the grid point x.
[0053]
Also, "polar angle α 1 Azimuth α Two Represents the direction of the grid point x with respect to the grid point y, and is a parameter indicating the degree of bending of the hair.
[0054]
Note that the azimuth angle reference may be set in a manner opposite to that of the present embodiment (on the side including the lattice point w), or the normal of the plane yzw may be used. A plane obtained by rotating the plane yzw by an arbitrary angle about the straight line yz may be used as a reference.
[0055]
(State Update Unit 103) The state update unit 103 solves the equation of motion from the coordinates, speed, and force of each grid point, and obtains the coordinates and speed at time t + Δt after the elapse of the minute time Δt.
[0056]
Expressed as coordinates x (t) of the grid point at time t, velocity v (t), force f (t) applied to the grid point, and mass m,
[0057]
(Equation 1)
Figure 2004206329
[0058]
Solve the equation of motion expressed by the following equation.
[0059]
(Length Constraining Unit 104) The length constraining unit 104 corrects the coordinates and speed of each grid point calculated by the state updating unit 103. The correction is performed in order from the grid point at the root of the hair to the tip.
[0060]
Hair hardly stretches unlike a spring. Therefore, the distance between each grid point should be almost unchanged. Therefore, the length constraint unit 104 corrects the coordinates at the time t + Δt obtained by the state update unit 103, using the distance 1 (ell) between the lattice points obtained by the shape constraint initialization unit 102.
[0061]
FIG. 6 is a diagram for explaining how the length constraint unit 104 corrects the coordinates of a certain grid point x. At time t + Δt, the distance is corrected so as to be 1 (ell) equal to the initial time t0.
[0062]
At the time t + Δt obtained by the state updating unit 103, the coordinates x (t + Δt) and the velocity v (t + Δt) of a certain grid point and the coordinates y ( Using t + Δt), the corrected coordinates are
[0063]
(Equation 2)
Figure 2004206329
[0064]
become that way.
[0065]
Similarly, for each grid point on the tip end side of the hair with respect to the grid point x, (dl) e yx (T + Δt) is subtracted. That is, the distance from the lattice point x to the tip of the hair is (dl) e yx Translate by (t + Δt).
[0066]
Regarding the speed, the component of the moving direction is set to 0 to correct the coordinates. That is,
[0067]
[Equation 3]
Figure 2004206329
[0068]
Instead of setting the velocity component in the moving direction for coordinate correction to 0, the velocity component may be attenuated by an appropriate resistance coefficient (smaller than 1) or may be inverted in sign. Further, the sign may be inverted by attenuating.
[0069]
In the present embodiment, with respect to the speed, unlike the case of the coordinates, each grid point on the tip side of the hair with respect to the grid point x is not corrected.
[0070]
(Shape Constraint Correction Unit 105) The shape constraint correction unit 105 corrects the coordinates of the lattice points corrected by the length constraint unit 104 according to the degree of bending of the hair.
[0071]
Normally, hair should not bend extremely. Therefore, it is considered that the degree of bending at each lattice point does not change significantly as compared with the initial value. Therefore, the coordinates of each grid point are corrected on the assumption that the degree of bending of the hair falls within a predetermined range from the initial value.
[0072]
Prior to correcting the coordinates of a certain grid point x, first, a coordinate x candidate 1 (t + Δt) of the grid point x is obtained from the condition of the shape constraint. Then, x candidate 2 (t + Δt) which is the coordinates of the grid point x corrected in the bending direction using x candidate 1 (t + Δt) and x correction (t + Δt) obtained by the length constraint unit 104 ).
[0073]
FIG. 7 is a diagram for explaining how to obtain the coordinates of a certain grid point x from the condition of the shape constraint at time t + Δt.
[0074]
First, coordinates y (t + Δt) of a grid point y adjacent to the correction target grid point in the direction of the root of the hair and coordinates of a grid point z adjacent to the grid point two in the direction of the root of the hair. z (t + △ t) and the polar angle α obtained by the shape constraint initialization unit 102 1 , Azimuth α Two Using the initial value l (ell) of the distance between the lattice point y and the lattice point x obtained by the shape constraint initialization unit 102, x candidate 1 (the coordinates of the lattice point x derived from the shape constraint) t + Δt).
[0075]
Specifically, at time t + Δt, the lattice point y (t + Δt) is set as the origin, and a straight line yz (t + Δ Consider three-dimensional spherical polar coordinates using t) as an axis and the plane yzw (t + Δt) as an azimuth reference.
[0076]
In the spherical polar coordinates, a point that satisfies the following condition is defined as x candidate 1 (t + Δt).
(1) The distance from the lattice point y (t + Δt), which is the origin, is l (ell). That is, the radial component of the coordinates is l (ell).
(2) The polar angle is α 1 .
(3) Azimuth angle is α Two .
[0077]
The x candidate 1 (t + Δt) obtained in this manner is the coordinates of the grid point on the assumption that the degree of bending of the hair is exactly the same as at the initial time t0.
[0078]
Next, the azimuth α of x candidate 1 (t + Δt) in the above-described three-dimensional spherical polar coordinates Two Is varied within a predetermined range. Then, by finding the point closest to x correction (t + Δt), the coordinate x candidate 2 (t + Δt) of the grid point x corrected in the bending direction is obtained.
[0079]
FIG. 8 shows, at time t + Δt, x candidate 2 (t + Δt) which is the coordinate corrected in the bending direction of the grid point x using x candidate 1 (t + Δt) and x correction (t + Δt). FIG.
[0080]
Azimuth angle α of x candidate 1 (t + Δt) in the above three-dimensional spherical polar coordinates Two Is considered within a range of ± β. The point closest to the x correction (t + Δt) on the arc 802 is defined as x candidate 2 (t + Δt). The range in which the azimuthal angle fluctuates is referred to as a correction range condition. In the present embodiment, the condition β of the correction range is 30 degrees.
[0081]
The above-described arc 802 corresponds to a part of a circular orbit 801 obtained by rotating x candidate 1 (t + Δt) around a straight line yz (t + Δt).
[0082]
It should be noted that the value of the condition β of the correction range may be appropriately changed according to the quality (hard or soft) of the hair. Further, the value of β may be changed between the tip and the root of the hair. For example, β may be reduced at the root, and may be increased toward the tip.
[0083]
Let x candidate 2 (t + Δt) be the coordinates of grid point x at time t + Δt. Further, all the grid points on the tip side of the hair from the grid point x are moved by x candidate 2 (t + Δt) −x correction (t + Δt), and the x point from the grid point x to the tip of the hair is x candidate. 2 (t + Δt) −x correction (t + Δt) so as to translate in parallel.
[0084]
Further, the velocity v correction obtained by the correction by the length constraint unit is further corrected to obtain the v correction 2. Specifically, the component in the direction in which the coordinate has been moved in order to correct the coordinates from x correction (t + Δt) to x candidate 2 (t + Δt) is set to 0. In terms of the formula,
[0085]
(Equation 4)
Figure 2004206329
[0086]
It becomes.
[0087]
Note that, similarly to the speed correction performed by the length restricting unit 102, instead of setting the speed component in the direction in which the grid point x is moved for the coordinate correction to be 0, a suitable resistance coefficient (less than 1) is multiplied. It may be attenuated or the sign inverted. Further, the sign may be inverted by attenuating.
[0088]
In the present embodiment, the x candidate 2 (t + Δt) is found on the arc 802. However, the present invention is not limited to this. For example, a spherical surface passing through the x candidate 1 (t + Δt) with y (t + Δt) as the center. Among them, x candidate 2 (t + Δt) may be found from a predetermined area (for example, a range within a certain predetermined solid angle) including x candidate 1 (t + Δt) as a center.
[0089]
(Result output unit 106) A data string expressing hair is generated based on the coordinates of each grid point obtained by the shape constraint correction unit 105. In this embodiment, the hair is drawn by connecting the grid points in order from the root.
[0090]
For some or all of the hair calculated so far, the grid points are duplicated and drawn at positions that have been translated around the hair with a fixed width, random width, or a width determined using Gaussian distribution, etc. You may. In this way, it is possible to represent more hairs than the number of hairs simulated.
[0091]
(Operation) Hereinafter, the operation of the simulation apparatus of the present embodiment will be described with reference to the drawings. FIG. 3 is a view for explaining the flow of processing of the simulation device of the present embodiment.
[0092]
(Step 301) First, as initial data, the time for performing the simulation, the time interval for performing the simulation (ie, the value of the minute time Δt), the coordinates of each grid point, the initial values of the velocity and the acceleration, the mass of each grid point, A function of an external force (for example, viscous resistance such as air resistance or gravity) acting on a lattice point, identification information indicating which hair point each hair point corresponds to, and the like are input. The input initial data is stored in the memory 202.
[0093]
The input of the initial data is performed by reading data stored in advance on a magnetic disk or the like, but may be performed interactively as described above.
[0094]
(Step 302) From the input initial data, for each grid point, a parameter that characterizes the habit of the hair is obtained from the relative positional relationship with each neighboring grid point. As the habit of the hair, the length of the hair (interval between grid points and distance) and the degree of bending are considered.
[0095]
As parameters characterizing the length and the degree of bending of the hair, the relative positional relationship between each grid point and the next three grid points in the root direction of the hair is determined. As described above, considering the three-dimensional spherical polar coordinates having the origin at the lattice point adjacent in the root direction, the distance from the origin, the polar angle, and the azimuth are obtained. That is, the distance l (ell) between the adjacent lattice points and the polar angle α in FIG. 1 And the azimuth α Two And ask.
[0096]
In the present embodiment, the distance l (ell) is different for each lattice point, but the same value may be used by devising the initial data.
[0097]
(Step 303) The equation of motion is solved for each grid point to find the coordinates after the elapse of the minute time Δt. That is, the processing of the state updating unit 103 described above is performed.
[0098]
(Step 304) The coordinates of each grid point after the elapse of the minute time Δt obtained in Step 303 are defined as the distance l (ell) after the elapse of the minute time Δt, where the length between the grid points is the same as that of the initial data. Correct the coordinates so that That is, the processing of the length restriction unit 104 is performed.
[0099]
(Step 305) The coordinates of each grid point corrected in step 304 are further corrected for the bending direction of the hair. That is, the processing of the shape constraint correction unit 105 described above is performed. The coordinates obtained by the correction are the coordinates of the lattice point after the elapse of the minute time Δt.
[0100]
(Step 306) The coordinates of each grid point after the elapse of the minute time Δt are output as a result. The output of the result may be drawn on the screen by drawing the hair using the coordinate values, or may be stored as coordinate data in a storage medium such as a magnetic disk. Further, speed, acceleration, and the like may be output as necessary.
[0101]
(Step 307) It is checked whether the time for performing the simulation has elapsed. If the time for performing the simulation is not over, the process returns to step 303, and the simulation is performed after the elapse of the next minute time Δt. When the minute time Δt is accumulated and the time for performing the simulation expires, the simulation is ended.
[0102]
(Effects of the present embodiment) As described above, according to the present embodiment, in addition to the calculation based on the physical equation of motion, the correction based on the restriction based on the length and the restriction based on the degree of bending of the hair is performed. It is possible to calculate a movement that is natural and takes into account the influence of the habit of the hair.
[0103]
(Modification) In the present embodiment, the distance between the grid points at the initial time is not particularly limited, but may be fixed to a constant value. This eliminates the need for the shape constraint initialization unit 102 to determine the distance between grid points, and can reduce the amount of calculation processing.
[0104]
【The invention's effect】
As described above, according to the present invention, the calculation based on the physical equation of motion, the restriction based on the length between the lattice points of the hair, and the correction based on the restriction based on the shape of the hair are performed naturally, and In addition, it is possible to calculate the movement in consideration of the influence of the hair habit.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating a configuration of a simulation device according to an embodiment of the present invention.
FIG. 2 is a diagram of a computer that operates a simulation program according to an embodiment of the present invention.
FIG. 3 is an exemplary view for explaining the flow of the operation of the simulation program according to the embodiment of the present invention;
FIG. 4 is a view for explaining an example in which grid points are set interactively.
FIG. 5 is a view for explaining processing for obtaining a relative positional relationship between lattice points in initial data.
FIG. 6 is a view for explaining processing in a length constraint unit.
FIG. 7 is a view for explaining the first half of the correction processing in the shape constraint correction unit.
FIG. 8 is a view for explaining the latter half of the correction processing in the shape constraint correction unit.
[Explanation of symbols]
101 Initial data input section
102 Shape constraint initialization unit
103 Status Update Unit
104 Length constraint
105 Shape constraint correction unit
106 Result output unit

Claims (11)

体毛の少なくとも一本が複数の点で構成されているとモデル化し、その挙動をシミュレーションする装置であって、
初期時刻における、各点の座標及び速度並びに各点にかかる力を入力する初期データ入力部と、
初期時刻における各点の座標から、各点とこれに隣接する点との間隔である初期間隔及び各点付近の体毛の形状を算出する形状制約初期化部と、
ある時刻tにおける、各点の座標、各点の速度、各点にかかる力を用いて、微小時間△t経過後の時刻t+△tにおける各点の座標を求める状態更新部と、
前記初期間隔に基づいて、更新された各点の座標を修正する長さ制約部と、
初期時刻での前記各点付近の体毛の形状に基づいて、更新された各点の座標を修正する形状制約修正部と、
を備えるシミュレーション装置。
A device that models that at least one of the hairs is composed of a plurality of points and simulates its behavior,
At an initial time, an initial data input unit for inputting coordinates and speed of each point and a force applied to each point,
From the coordinates of each point at the initial time, a shape constraint initialization unit that calculates an initial interval that is an interval between each point and a point adjacent thereto and the shape of body hair near each point,
A state updating unit that obtains the coordinates of each point at a time t + Δt after the elapse of the minute time Δt using the coordinates of each point, the speed of each point, and the force applied to each point at a certain time t;
A length constraint unit that corrects the coordinates of each updated point based on the initial interval,
Based on the shape of the hair near each point at the initial time, a shape constraint correction unit that corrects the coordinates of each updated point,
A simulation device comprising:
前記長さ制約部は、
時刻t+△tにおける各点とこれに隣接する点との間隔が、前記初期間隔と等しくなるように、各点の座標を修正することを特徴とする請求項1記載のシミュレーション装置。
The length constraint unit includes:
2. The simulation apparatus according to claim 1, wherein coordinates of each point are corrected such that an interval between each point and a point adjacent thereto at time t + Δt is equal to the initial interval.
前記形状制約初期化部では、各点において体毛が曲がる角度を求めておき、
前記形状制約修正部では、各点における、時刻t+△tでの体毛の曲がる角度と初期時刻での体毛の曲がる角度との差が所定の範囲に収まるように、各点の座標を修正する、
ことを特徴とする請求項1記載のシミュレーション装置。
In the shape constraint initialization unit, the angle at which the body hair is bent at each point is obtained,
The shape constraint correction unit corrects the coordinates of each point so that the difference between the angle at which the hair turns at time t + Δt and the angle at which the hair turns at the initial time falls within a predetermined range.
The simulation device according to claim 1, wherein:
前記状態更新部では、時刻t+△tにおける各点の速度も求めておき、
前記長さ制約部では、前記速度のうち前記長さ制約部で各点の座標を修正した方向に平行な速度成分について、
0にする、
減衰させる、
符号を反転させる、または
符号を反転させて減衰させる、
のいずれかの修正を行う請求項1乃至請求項3記載のシミュレーション装置。
The state updating unit also obtains the speed of each point at time t + Δt,
In the length constraint unit, of the speed, for a speed component parallel to the direction in which the coordinates of each point are corrected by the length constraint unit,
To 0,
Attenuate,
Invert the sign, or invert the sign and attenuate,
The simulation apparatus according to claim 1, wherein the simulation apparatus performs one of the following modifications.
前記状態更新部では、時刻t+△tにおける各点の速度も求めておき、
前記形状制約修正部では、前記速度のうち前記形状制約修正部で各点の座標を修正した方向に平行な速度成分について、
0にする、
減衰させる、
符号を反転させる、または、
符号を反転させて減衰させる、
のいずれかの修正を行う請求項1乃至請求項3記載のシミュレーション装置。
The state updating unit also obtains the speed of each point at time t + Δt,
In the shape constraint correction unit, for the velocity component parallel to the direction in which the coordinates of each point are corrected by the shape constraint correction unit in the speed,
To 0,
Attenuate,
Invert the sign, or
Invert the sign and attenuate,
The simulation apparatus according to claim 1, wherein the simulation apparatus performs one of the following modifications.
前記形状制約修正部では、前記長さ制約部で修正された速度に対して、
さらに、前記修正された速度のうち前記形状制約修正部で各点の座標を修正した方向に平行な速度成分について、
0にする、
減衰させる、
符号を反転させる、または、
符号を反転させて減衰させる、
のいずれかの修正を行う請求項4記載のシミュレーション装置。
In the shape constraint correction unit, for the speed corrected in the length constraint unit,
Further, of the corrected speed, for a speed component parallel to the direction in which the coordinates of each point are corrected by the shape constraint correcting unit,
To 0,
Attenuate,
Invert the sign, or
Invert the sign and attenuate,
5. The simulation apparatus according to claim 4, wherein any one of the following modifications is performed.
体毛の少なくとも一本が複数の点で構成されているとモデル化し、その挙動をシミュレーションする方法であって、
初期時刻における、各点の座標及び速度並びに各点にかかる力を入力し、
初期時刻における各点の座標から、各点とこれに隣接する点との間隔である初期間隔及び各点付近の体毛の形状を算出し、
ある時刻tにおける、各点の座標、各点の速度、各点にかかる力を用いて、微小時間△t経過後の時刻t+△tにおける各点の座標を求め、
前記初期間隔に基づいて各点の座標の修正を行い、
初期時刻での各点付近の体毛の形状に基づいて各点の座標の修正を行う、
シミュレーション方法。
A method of modeling that at least one of the hairs is composed of a plurality of points and simulating its behavior,
Enter the coordinates and speed of each point and the force applied to each point at the initial time,
From the coordinates of each point at the initial time, calculate the initial interval which is the interval between each point and a point adjacent thereto and the shape of the hair near each point,
Using the coordinates of each point, the speed of each point, and the force applied to each point at a certain time t, the coordinates of each point at a time t + Δt after the elapse of the minute time Δt are obtained,
Correct the coordinates of each point based on the initial interval,
Modify the coordinates of each point based on the shape of the hair near each point at the initial time,
Simulation method.
前記初期間隔に基づく各点の座標の修正にあたっては、
時刻t+△tにおける各点とこれに隣接する点との間隔が、前記初期間隔と等しくなるように、各点の座標を修正することを特徴とする請求項7記載のシミュレーション方法。
In correcting the coordinates of each point based on the initial interval,
8. The simulation method according to claim 7, wherein coordinates of each point are corrected such that an interval between each point at time t + Δt and a point adjacent thereto is equal to the initial interval.
初期時刻における各点の座標から、各点の体毛の曲がり具合を表すパラメータとして、各点において体毛が曲がる角度を求めておき、
前記初期時刻における体毛の曲がり具合に基づく各点の座標の修正にあたっては、
各点における、時刻t+△tでの体毛の曲がる角度と初期時刻での体毛の曲がる角度との差が所定の範囲に収まるように、各点の座標を修正することを特徴とする請求項7記載のシミュレーション方法。
From the coordinates of each point at the initial time, the angle at which the hair is bent at each point is determined as a parameter representing the degree of bending of the hair at each point,
In correcting the coordinates of each point based on the degree of bending of the hair at the initial time,
8. The coordinates of each point are corrected so that the difference between the angle at which the hair turns at time t + Δt and the angle at which the hair turns at the initial time falls within a predetermined range. The described simulation method.
ある時刻tにおける、各点の座標、各点の速度、各点にかかる力を用いて、微小時間△t経過後の時刻t+△tにおける各点の速度も求めておき、
前記初期間隔に基づく各点の座標の修正並びに前記初期時刻での体毛の曲がり具合に基づく各点の座標の修正において、各点の座標を修正した方向に平行な速度成分について、
0にする、
減衰させる、
符号を反転させる、または
符号を反転させて減衰させる、
のいずれかの修正を行う請求項7乃至請求項9記載のシミュレーション方法。
Using the coordinates of each point, the speed of each point, and the force applied to each point at a certain time t, the speed of each point at time t + Δt after the elapse of the minute time Δt is also obtained.
In the correction of the coordinates of each point based on the initial interval and the correction of the coordinates of each point based on the degree of bending of the body hair at the initial time, for a velocity component parallel to the direction in which the coordinates of each point are corrected,
To 0,
Attenuate,
Invert the sign, or invert the sign and attenuate,
The simulation method according to any one of claims 7 to 9, wherein any one of the following modifications is performed.
体毛の少なくとも一本が複数の点で構成されているとモデル化し、その挙動をシミュレーションさせるプログラムであって、
コンピュータに、
初期時刻における、各点の座標及び速度並びに各点にかかる力を入力する入力ステップと、
初期時刻における各点の座標から、各点とこれに隣接する点との間隔である初期間隔及び各点付近の体毛の形状を算出する形状パラメータ初期化ステップと、
ある時刻tにおける、各点の座標、各点の速度、各点にかかる力を用いて、微小時間△t経過後の時刻t+△tにおける各点の座標を求める状態更新ステップと、
前記初期間隔に基づいて各点の座標の修正を行う長さ方向修正ステップと、
初期時刻での各点付近の体毛の形状に基づいて各点の座標の修正を行う曲げ方向修正ステップと、
を実行させるシミュレーションプログラム。
A program that models at least one body hair as being composed of a plurality of points and simulates its behavior,
On the computer,
At the initial time, an input step of inputting the coordinates and speed of each point and the force applied to each point,
From the coordinates of each point at the initial time, a shape parameter initialization step of calculating an initial interval that is an interval between each point and a point adjacent thereto and the shape of body hair near each point,
A state updating step of obtaining the coordinates of each point at time t + Δt after the elapse of the minute time Δt using the coordinates of each point, the speed of each point, and the force applied to each point at a certain time t;
A length direction correction step of correcting the coordinates of each point based on the initial interval,
A bending direction correction step of correcting the coordinates of each point based on the shape of the hair near each point at the initial time,
A simulation program to execute.
JP2002373561A 2002-12-25 2002-12-25 Simulation device, method and program Pending JP2004206329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002373561A JP2004206329A (en) 2002-12-25 2002-12-25 Simulation device, method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002373561A JP2004206329A (en) 2002-12-25 2002-12-25 Simulation device, method and program

Publications (1)

Publication Number Publication Date
JP2004206329A true JP2004206329A (en) 2004-07-22

Family

ID=32811809

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002373561A Pending JP2004206329A (en) 2002-12-25 2002-12-25 Simulation device, method and program

Country Status (1)

Country Link
JP (1) JP2004206329A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009541840A (en) * 2006-06-22 2009-11-26 センター ナショナル ド ラ ルシェルシュ サイエンティフィーク Method and system for generating a composite image of at least a portion of hair
CN102339475A (en) * 2011-10-26 2012-02-01 浙江大学 Rapid hair modeling method based on surface grids
CN111583367A (en) * 2020-05-22 2020-08-25 构范(厦门)信息技术有限公司 Hair simulation method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009541840A (en) * 2006-06-22 2009-11-26 センター ナショナル ド ラ ルシェルシュ サイエンティフィーク Method and system for generating a composite image of at least a portion of hair
US8743124B2 (en) 2006-06-22 2014-06-03 Centre Nationale De Recherche Scientifique Method and a system for generating a synthesized image of at least a portion of a head of hair
CN102339475A (en) * 2011-10-26 2012-02-01 浙江大学 Rapid hair modeling method based on surface grids
CN111583367A (en) * 2020-05-22 2020-08-25 构范(厦门)信息技术有限公司 Hair simulation method and system
CN111583367B (en) * 2020-05-22 2023-02-10 构范(厦门)信息技术有限公司 Hair simulation method and system

Similar Documents

Publication Publication Date Title
US10198847B2 (en) Physically based simulation methods for modeling and animating two-and three-dimensional deformable objects
US7859538B2 (en) Converting deformation data for a mesh to animation data for a skeleton, skinning and shading in a runtime computer graphics animation engine
US5404426A (en) Method of displaying hair style and apparatus for the same
KR101525054B1 (en) Apparatus and method for simplifing three dimensional mesh data
Lauterbach et al. Interactive sound rendering in complex and dynamic scenes using frustum tracing
CN108245890B (en) Method and device for controlling movement of object in virtual scene
US8538737B2 (en) Curve editing with physical simulation of mass points and spring forces
JP4425890B2 (en) Simulation apparatus, simulation method, and program
JP2010515995A (en) Real-time close simulation system and method
US9665979B2 (en) Rendering damaged-enhanced images in an interactive computer simulation
Mosegaard et al. GPU accelerated surgical simulators for complex morphology
KR100588000B1 (en) Apparatus and method for capturing free surface of fluid in computer animation
Qian et al. Essential techniques for laparoscopic surgery simulation
US9449417B1 (en) Artistic simulation of curly hair
JP2009020874A (en) Hair simulation method, and device therefor
JP2004021883A (en) Association simulation device, method and program for fluid and rigid body
JP2004206329A (en) Simulation device, method and program
Kry et al. Inverse kinodynamics: Editing and constraining kinematic approximations of dynamic motion
JP2007048151A (en) Method for mapping object mesh model onto three-dimensional curved surface
Tagawa et al. Adaptive and embedded deformation model: An approach to haptic interaction with complex inhomogeneous elastic objects
García et al. Perceptually validated global/local deformations
JP3084098B2 (en) Computer animation interactive processing system and device
Najim et al. dynamic fracturing of 3d models for real time computer graphics
KR101635621B1 (en) Mesh generating method and Circle packing method using particle simultion, Computer program for the same, Recording medium storing computer program for the same
Nykl et al. Interactive mesostructures with volumetric collisions

Legal Events

Date Code Title Description
A621 Written request for application examination

Effective date: 20040609

Free format text: JAPANESE INTERMEDIATE CODE: A621

RD02 Notification of acceptance of power of attorney

Effective date: 20050415

Free format text: JAPANESE INTERMEDIATE CODE: A7422

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20050606

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070214

A131 Notification of reasons for refusal

Effective date: 20070220

Free format text: JAPANESE INTERMEDIATE CODE: A131

A02 Decision of refusal

Effective date: 20070619

Free format text: JAPANESE INTERMEDIATE CODE: A02