LoginSignup
23
6

More than 5 years have passed since last update.

TouchDesigner × Arduinoでインタラクティブな炎をつくる(1/2)

Last updated at Posted at 2017-08-10

TouchDesignerとArduinoを連携させて、息を吹きかけると揺れる炎を作ってみました。

炎をつくる

まず、TouchDesignerでこのような炎の作り方を説明していきます。
スクリーンショット 2017-08-08 23.27.36.png

1. 動きをつくる

Particle SOPを使って、炎の動きをつくっていきます。
まず、以下のようにノードを組みます。
スクリーンショット 2017-08-08 0.21.26.png

各オペレータのパラメータは以下のように設定します。

▶︎sphere1
Radius(xyz):0.1
▶︎sort1
Point Sort:Random
▶︎particle1
Stateページ > Particle Type:Render as Point Sprites
Forcesページ > External Force(y):1.5
Particlesページ > Birth:80

Sort SOPRandomを選択することで、sphereの頂点番号をランダムに変えることができます。
したがって、particleの発生源がランダムになり自然な発生になります。

2. 質感をつける

Ramp TOPとPoint Sprite MATを使って、質感をつけていきます。

まず、ramp1を以下のように設定します。
スクリーンショット 2017-08-08 13.44.13.png

▶︎ramp1
Type:Circular
Extend Right:Black
Hue, Sat, Valueは上の画像を参考にしてください

次に、Point Sprite MATを追加します。
スクリーンショット 2017-08-08 13.52.57.png

▶︎pointsprite1
(Point Spriteページは適当に設定してください)
Point Spriteページ > Color Map:ramp1
Point Spriteページ > Attenuate Point Scale:1
Point Spriteページ > Attenuate Near Distance:0
Point Spriteページ > Attenuate Far Distance:0
Point Spriteページ > Near Point Scale:1
Point Spriteページ > Far Point Scale:95
Commonページ > Blending:On
Commonページ > Source Color:One
Commonページ > Destination Color:One
Commonページ > Write Depth Values:Off

Source ColorとDestination ColorをOneにすることで、色を加算合成するよう設定しています。
ブレンドモードについて - OpenGL

そして、Geometry COMPを追加します。
スクリーンショット 2017-08-10 1.16.38.png

中身はデフォルトで入っているものを消して、以下のようにIn SOPだけにします。
ここで、右下のRenderボタン(紫)がonになっていないとレンダリングされないので注意してください。
スクリーンショット 2017-08-10 1.16.56.png

先ほどのparticle1にGeometry COMPをつなげます。
スクリーンショット 2017-08-08 13.56.04.png

pointsprite1をgeo1にドラッグ&ドロップすると以下のような画面が出てくるので、Materialを選択します。
スクリーンショット 2017-08-08 14.39.54.png

3. レンダリングする

Camera COMP, Light COMP, Render TOPを並べます。
スクリーンショット 2017-08-08 14.41.55.png

▶︎camera1
Translate(y):1.5
Translate(z):10

4. ノイズをのせる

Displace TOP, Noise TOP, Blur TOPを使って、炎にノイズをのせていきます。
スクリーンショット 2017-08-08 15.40.13.png

noise1のパラメータを変えることで炎の形状がかなり変わるので、色々試してみてください。
例として、ここでは以下のように設定しています。
スクリーンショット 2017-08-08 15.01.06.png

また、blur1は以下のようにパラメータを設定しています。

▶︎blur1
Blurページ > Pre-Shrink:3
Blurページ > Filter Size:15

TouchDesigner × Arduinoでインタラクティブな炎をつくる(2/2)

23
6
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
23
6