1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Trigger Solverなるものを作ってみる。

Posted at

Screenshot from 2015-10-31 05-03-17.png

友人からスケーリングをしながらフラクチャーが起こるエフェクトをどう作るか質問を受けたのでやってみた。

フレーム毎に小さくさせることとそれぞれのフラクチャーをアニメーションさせたバウンディングボックスでアクティベートしていることから、ピースごとににageアトリビュートをもたせることが必要だった。

Solver SOPを使ってTrigger Solver的なものを作ってみた。原理は単純で、赤い部分と黒い部分を作成し、赤い部分のみを元のジオメトリに転写していく。さらにそれを利用して黒い部分を削除し、赤く転写された時点のフレームをtriggerFrameとして内包。最終的にはそれを利用してageアトリビュートと手動で代入されたlifeアトリビュートと一緒にbiasアトリビュートを作成。

フラクチャー変形のジオメトリに対しては、Bulletを使用したいのもあって、Intrinsicと一緒にPackを利用している。

サイズを小さくしていっている場所は、/obj/fracture/SIM_Fracture/sopsolver1/scale_packed_objectにあり、Intrinsicデータを利用してそれぞれのフラクチャーに対してbiasアトリビュートを取り込みつつスケーリングしている。

vector scale = 1 * @bias;

matrix3 tr = primintrinsic(0, "transform", @primnum);
matrix scalem = maketransform(0, 0, {0,0,0}, {0,0,0}, scale, @P);
tr *= matrix3(scalem);
setprimintrinsic(0, "transform", @primnum, tr);

なんかもっとこういう方法もあるよ!とかあったら是非言ってもらえればありがたいです!

Download HIP File
*H14で作成しなおしたものを添付してます。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?