2014年12月7日日曜日

ピアノにプロジェクションマッピング - ラピュタ (2)

今回は技術の話を少し。DirectX の 3D グラフィックスはおおまかに言うと

(1) 空間上の座標を決めてテクスチャをペタペタ配置する
(2) 視点の座標を決める
(3) (2) の視点と (1) の間にスクリーンを置いて、そのスクリーンを通して見える映像を出力

という形になります。
普通は (2) の視点を (3) のスクリーンと垂直の位置(スクリーンを正面から見る位置)にして映像を描かせると思いますが、この動画ではそれをずらしています。



実環境でピアノ上に表示される映像サイズと撮影カメラの位置から座標を計算すれば、あとは DirectX が描いてくれます。
視点の位置は簡単に調整できるようにしてあり、動画に使った設定と真正面の設定で出力を比較するとこうなります。



上の画像は視点を左下に設定しているので、左下方向から眺めるとちょうど良く見えます。

もう一つ。後半の二重奏部分も新しいチャレンジで、3D 空間上に動画ファイルの変速再生を追加しました。速度を調整しながら動画ファイルから1フレームずつ取り出し、表示位置を決めて貼り付けています。PC のパフォーマンス的にできるかどうかわからないけれど、試してみたらなんとかなったという感じです。

今回は作っていて技術的にわりと楽しかったので勢いで色々書いてしまいましたが、意味不明だったかも…

1 件のコメント:

  1. Despite these firm restrictions, they don't apply to vacationers and ex-pats. In October 2000, when Kangwon Land first opened to Korean citizens nicely as|in addition to} to international vacationers, it had one resort with 199 rooms and a casino that had only 30 table video games and 480 slot machines. 카지노사이트 B2B reside video games supplier TVBET has partnered with Monotech, a multi-channel iGaming platform for on-line, cell, and land-based merchandise, in a deal that may see TVBET video games built-in into the Monotech platform. It’s an uncommon thing to see within the heart of the Olympics, largely end result of|as a result of} few discover themselves} at the Games in any capacity have a lot time to gamble. But at other instances of yr, the Alpensia resort is part ski lodge, part water park with a number of} motels and eating places catering to international vacationers. So perhaps having a casino tucked behind a door adjoining the lobby of a Holiday Inn is smart.

    返信削除