
髪の毛の表現を、Nurbsの透明マッピング、ペイントエフェクトのふたつの方法で説明する。
■透明マッピングによる髪の毛



上図のようなテキスチャーをそれぞれ、
A Color
B TransparencyとSpecular Color
C Bump Mapping
に指定する。
(BはTransparencyに指定したのち、ハイパーグラフのワークエリアから
マウス中ボタンでSpecular Colorへ)

マテリアルのコネクションは上図のようになる。


このマテリアルをNurbsのPlaneにアサインする。
Planeの端がわずかに不透明になっている。

Bのテキスチャのplace2dTextureのWrapV のチェックをはずす。
(Wrap U,Wrap Vは、UまたはV 方向にテクスチャを繰り返すという指定なので
テクスチャの一番端のピクセルの隣に、反対の端のピクセルを持ってきてぼかすので
端が不透明になったのである)

あとはNurbsを変形してヘアスタイルを作っていく。
(透過させているのでレンダリング時間は結構かかる)
■ペイントエフェクトの基本

Window > General Editors > Visor... でバイザーを開き、ブラシを選ぶ

Window > Paint Effects... でペイントエフェクトウィンドウを開き、
Paint > Paint Canvas をチェックして
試し描きをする。
キーbドラッグでブラシサイズを変更。
UndoはCanvas > Canvas Undo で一回のみ。


パースの画面でドラッグすると、y=0平面上にブラシストロークが描かれる。
Outlinerをみると、strokeというノードとNurbsのカーブ(ストロークパス)が作られているのがわかる。


Nurbsのプリミティブを作り、セレクトして、Renderingメニューセット
Paint Effects > Make Paintable
でNurbsオブジェクト上にブラシストロークが描かれる。
OutlinerのDisplay > Shapesにチェックを入れると、Nurbsのプリミティブにストロークパスが作られている。

ストロ-クのアトリビュートエディターを開くと、ブラシのアトリビュートも開く。
ブラシのアトリビュートは数がたくさんあるため、ここでは髪の毛の表現に必要と思われる
アトリビュートのみ説明する。
Global Scale ペイントエフェクトそのものにスケールツールでのスケールは掛けられないので、
ここでスケールを指定する。
(あとで複数のブラシのスケールを一度に変更することを考えて 1 を指定するとよい)
Brush Profile > Brush Width ブラシのストロークパスに対する幅。

Shading > Color1 ブラシの根元の色
Shading > Tube Shading > Color2 ブラシの先端の色

Tubes > Creation > Tubes Per Step ブラシの密度。ふやすほどレンダリングは重くなる。
Tubes > Creation > Segments ブラシの精度(なめらかさ)。ふやすほどレンダリングは重くなる。
Tubes > Creation > Length Min 長さ最小。
Tubes > Creation > Length Max 長さ最大。
Tubes > Creation > Tube Width1 根元の太さ。
Tubes > Creation > Tube Width2 先端の太さ。

Tubes > Creation > Tube Direction ブラシのストロークパスに対する方向。
Along Normal で垂直になる。
Tubes > Growth 植物のブラシはではここにチェックがはいる。髪の毛ではすべてオフ。

Tubes > Behavior > Displacement > Curl ブラシの縮れ度。いわゆるパーマがかかった状態。
■ペイントエフェクトでヘアスタイルを作る


ブラシの付近にNurbsのカーブを作り、ストローク → カーブの順にセレクトし、
Paint Effects > Curve Utilities > Set Stroke Control Curves
ブラシがカーブに沿うのでカーブのCVを動かしてブラシの方向を決める。
(沿わせるカーブ(コントロールカーブ)は複数でもよい)

ブラシの場所はNurbsオブジェクト上のカーブを動かして調整する。

ブラシのアトリビュートで
Tubes > Behavior > Forces > Path Follow ストロークパスに沿う度合い。
Tubes > Behavior > Forces > Path Attract ストロークパスに沿う度合い。
Tubes > Behavior > Forces > Curve Follow 上の手順で設定したコントロールカーブに沿う度合い。
Tubes > Behavior > Forces > Curve Attract 上の手順で設定したコントロールカーブに沿う度合い。

ペイントエフェクトはポリゴン上には描けないので、ポリゴンでモデリングしている場合は、
Nurbsオブジェクトをペイントエフェクト用に(頭部の中に)配置する。
ペイントエフェクトブラシのワークスペースでの表示精度は
Display > Stroke Display Quality > で指定する。
またウィンドーごとの表示非表示は
Show > Strokes のチェックでおこなう。


ペイントエフェクトはレンダリングが非常に重いので、Nurbsオブジェクトでだいたいのヘアスタイルを作り、
そこにペイントエフェクトの髪の毛を追加したのが、上図のである。
効率を高めるために
何種類か機能を合わせるんですねー。
ペイントエフェクトは特にレンダリングが重くなるので工夫がいりますね。
(この2,3日、blogの調子がおかしくなっていて、遅いレスポンスになってしまいました)